NSBitmapImageRep from file
NSBitmapImageRep from file
- Subject: NSBitmapImageRep from file
- From: Tommaso Pecorella <email@hidden>
- Date: Sun, 6 Jan 2002 14:52:53 +0100
Hi, I have a problem.
I need to initialize a NSBitmapImageRep with the contents of a
(generic) image file.
By now I know how to load the image in a NSImage, but, after that, I
need to convert the image in a NSBitmapImageRep to access it's
contents.
Moreover, the NSBitmapImageRep *must* be of the same type of this:
bitmap = [[[NSBitmapImageRep alloc]
initWithBitmapDataPlanes: NULL // Let the class allocate it
pixelsWide: width
pixelsHigh: height
bitsPerSample: 8 // Each component is
8 bits (one byte)
samplesPerPixel: 3 // Number of
components (R, G, B, alpha)
hasAlpha: NO
isPlanar: NO
colorSpaceName: NSDeviceRGBColorSpace
bytesPerRow: 0 // 0 means: Let the
class figure it out
bitsPerPixel: 0 // 0 means: Let the
class figure it out
] retain];
How can I do a similar thing ?
By now I am stuck with this problems: resizing and actual
bitsPerSample/samplesPerPixel/alpha/planar.
Anyone can help me ?
Tnx, Tom ;-{))
--
--------------------------------------------------------------------------
Ing. Tommaso Pecorella
snail-mail: e-mail :
via del Pergolino 8/a
mailto:email@hidden
50139 Firenze - ITALY
RSA Key fingerprint = 232A D084 AD2F 7815 3D44 AFF0 AA52 A3AA
--------------------------------------------------------------------------