Re: Thread safe?
Re: Thread safe?
- Subject: Re: Thread safe?
- From: Jens Alfke <email@hidden>
- Date: Sun, 30 Mar 2008 10:02:31 -0700
On 30 Mar '08, at 8:34 AM, Trygve Inda wrote:
How did you work around this?
Basically I am opening a bitmap drawing an NSImage into it, then
pixel-level
tweaking the bitmap, and saving it to disk as a jpg.
You might want to drop down a level and use CGImage for your bitmap.
CG is stateless (the graphics context is passed in to every drawing
call) and doesn't do the types of offscreen caching that NSImage does,
so it's more likely to be thread-safe.
You can use Cocoa graphics calls to draw into GCImages ... the recipe
was discussed here in the last week or two, though I don't remember
the details. You need to get a CG graphics context for drawing into
the image, then make it the current NSGraphicsContext. (The books on
Quartz 2D graphics probably discuss this too.)
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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