• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: filling NSImage with binary data from NSData
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >filling NSImage with binary data from NSData (From: "marc joanisse" <email@hidden>)
 >Re: filling NSImage with binary data from NSData (From: Ricky Sharp <email@hidden>)

  • Prev by Date: Re: object type testing
  • Next by Date: Re: object type testing
  • Previous by thread: Re: filling NSImage with binary data from NSData
  • Next by thread: Re: filling NSImage with binary data from NSData
  • Index(es):
    • Date
    • Thread