NSImage from bitmap - then delete bitmap
NSImage from bitmap - then delete bitmap
- Subject: NSImage from bitmap - then delete bitmap
- From: Trygve Inda <email@hidden>
- Date: Thu, 21 Jul 2016 22:37:12 -0700
- Thread-topic: NSImage from bitmap - then delete bitmap
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 (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