I create an NSBitmapImageRep:

[[[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
pixelsWide:pixelSize.width
pixelsHigh:pixelSize.height
bitsPerSample:8
samplesPerPixel:4
hasAlpha:YES
isPlanar:NO
colorSpaceName:NSDeviceRGBColorSpace
bitmapFormat:NSAlphaFirstBitmapFormat
bytesPerRow:pixelSize.width * 4
bitsPerPixel:32]

I then get the address by sending a "bitmapData" message to the object

After filling it with image data, I call:

NSImage* image =
[[NSImage alloc] initWithData:[myImageRep TIFFRepresentation]];

So now I have an NSImage. What happens if I delete/release myImageRep (my
NSBitmapImageRep)?

Has the call to NSImage copied my pixels so that they are self-contained
within the NSImage?

If not, how can I do so? I am using a single NSBitmapImageRep and trying to
reuse it while making many different NSImage objects, each with their own
data.

Thanks,

Trygve



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to