Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
White pixels on graphical button???
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00055499
Message ID:
00056562
Views:
33
>>>>>>>Could someone help me out with this one!
>>>>>>>
>>>>>>>I'm sure it's quite simple but when I use the command1.picture property the .BMP is not quite properly displayed. The original .BMP has white region that aren't displayed in the button (the white is replaced by the button's background color). I've include in the path the inverted color graphic and saved it with the same name with the .MSK extension but still no change, even after a CLEAR RESOURCES ALL.
>>>>>>
>>>>>>CLEAR RESOURCES ALL doesn't solve the problem. You must close and reopen VFP, I think. Is the MSK file in the same directory as the BMP?
>>>>>>
>>>>>>Vlad
>>>>>
>>>>>Vlad,
>>>>>
>>>>>The apparently CommandButton control masks out white areas automatically, even without a MSK file anywhere in sight and painting the background white. The ActiveX 3D Command Button, however, will display the white areas.
>>>>>
>>>>>George
>>>>
>>>>Sorry, George, but I don't understand your message. Can you explain a little more, please?
>>>>
>>>>Vlad
>>>
>>>Vlad,
>>>
>>>Sorry, I misread the question. That'll teach me to re-read everything, at least this early in the morning (g).
>>>
>>>George
>>
>>I'm having this same problem. So what's the resolution? I have to use an ActiveX command button? I try to stick with the native VFP controls and I hope there's another solution.
>
>The trick is the MSK file. White is interpreted as being transparent when placed on a command button, unless a MSK file is present to tell it otherwise. MSK files are easy to create using the Image Editor. Load the bitmap and copy it to the clipboard. Create a new bitmap, the same size as previous. Instead of the new one being a color bitmap, make it a two color monochrome. Paste the contents of the clipboard. Anything other than white, will show up as black. Make the white areas on the new bitmap black as well, and they'll show up later as white. Once this is done, save it with the extension MSK, from file Save As. It's a good idea to do this before you create your command button. If you don't and create the MSK after the picture property on the button is specificied, you may have to either CLEAR RESOURCES ALL or exit and re-enter VFP.
>
>The 3D ActiveX Command button I mentioned earlier, is a holdover from an early version of VB. It's a real pain to use, since each state of the button has to be specified. Usually, it's used in conjunction with the PicClip control. But, white shows up as white on it. I don't think that it's much of a redeeming feature. (g)
>
>HTH,
>
>George

George,

Thank you for the step-by-step instructions, it worked perfectly!
Previous
Reply
Map
View

Click here to load this message in the networking platform