FROM : Jens Alfke
DATE : Sun Mar 30 19:02:31 2008
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
DATE : Sun Mar 30 19:02:31 2008
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
| Related mails | Author | Date |
|---|---|---|
| Trygve Inda | Mar 29, 14:44 | |
| Jens Alfke | Mar 29, 18:05 | |
| Adam R. Maxwell | Mar 29, 18:54 | |
| Trygve Inda | Mar 29, 20:20 | |
| Adam R. Maxwell | Mar 29, 20:48 | |
| Thomas Engelmeier | Mar 30, 15:10 | |
| Adam R. Maxwell | Mar 30, 17:01 | |
| Trygve Inda | Mar 30, 17:34 | |
| Jens Alfke | Mar 30, 19:02 | |
| glenn andreas | Mar 30, 19:14 | |
| Trygve Inda | Mar 30, 22:21 | |
| glenn andreas | Mar 30, 22:35 | |
| Thomas Engelmeier | Mar 31, 12:30 |






Cocoa mail archive

