• 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 question on creating .png files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newbie question on creating .png files


  • Subject: Re: newbie question on creating .png files
  • From: Felix Franz <email@hidden>
  • Date: Thu, 12 Feb 2009 17:28:38 +0100


On 12.02.2009, at 17:14, Jean-Daniel Dupas wrote:


Unfortunately, I don't think you can save an NSImage as a PNG (it only supports the TIFFRepresentation method).



You can create a new NSBitmapImageRep using the TIFFRepresentation and use representationUsingType:properties:
to get the PNG-data:


NSData* TIFFData = [img TIFFRepresentation];
NSBitmapImageRep* bitmapImageRep = [NSBitmapImageRep imageRepWithData:TIFFData];
NSData* PNGData = [bitmapImageRep representationUsingType:NSPNGFileType properties:nil];
[PNGData writeToFile: @"JAN01.png" atomically: YES];


HTH,

felix
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: newbie question on creating .png files
      • From: David Duncan <email@hidden>
References: 
 >newbie question on creating .png files (From: "Smith, Steven (MCP)" <email@hidden>)
 >Re: newbie question on creating .png files (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: Garbage Collection and NSManagedObject
  • Next by Date: Re: Garbage Collection and NSManagedObject
  • Previous by thread: Re: newbie question on creating .png files
  • Next by thread: Re: newbie question on creating .png files
  • Index(es):
    • Date
    • Thread