Converting NSImageRep to NSImage?

whitesaint

cocoa love
Hi everybody and thanks for reading my post. I have an NSBitmapImageRep that I need to convert to an NSImage. The reason for this is I have an NSTableView with NSImageCells, and the NSImageCells don't know how to draw NSImageReps! NSImageCell can only draw NSImages. I've search everywhere, and can find very little help, i tried NSImageReps very few NSData methods and nothing is working.. :mad: Someone Please help me! :(
 
Have you tried this?

Code:
NSImage * image = [[NSImage alloc] initWithSize:[imageRep size]];
[image addRepresentation: imageRep];
 
!@#$!! Whoa I cant believe this worked, thank you sooo much for your help :) I never knew an image could be allocated and initialized just by size and an image representation... ::angel::
 
Back
Top