Re: Getting iPod icon, was Getting the network Machine Icon
Re: Getting iPod icon, was Getting the network Machine Icon
- Subject: Re: Getting iPod icon, was Getting the network Machine Icon
- From: Jean-Daniel Dupas <email@hidden>
- Date: Fri, 23 Jan 2009 14:56:48 +0100
Le 23 janv. 09 à 14:29, Dave a écrit :
Hi,
Is there some sample code anywhere that renders (e.g. applies the
mask etc.) an Icon from a .icns file at a given resolution? I'd then
like to be able to save the rendered image as a JPEG file.
If anyone knows of some sample code to get me going or can point me
to the best starting place for this, I'd be really Grateful.
Thanks a lot
All the Best
Dave
An icns file can be opened using NSImage methods.
Then choose the representation you need and convert it to JPEG as you
would do with any image.
If you want to go the "hard" way (that is not that hard):
Use ReadIconFromFSRef() to load the icns file.
Convert it into an FSRef using GetIconRefFromIconFamilyPtr().
And then draw it using PlotIconRefInContext().
_______________________________________________
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