LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Transparency in Custom Controls

Hello:

I need the ability to create custom Boolean controls with transparent regions, not an opaque white background. I have Adobe Photoshop 8 and can create transparent images there. I don't know how to get these images into the control editor and preserve transparency. PLease tell me how to do this.

Thank you.
Message 1 of 8
(5,599 Views)
Save your image from photoshop as a PNG (Portable Network Graphic). This format can be import in labview and it has provision for alpha channel (transparency gradient).

PJM


  


vipm.io | jki.net

Message 2 of 8
(5,595 Views)
Thank you, that works.

I have another related question. Is there any way to create a custom image which can be colored in LabVIEW programaticly or using the paint tool? What about preserving flashing in custom controls?

Thank you.
0 Kudos
Message 3 of 8
(5,588 Views)
Just some more comments:

When I paste an image from the clipboard into a custom control, that control part looses the ability to take a LabVIEW-assigned color. This happens with a part copied from another control as well. IT seems that this problem is related to my earlier question about loosing transparency on pasted images. I wonder if there is another chanel or special color which LabVIEW uses to mark areas which are colorable. What special information related to color is lost when an image is pasted into a custom control?

Thank you,
Peter Laskey
peter.laskey@jdsu.com
Message 4 of 8
(5,561 Views)
I found an example in another thread which seems to do what I want, but there is no explanation on how to do this. I only know that it is a custom control based on a color box. I am attaching the examples from the thread. Can you tell me how this is done?

Thank you
Message 5 of 8
(5,558 Views)
From the mis-spelling I will guess that is my bad!

Sorry.

THose images come as part of the Industrial automation add-on (?).

It was the transparency that is maintaned in the concave portions of those images that propted me to ask a similar series of questions years ago that were answered by Greg McKaskle. I will try to follow-up with a link to his answers.

What I recall is that the transparency is maintained in "meta files" (?).

The clip board used by LV does not support meta files (?) and by default converts meta file images into bmp format (?). This results in transparent regions getting converted to white.

I believe I also read elsewhere that transparency is represented by using the most signifigent byte of the U32 color representation. I think a "1" in the MSB is transparent (?).

If anyone can straighten me out on my ramblings PLEASE DO SO!

Far from an expert but very interested in this topic,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 8
(5,532 Views)
Thanks Ben.

You are correct that a Meta file or PNG are required to maintain transparency. I can get that part to work now, but I still find that when I import an image from the DSC Image Navigator, the image can not be colored any more. I used to think this was not possible, but the example I attached in my earlier message shows that it is, I just don't know how.
0 Kudos
Message 7 of 8
(5,529 Views)
I don't think it's possible with imported graphics. The example you found uses an NI boolean control that was part of an automation toolkit. It was not created by importing an image.
Message 8 of 8
(5,522 Views)