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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transparent Backgrounds

Status
Not open for further replies.

pmoore3365

IS-IT--Management
Jun 20, 2001
7
0
0
NZ
I need help putting a picture on a form with a transparent background. I had a picture with a white background, but I can't get ride of the white. How do I do this?
 
I assume the white background you're talking about is part of the picture. You've make the background of your image control transparent, but that won't get you what you want. What that means is, if the control's borders are bigger than the picture's, the area within the control but outside of the picture will be transparent.

You want the picture background to be transparent. Most image file formats don't support a transparent background. GIF does, by defining one color in the palette to be the transparent color. You have to set up the picture file in an image editor that supports GIF transparency.

But don't bother, because an experiment tells me that the image control ignores the transparent color and displays it as a normal color anyway. In Access 97, at least. In other words, you can't do it.

If your pictures don't change, you could work around it by setting the form background to a specific color (not a system color), and modifying the picture background to the same color. To avoid problems (sometimes you get "rounding" to the "nearest color", depending on your monitor's color depth and other things), stick to the standard Windows colors. As a rule of thumb, these have red, green, and blue components of 0, 64, 128, 192, or 255 in various combinations. For instance, dark cyan is red=0, green=128, blue=128.
 
Or you could crop it in your imaging software so that there was NO background.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top