Surf the wave

Links for 2009-11-25


When I saw this post, I mentioned to Daniel Jalkut that I had done the same thing that he did (which was to create an NSImage category to access Carbon’s Icon Manager’s icons)

(tags: cocoa graphics icons)

“IconFamily” is a Cocoa/Objective-C wrapper for Mac OS X Icon Services’ “IconFamily” data type. Its main purpose is to enable Cocoa applications to easily assign custom file icons from NSImage instances. Using the IconFamily class you can:

create a multi-representation icon family from any arbitrary NSImage assign an icon family as a file or folder's custom icon resource, so it will appear in Finder views read and write .icns files copy icon data to and from the scrap (pasteboard) get and set the elements of an icon family in convenient, Cocoa- compatible NSBitmapImageRep form

(tags: cocoa opensource icons graphics)

o, with a smattering of Carbon knowledge, you immediately realise that the entirety of Carbon's Icons.h header (part of HIServices.framework and thus available in every Cocoa app) has been available to you for ages but you didn't write cunning lines of code like:

NSImage* folderIcon = [[NSWorkspace sharedWorkspace] iconForFileType: NSFileTypeForHFSTypeCode(kGenericFolderIcon)];

(tags: cocoa icons nsworkspace)

ImageOptim is a front-end (GUI) for set of tools for optimisation of PNG/JPEG images and GIF animations.

(tags: graphics optimization)