• 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: Saving an NSImage to an image file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving an NSImage to an image file


  • Subject: Re: Saving an NSImage to an image file
  • From: Michael B Johnson <email@hidden>
  • Date: Sun, 04 Jun 2006 15:56:49 -0700

Message: 3
Date: Sun, 4 Jun 2006 14:52:30 -0400
From: Graham <email@hidden>
Subject: Saving an NSImage to an image file
To: Apple CocoaList <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

I can find a couple of sample pieces to do this, but they are part of
something more complex and I cannot determine what I need.
So how do I save an NSImage instance (obtained from an NSURL) into a
file, .tif or jpeg or whatever? Assume I already have a file path for
the file.




Given NSImage* foo, wrote to /tmp/foo.tif  with:

[[foo TIFFRepresentation] writeToFile:@"/tmp/foo.tif" atomically:YES];

There's also

- (NSData *)TIFFRepresentationUsingCompression:(NSTIFFCompression) comp factor:(float)aFloat;



--> Michael B. Johnson, PhD
--> http://homepage.mac.com/drwave (new & improved!)
--> http://xenia.media.mit.edu/~wave (alum)
--> MPG Lead
--> Pixar Animation Studios


_______________________________________________ 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
  • Prev by Date: Re: Beginner question about strings
  • Next by Date: Re: Saving an NSImage to an image file
  • Previous by thread: Re: Saving an NSImage to an image file
  • Next by thread: Re: Saving an NSImage to an image file
  • Index(es):
    • Date
    • Thread