Re: [newbie] Saving NSImage's
Re: [newbie] Saving NSImage's
- Subject: Re: [newbie] Saving NSImage's
- From: Scott Anguish <email@hidden>
- Date: Wed, 9 Oct 2002 22:42:29 -0400
On Wednesday, October 9, 2002, at 06:46 PM, Jan Van Tol wrote:
I'm looking for a simple example of how to save an NSImage to a file.
Right now I download an image file, and then I can save the NSData
object I get just fine. But now I want to be able to save my NSImage.
Do I need to convert my NSImage to an NSData object? If so, how?
You can save the NSImage as a TIFF by getting the TIFFRepresentation
- (NSData *)TIFFRepresentation
and then writing the data to file
You can get more control by getting the individual representations
from the NSImage.. using
- bestRepresentationForDevice:
- representations
- removeRepresentation:
(i.e. an NSBitmapImageRep) and then mess with these
+ TIFFRepresentationOfImageRepsInArray:
+ TIFFRepresentationOfImageRepsInArray:usingCompression:factor:
- TIFFRepresentation
- TIFFRepresentationUsingCompression:factor:
+ representationOfImageRepsInArray:usingType:properties:
- representationUsingType:properties:
methods on NSBitmapImageRep
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.