WebConvertNSImageToCGImageRef Issues
WebConvertNSImageToCGImageRef Issues
- Subject: WebConvertNSImageToCGImageRef Issues
- From: Chad Weider <email@hidden>
- Date: Sun, 15 Jan 2006 23:37:04 -0600
I seem to be getting odd results when using WebKit's
WebConvertNSImageToCGImageRef to convert NSImages to their CGImage
counterparts...
This code works fine:
NSImage *theImage = [NSImage imageNamed:@"NSApplicationIcon"];
CGImageRef theRef = WebConvertNSImageToCGImageRef(theImage);
[theImage lockFocus];
//Some Drawing
[theImage unLockFocus];
if(theImage != nil && theRef == nil)
NSLog(@"wtf");
...just that drawing code won't take effect
And this will log wtf everytime:
NSImage *theImage = [NSImage imageNamed:@"testImage.png"];
CGImageRef theRef = WebConvertNSImageToCGImageRef(theImage);
[theImage lockFocus];
//Some Drawing
[theImage unLockFocus];
if(theImage != nil && theRef == nil)
NSLog(@"wtf");
...but if the lockFocus stuff is removed, it passes.
Any ideas?
...apple's documentation on the function is pretty nonexistent...so I
would think there shouldn't be any suprises in-store for me, eh?
Chad Weider
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden