LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

make picture background transparent

I have bmp images with white backgrounds that I would like to display in a picture control with the white are transparent. I loaded the bmp, used Create Mask to set the mask to white, then drew as a flattened pixmap. This did not work.

How do you do this?

TIA,
Bill F
0 Kudos
Message 1 of 3
(3,082 Views)
Bill,

You're using the right approach.

I think the most likely explanation for your problem is that you are not actually wiring true white into the Create Mask subVI. There are a bunch of color swatches on the default color palette that appear pure white but are actually off-white, at least on my platform (see attached image). If you hover over those swatches, you can see that they say "Control Background" or "Window" or "Highlight Text" and are in fact intended to match the hues used for those specific purposes on your platform/LabVIEW version. You can see if your input is pure white or not by wiring it to a numeric indicator in hex format and seeing if the value is FFFFFF.

The way to get pure white from the color palette is either to choose the very right-most portion of the greyscale gradient box at the top of the palette, or--more clearly--to choose the "More Colors..." button at the bottom right and then select the pure white swatch under Basic Colors.

And if this guess is wrong and you are already inputting pure white to the Create Mask subVI, then your BMP must not actually have pure white in it where you think it does. In that case, double-check by opening up the BMP in a picture editor and checking that the pixel values you are targetting are actually FFFFFF.

Hope that helps,
John
Message 2 of 3
(3,069 Views)
Ahh yes... my White = not real white.

Bill F
0 Kudos
Message 3 of 3
(3,055 Views)