[futurebasic] Re: [FB] Make Picture Button by bundle image

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 2011 : Group Archive : Group : All Groups

From: Yoshiyuki Hasegawa <hase44@...>
Date: Tue, 24 May 2011 02:42:50 +0900
Thank you Steve.

>> << But the current code has a small problem in the button and anti- 
>> aliasing of the background window color.  The solution synthesizes  
>> a small background color of the same color as the backing color to  
>> an original image. >>
>>
>> 1)  It appears that you are trying to take an image of a push  
>> button and place it on a rectangular picture button.
>>
>> 2)  Have you tried placing the image on a push button ( which is  
>> the same shape )?
>>
>> 3)  Alternatively, you could create a bitmap image with a  
>> transparent background, but I think you are still going to see the  
>> rectangular shape of the currently used picture button.  It  
>> appears that you are trying to hide the rectangular shape.
>

The transparency of png image is not recognized in _kControlPictureProc.
To recognize the square the image that the bundled and to make the  
boundary of the button and the back smooth, _kControlPictureProc put  
a square image on the button.

Do these show the limit of the carbon?
If the interface builder is used, the button by bundle image might be  
able to be made easily.

> <<The solution synthesizes a small background color of the same  
> color as the backing color to an original image.  >>
>
> The following code places a .png image in an HIImageView and traps  
> clicks on the image.  It does not hilite.  Please use the  
> PictureButton.png attached to a previous post.  The .png image has  
> a transparent background and therefore you should see only the  
> outline of the image and not the border of the HIImageView.
>
> '--------------------------
> Code snip

Though your code is very wonderful, there are two problems.

1. There is no hilite when the button is pushed as you say.
2. The event handler of the button should be made a usual button and  
an alternate pathway a little.

Your code will be used by other scenes.

Very thanks.
Yoshiyuki