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: kControlContentCGImageRef



On 7/27/04 5:13 AM, Steve Baxter didst favor us with:

>
> On 27 Jul 2004, at 04:25, Laurence Harris wrote:
>
>> On 7/26/04 7:43 PM, Steve Baxter didst favor us with:
>>
>>> I've just spent several hours trying to get a set of icons (that we
>>> commissioned from a professional artist at some expense) to draw in a
>>> bevel button.
>>>
>>> No matter what I do, setting the content of a bevel button using
>>> kControlContentCGImageRef results in no drawing.
>>>
>>> Please, please don't tell me this is broken.
>>
>> Okay, I won't tell you. ;-)
>>
>>> If it is, how are we supposed to draw nice alpha images (as required by the
>>> Apple Aqua UI guidelines) in bevel buttons
>>
>> I haven't tried CFImageRefs, but if in fact that's broken, it's easy enough
>> to install a kEventControlDraw handler on the bevel button in which you draw
>> a blank button and then draw your image on top of it.
>
> Or I could just not use a control. If I have to draw the button I may
> as well just implement the whole button as a PowerPlant class.

I wouldn't say that. It's just a few lines of code in a handler to draw a
Theme button. Or you can just call DrawNextEventHandler() to draw it as long
as the system is just drawing a blank button anyway.
>
>>> (icns is a non-starter as these icons are
>>> not one of the icns limited sizes)?
>>
>> Out of curiosity, what size are these images?
>
> This particular one is 12x12.

You can use an IconRef created from an IconFamilyHandle (.icns file or
'icns' resource) which consists of a single (16x16) icon that has your 12x12
image in its center and it will work fine in a bevel button. I use this for
some 10x10 icons and it works just fine. I'm not sure why you think this
isn't an option.

Larry
_______________________________________________
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.


References: 
 >Re: kControlContentCGImageRef (From: Steve Baxter <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.