NSImage - drawInRect SnowLeopard issue
NSImage - drawInRect SnowLeopard issue
- Subject: NSImage - drawInRect SnowLeopard issue
- From: email@hidden
- Date: Wed, 9 Sep 2009 23:21:07 +0530 (IST)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
- Importance: Normal
Hello,
I seem to be running into an issue on Snow Leopard with NSImage.
Basically , I have a thumbnail kind of view , shown as a sheet , to
which I render the images read from the disk. The problem is that on
Snow Leopard the image shows up as blank whereas it renders fine on
Leopard and Tiger. My app is a Cocoa universal app running on an Intel
MacMini.The code goes like this ..
- (void)drawRect:(NSRect)rect {
[_timg drawInRect:imageRect fromRect:NSZeroRect
operation:NSCompositeSourceOver fraction:1.0f]; // _timg is an NSImage
/* Debug Code to see if the data in _timg is ok */
NSData* tiffData = [_timg TIFFRepresentation];
[tiffData writeToFile:[NSString stringWithFormat:@"Debug.tiff"]
atomically:NO];
}
What I have noticed :
- If I comment the drawInRect call... the debug code to write to a file
generates a properly rendered image on disk.This implies that the data is
not messed up due to any program issues
- If the call to drawInRect is included , the file rendered as well as the
rendered image on screen is white..so the source image seems to be getting
modified.
- Similar calls to drawInRect elsewhere in the app does not seem to have
this issue. The only noticeable difference seems to be that the code which
is not working is invoked as a sheet.
- Changing the "operation" arguments to NSCompositeCopy etc does not make
any difference.
Please let me know any workarounds or possible solutions for this problem.
Thanks in advance,
Tresa
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden