• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [newbie] Saving NSImage's
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >[newbie] Saving NSImage's (From: Jan Van Tol <email@hidden>)

  • Prev by Date: Re: NSTableView Drag & Drop... Well, Maybe
  • Next by Date: SMySQL Problems
  • Previous by thread: [newbie] Saving NSImage's
  • Next by thread: Re: [newbie] Saving NSImage's
  • Index(es):
    • Date
    • Thread