Re: filling NSImage with binary data from NSData
Re: filling NSImage with binary data from NSData
- Subject: Re: filling NSImage with binary data from NSData
- From: "marc joanisse" <email@hidden>
- Date: Sun, 7 May 2006 16:11:32 -0400
On 5/7/06, Ricky Sharp <email@hidden> wrote:
Here's at least one problem. You should be calling an appropriate
init method here. For example:
NSImage* producedNSImage = [[[NSImage alloc] initWithSize:NSMakeSize
(256, 256)] autorelease];
Thanks.
Both should be autoreleased; see code snippet above with the
initWithSize:
Finally, I've not yet worked with planar images, so there could be
additional bugs in what you have.
I still get a segfault. One thing I've noted however is that this
*only* happens when the data in plane contains nonzero values (e.g.,
some slices are empty, and I get a completely black image just fine,
but when I switch to a plane that contains values > 0, bad things
happen). So I am still doing something wrong.
Is there perhaps a smarter way to show an array of bytes on an NSImage
than how I'm doing it here?
-Marc-
--
Marc Joanisse
"... and such small quantities."
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden