Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gmmastros on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transparent Button Background

Status
Not open for further replies.

Lochness30

Programmer
Jun 9, 2004
23
CA
Does any one know how to over ride VFP9 RANDOM decision on if it will make my picture on a button have a transparent background. I had a png picture of a pencil on a button. Looked great, but was too big. So I made it smaller, saved it in photoshop and now it has an ugly white background. Tried to load the original picture and it has the ugly white background too (note. nothing was changed on the button or the original picture!!) Now no matter what I do, I can't get my beautiful original transparent background.

I tested it and the picture has a transparent background on every other application on the planet. Please help!!
 
Are you sure that photoshop did not put all that white in there? I have had to select the white and then use inverse and cut only the picture out and save it to a new file to get rid of white space with photoshop.
wjwjr

This old world keeps spinning round - It's a wonder tall trees ain't layin' down
 
Lochness,

You have two options:

1. Save the picture as a BMP. Make sure the colour depth is 8-bit or less (256 colours or fewer). Use this for your button. You should find that the white areas are now transparent,

2. Save the picture as a GIF. Within your picture editor, mark the background areas as transparent. In VFP, create an image object (not a command button), and set the Picture property to the GIF. You don't have to make the image visible. In fact, you can destroy it as soon as you've created it. Next, go ahead and place the GIF on a command button. You'll see that the transparency is respected.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top