Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

GOA

macrumors newbie
Original poster
Jun 30, 2014
13
1
Hi everyone,

Is it possible to convert .icns to .png or jpg or tiff dynamically from within xcode?

I am new to iOS and xcode. I am hoping to develop an app for ipad to display icons and description of all apps, as a list. However, when I use .icns as image nothing is displayed, whereas .png or .jpg etc.. do show up.

Any idea how I can do that? By the way, why .icns not showing? What is so special about this image?:confused:

Thank you for your help.
 

waterskier2007

macrumors 68000
Jun 19, 2007
1,871
228
Novi, MI
icns files are not really images, but image containers. See here


The ICNS file type is primarily associated with 'Macintosh OS X' by Apple Inc.. ICNS files are icon files for the Macintosh operating systems. They are different from Windows .ICO files in that they act like a container with individual icon resources enclosed within it. ICNS file images are not displayed outside the icon, but are enclosed inside the files as data
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
The icns file contains a number of small bitmaps. You could draw them into a bitmap context and save them as jpegs or pngs. This shouldn't be hard.

The below link provides some info on the format. Apparently versions since Mac OS X 10.7 are already in jpeg or png format. In that case you could move the data into an NSData object and UIImage imageWithData to display the images.

http://en.wikipedia.org/wiki/Apple_Icon_Image
 

artfun

macrumors member
Jun 4, 2014
48
0
Hi everyone,

Is it possible to convert .icns to .png or jpg or tiff dynamically from within xcode?

I am new to iOS and xcode. I am hoping to develop an app for ipad to display icons and description of all apps, as a list. However, when I use .icns as image nothing is displayed, whereas .png or .jpg etc.. do show up.

Any idea how I can do that? By the way, why .icns not showing? What is so special about this image?:confused:

Thank you for your help.

Are you trying to do the appstore alternative?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.