Mailing Lists: Apple Mailing Lists

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

Re: How to convert an image to an icon or IconRef programmatically?




On 28 Feb 2005, at 17:56, Mark Wagner wrote:

On Fri, 25 Feb 2005 17:47:36 -0800, David McLeod <email@hidden> wrote:
On Feb 1, 2005, at 11:04 AM, Laurence Harris wrote:
On 2/1/05 6:12 AM, Liang Yu didst favor us with:
Thank you very much for your reply.

I think it should have some simple solution, but it seems it is a bit
complicated. Unfortunately, the icon graphics I used can only be
provided in Windows BMP format. Is there any way to do it?

Maybe, but BMP is more of a Windows thing, so the solutions are not going to be as simple as they would be if you were using PNG or JPEG. If I had to support both platforms with one image format, I'd definitely use PNG files and do what Jerry suggested, except I don't know how to handle disabling and selected states with a CGImageRef.

The bad news is that the operations we perform on images to make them
appear disabled and/or selected are private (and there's no magic bit
for this one). I created a bug to publicize the lower level operations,
but I think that the request was deferred to a later release.

If you're interested in faking it, I've found that lightening an image halfway to white is a good imitation of the "disabled" state, and darkening it halfway to black is a good imitation of "selected".

A long time ago, there used to be sample code from Apple which did exactly this for drawing icons, so it's sort of official (for 1986 or something).


Jerry

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden


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.