• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
WebConvertNSImageToCGImageRef Issues
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: WebConvertNSImageToCGImageRef Issues
      • From: John Pannell <email@hidden>
  • Prev by Date: Re: Is setting the class the same as setting a parent entity?
  • Next by Date: Re: WebConvertNSImageToCGImageRef Issues
  • Previous by thread: Copying files synchronously with Cocoa?
  • Next by thread: Re: WebConvertNSImageToCGImageRef Issues
  • Index(es):
    • Date
    • Thread