Skip navigation.
 
mlRe: Thread safe?
FROM : Trygve Inda
DATE : Sun Mar 30 22:21:20 2008

> Or drop down just a step to just use NSBitmapImageRep instead of
> NSImage which avoids all the caching issues (since you never make an
> NSImage).  It is very well suited for "pixel level work that is saved
> in a file" (since you'll need it to do NSBitmapImageRep's
> representationUsingType: properties: to get the data for a JPG or PNG
> file anyway).


I am not using NSImage - except to draw an existing file into my premade
NSBitmapImageRep. Is there a way to draw a jpg into this NSBitmapRep without
loading the jpg into an NSImage?

> The only slightly tricky part is that if you want to draw in it (using
> the standard drawing routines, as opposed to custom pixel access
> stuff), you'll need to make a context using NSGraphicContext's
> graphicsContextWithBitmapImageRep and then set that as the current
> context.


Yep - doing that.

Trygve

Related mailsAuthorDate
mlThread safe? Trygve Inda Mar 29, 14:44
mlRe: Thread safe? Jens Alfke Mar 29, 18:05
mlRe: Thread safe? Adam R. Maxwell Mar 29, 18:54
mlRe: Thread safe? Trygve Inda Mar 29, 20:20
mlRe: Thread safe? Adam R. Maxwell Mar 29, 20:48
mlRe: Thread safe? Thomas Engelmeier Mar 30, 15:10
mlRe: Thread safe? Adam R. Maxwell Mar 30, 17:01
mlRe: Thread safe? Trygve Inda Mar 30, 17:34
mlRe: Thread safe? Jens Alfke Mar 30, 19:02
mlRe: Thread safe? glenn andreas Mar 30, 19:14
mlRe: Thread safe? Trygve Inda Mar 30, 22:21
mlRe: Thread safe? glenn andreas Mar 30, 22:35
mlRe: Thread safe? Thomas Engelmeier Mar 31, 12:30