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!

Image Color masking... HELP!

Status
Not open for further replies.

GlynW

Programmer
Feb 14, 2001
22
0
0
GB
I have an Image on my application, which I want to be partially transparent.
The Tranparent property works if I have the color that I want replaced with the transparency on the BMP to White. I actualy have Other Shades of White on my Image, which also become transparrent.

Is there anyway I can specify a different base color such as RGB(255,0,255) Magenta as the trasparent color?
 
I found the answer myself, so I've posted it if anyone else needed to know....

Cheers Me!


Using Picture Masks
===================
Often, a .bmp picture contains white space you don’t want to appear on your controls. A white border around an irregularly shaped image could make your control look bad. To avoid this problem, Visual FoxPro creates a temporary default mask for your picture. White areas are given a transparent attribute so that the underlying color of the button or background shows through. To keep certain white areas of your .bmp white, create a mask for it that will override the default.

To create a mask for a .bmp

Open the .bmp file in Paint or another bitmap utility.


Blacken all areas of the picture that you want to be displayed exactly as they are in the .bmp file. Leave the areas you want to be transparent as white.


Save the file in the same directory and with the same name as the .bmp file but with an .msk extension.
When Visual FoxPro loads a .bmp file specified by the Picture property for a command button, option button, or check box, it looks in the same directory for a matching .msk file. If an .msk file with the same name as the .bmp is in the directory, Visual FoxPro uses it as a mask for the picture. All white areas in the .msk picture are made transparent in the .bmp. All black areas in the .msk picture are displayed exactly as they are in the .bmp.

Note The .bmp picture and the .msk picture must have the same dimensions for the mask to be able to represent the area of the .bmp.

 
GlynW

Why don't you edit your last post and make a FAQ of it?

Click on the FAQ tab and follow the instructions - you, and only you, will be able to edit your FAQ as often as you wish, should you have amendments or improvements, etc to make.

Chris :)
 
I concur. Definitely warrants a FAQ. Jon Hawkins

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top