NSImage and NSView problems - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: NSImage and NSView problems (/thread-5152.html)
NSImage and NSView problems - Joseph Duchesne - Aug 19, 2005 07:12 AM
Hi, I'm having problems with resizing my NSView. When I make it smaller, it doesn't clear the old area where it was drawn. Example:
What I don't want
What I do want
I got the second image by simply shrinking the window to the dock and popping it back. That cleared the crap.
The code I'm using is:
My second problem is totally unrelated... I'm trying to load a 300DPI file into an NSImage, but it seems to be scaling it to 72DPI before it draws even though I'm telling it not to change the image data
Is there anything I'm doing wrong?
NSImage and NSView problems - unknown - Aug 19, 2005 07:36 AM
you could try [NSColor clearColor] then fillRect([self bounds]) to clear the NSView or if that doesnt work [self setNeedsDisplay:YES]; to redraw the view after you resize it.
Im not really sure about the second problem but did you try [image setScalesWhenResized:YES/NO]?