Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Get 128x128 icon for file?

Get 128x128 icon for file?
Thread Tools
Dedicated MacNNer
Join Date: Nov 2000
Status: Offline
Reply With Quote
Jun 9, 2002, 05:16 AM
 
Hello ...

The NSWorkspace method "iconForFile:" returns a 32x32 NSImage. How can I get the 128x128 (or 64x64) version of the icon?

Thanks and regards,

DayLateDon
     
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status: Offline
Reply With Quote
Jun 9, 2002, 06:40 AM
 
Actually, the NSImage instance returned by -[NSWorkspace iconForFile:] contains all sizes* of an icon as NSImageRep instances. You can either access the reps directly and query them for the size you want, or you can ask the image to draw at a particular size.

* There will be up to four reps for the four possible Mac OS X icon sizes: 16x16, 32x32, 48x48 (not often used), and 128x128. If you want 64x64, you'll have to draw the 128x128 at half size.
Rick Roe
icons.cx | weblog
     
Dedicated MacNNer
Join Date: Nov 2000
Status: Offline
Reply With Quote
Jun 9, 2002, 07:20 AM
 
Hello ...

Hmmmm ... Looks like less work for me! Cool.

Thanks ...

DayLateDon
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:20 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2