Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drawing icons fast : CGImageRef or IconRef ?



Hi all,

In my project, I need to display file icons at many sizes and the user can live-resize all of them (there can be 50 of them onscreen), so I'm looking for the best and fastest way to draw the icons.

Right now I use IconRefs, and draw the icons in my CGContextRef using PlotIconRefInContext.

However, while profiling my app, I noticed that PlotIconRefInContext calls private APIs to draw CGImages... so I was wondering if drawing CGImageRefs myself wouldn't be faster.

So I converted all my .icns files into .png ones, modified my code to handle CGImageRefs..
The result is odd : it's slower, and the icons don't look as anti-aliased as with IconRefs.

All in all, if I compare the speed of my app with the speed of the Dock at resizing the icons, the Dock is blazing fast. Some people told me it uses OpenGL to achive that. Is it true ? Is it what I should try to implement ?

Can anybody enlighten me please ?

Thanks,
Jirome
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.