Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Transparent GIF images on buttons
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Miscellaneous
Thread ID:
01533051
Message ID:
01533148
Views:
110
This message has been marked as a message which has helped to the initial question of the thread.
Likes (1)
>>>>In VFP you can use BMPs with white background RGB(255,255,255). VFP will make them transparent.
>>>
>>>Yeah I know but my icon has white in the actual image content (in the main area) so that doesn't work that well.
>>
>>You can make your white in the main area almost white - 255,255,254.
>
>Yes, so after trying other stuff that's what I ended up doing.
>
>Such a PITA though. I'd been pestering the VFP team (when there was one) for years to get this fixed and work with transparent images, but they never did unfortunately.
>
>+++ Rick ---

Hello RIck,

I've managed to use some transparent images in buttons, using PNGs and GIFs before. But it'sa real PITA... Because all the time I had to apply tweaks in my code... SOmetimes, suddenly the transparency was gone, even having loaded the images previously, as you stated in your first message.

IMHO, the best image format for buttons is 24BPP Bmps.
BMPs are the best image format for VFP buttons, The transparency works pretty well, for pure white pixels, with RGB (255,255,255). I created a small piece of code to convert several images that I picked on the web to BMPs, keeping the transparency.

The trick, as said above by the other friends is to replace the existing Whites, with RGB(255,255,255) with another white color, eg RGB(254,254,254). Nobody can notice the difference, but this allows you to use the pure whites to tell VFP to make those pixels transparent.

Have alook at this post for more info, and some sample code, showing how you can convert automatically your images to BMP keeping transparency::
http://weblogs.foxite.com/vfpimaging/2007/10/24/bmps-with-transparent-backgrounds/
http://weblogs.foxite.com/vfpimaging/2007/11/14/convert-your-buttons-to-bmps-keeping-transparency-with-gdiplusx/
Previous
Reply
Map
View

Click here to load this message in the networking platform