NSImage question
NSImage question
- Subject: NSImage question
- From: Hussein Yahia <email@hidden>
- Date: Fri, 22 Jul 2005 16:25:16 +0200
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 ?
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.
So I suppose the standard way is the following:
1- create a NSImage with [NSImage initWithSize:size];
2- Add an NSImageRep by specifying the number of bits per pixels etc.
3- Create an NSBitmapImageRep with method initWithData and add it to
the NSImageRep.
Am I right doing that ? Will the NSBitmapImageRep initWithData
correctly read from the NSData object knowing the size, number of
bits per pixels etc. specified before ? Or is the standard way
completely different ? I don't understand very well the documentation
about that matter.
Thank you
h. yahia
_______________________________________________
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