Re: NSImage question
Re: NSImage question
- Subject: Re: NSImage question
- From: "John C. Randolph" <email@hidden>
- Date: Fri, 22 Jul 2005 14:14:23 -0700
On Jul 22, 2005, at 7:25 AM, Hussein Yahia wrote:
hello list,
What is the standard way of creating a NSImage from raw data ? I
mean, I have a raw image, in the form of say, of a collection of
bytes organized in a NSData object. How to create an NSImage from
this ?
Create an NSBitmapImageRep using [[NSBitmapImageRep alloc]
initWithBitmapdataPlanes:... and pass a pointer to your raw data as
the 'planes' parameter. Add this rep to an NSImage instance.
There is a method of class NSImage called - (id)initWithData:
(NSData *)data but I don't understand how to specify the size of
the image, the number of bits per pixel etc.
No, -initWithData: assumes that the data you pass it is encoded JPEG,
TIFF, or other such data.
-jcr
John C. Randolph <email@hidden> (408) 914-0013
Roaming Cocoa Engineer,
Available for your projects at great Expense and Inconvenience.
_______________________________________________
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