NSImageView and raw data
NSImageView and raw data
- Subject: NSImageView and raw data
- From: Paul Schulze <email@hidden>
- Date: Wed, 2 Aug 2006 14:36:25 +0200
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi
I'm trying to display a raw data image, using NSImageView, but can't
get it to display anything. This is, how far I came:
- - ( void ) loadImage {
NSBitmapImageRep *rep = [ [ NSBitmapImageRep alloc ]
initWithBitmapDataPlanes: NULL
pixelsWide: 16
pixelsHigh: 16
bitsPerSample: 8
samplesPerPixel: 4
hasAlpha: YES
isPlanar: NO
colorSpaceName: NSDeviceRGBColorSpace
bitmapFormat: NSAlphaNonpremultipliedBitmapFormat
bytesPerRow: 64
bitsPerPixel: 32 ];
[ self->memCard getRawIconFor: self->currImage iconFrame: 0
toBuffer: [ rep bitmapData ] ];
NSImage *img = [ self->image image ];
[ img addRepresentation: rep ];
[ img setScalesWhenResized: YES ];
[ self->image setImageScaling: NSScaleProportionally ];
[ img addRepresentation: rep ];
[ rep autorelease ];
}
I already tested the getRawIconFor:iconFrame:toBuffer: method, it
seems to work as intended. It fills the array, provided by
NSBitmapImageRep with 16x16x4 chars in RGBA format. Self->image is
the NSImageView object.
Is there anything missing?
Thanks in advance,
Paul.
- --
Paul Schulze
email@hidden
Public Key: http://solaris-net.dyndns.org/keys/key_avlex.asc
"There is a theory which states that if ever anyone discovers what the
universe is for and why it is here, it will instantly disappear and be
replaced by something even more bizarre and inexplicable.
There is another states that this has already happened."
(Douglas Adams)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
iD8DBQFE0JxKYDWOGtiChoARAs+KAJ0YTPaTdvcRPGDJABNdye6a281VXgCePABP
Yh3jHMhhzjducAp5N0a5u54=
=WSFc
-----END PGP SIGNATURE-----
_______________________________________________
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