NSImage and NSView problems
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:
self being the NSView.
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?
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:
Code:
[self setFrameSize:NSMakeSize(x,y)];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
Code:
image=[NSImage imageNamed:@"test"];
[image setDataRetained:YES];
[image setCachedSeparately:YES];Is there anything I'm doing wrong?
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]?
Im not really sure about the second problem but did you try [image setScalesWhenResized:YES/NO]?
Sir, e^iπ + 1 = 0, hence God exists; reply!
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| NSImage leaking? | Cirdan | 5 | 3,257 |
Nov 16, 2009 12:02 PM Last Post: SethWillits |
|
| Mouse Events in NSView | Chandhu | 1 | 3,532 |
Feb 28, 2008 02:08 AM Last Post: kuon_ |
|
| Sending an NSImage on a Network | mindwalkernine | 1 | 2,758 |
Aug 9, 2006 04:23 AM Last Post: djork |
|
| Animate An NSImage | mindwalkernine | 1 | 3,546 |
Jun 18, 2006 12:30 AM Last Post: StealthyCoin |
|
| NSView loaded from bundle won't draw... | Joseph Duchesne | 1 | 3,096 |
Feb 12, 2006 03:33 AM Last Post: Cochrane |
|

