FROM : glenn andreas
DATE : Sun Mar 30 22:35:16 2008
On Mar 30, 2008, at 3:21 PM, Trygve Inda wrote:
>
>> 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?
>
Yes - NSBitmapImageRep's can be init'ed with NSData (the contents of
a jpg) and being a subclass of NSImageRep, can be drawn using
drawAtPoint or drawInRect.
DATE : Sun Mar 30 22:35:16 2008
On Mar 30, 2008, at 3:21 PM, Trygve Inda wrote:
>
>> 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?
>
Yes - NSBitmapImageRep's can be init'ed with NSData (the contents of
a jpg) and being a subclass of NSImageRep, can be drawn using
drawAtPoint or drawInRect.
| 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

