NSImage from byte buffer of PNG
I have a large binary container that has a png image inside of it I need to display on the screen.
I have extracted the image no problem, and have it in an NSData object, but now I need to display the image on screen.
I tried NSImage initwithdata but it fails.
The farthest I have gotten so far is making a NSBitmapImageRep of the data and then encapsulating that in a CGImage. I can't seem to figure out a way to convert the CGImage to an NSImage though. This is 10.5 so the initwithCGImage wont work.
Drawing the CGImage on the screen will also suffice.
Anyone know how to do this?
thanks in advance
/total mac cocoa noob
|