LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Overlapping transparent picture indicators

Is it possible to overlap two picture indicators such that if the top one has an area of transparency then the bottom picture shows through this area?
0 Kudos
Message 1 of 9
(3,776 Views)
0 Kudos
Message 2 of 9
(3,751 Views)

Thanks for the reply however I think I need to expand on what I am trying to do.

 

I have two picture indicators. One has a map loaded from a bmp file. The second is a dynamically changing picture of a radar screen the background color of which has been masked to be transparent. I have also set this second picture indicator to have a transparent background color using the color picker tool. If I overlap the radar picture image over the map picture indicator the areas of transparenct do not show the underlying opaque map indicator but show the undelying front panel background color.

 

I know I could write the map picture followed by the radar picture to one picture indicator but I am trying to reduce the amount of data needing to be sent everytime the front panel updates. I do not want to have to send the entire map data everytime. This is important if you are using remote panels.

 

Any ideas help wiould be appreciated.

 

Thanks

 

 

0 Kudos
Message 3 of 9
(3,739 Views)
0 Kudos
Message 4 of 9
(3,723 Views)
Hi Peter,
would it be possible to post ur vi on this thread, it will make it alot easier for us to understand exactly what you are after,
the actual concept of overlapping two picture indicators is definately possible,
Hope to hear from you soon
 
YatinM
NIUK
Applications Engineer
0 Kudos
Message 5 of 9
(3,716 Views)
Hi Peter
After playing around with the picture control on LabVIEW myself, i found that you can only overlap the most recently created picture control, meaning that the 2nd picture control that you created has to go on top of the 1st one. if your map is static and doesnt change then instead of inserting it into a picture control you can actually just copy and paste it to your front panel in LabVIEW and then overlap with the transparent radar picture control. this should work.
 
if you could post your VI that would be a great help.
 
Kind Regards
 
YatinM
NIUK
Applications Engineer
0 Kudos
Message 6 of 9
(3,710 Views)
>If I overlap the radar picture image over the map picture indicator the areas of transparenct do not show the underlying opaque map
>indicator but show the undelying front panel background color.
 
If what you saying is true, it's a bug.  What version of LabVIEW are you using?
 
 
>I know I could write the map picture followed by the radar picture to one picture indicator but I am trying to reduce the amount of data
>needing to be sent everytime the front panel updates. I do not want to have to send the entire map data everytime. This is important
>if you are using remote panels.
 
You can combine the image at the remote end, you only need to send the radar picture.
 
 
George Zou
 
 
George Zou
0 Kudos
Message 7 of 9
(3,700 Views)
Thanks to everyone who replied but I now understand what i was doing wrong. I was setting the foreground of a picture control to transparent instead of the background although I still dont understand why setting the foreground transparent should cause the underlying front panel color to show through. When I set the background to transparent I was able to overlap 5 picture indicators with no problem.
0 Kudos
Message 8 of 9
(3,679 Views)

Why not just use one picture control and use a alpha blend algorithm to overlap the picture then just write the results to the picture control, will simplify your code in the longrun if you want to do event handeling and resizing.  Essentially a simple alpha blend would be to scale both photos to be of same size pixel arrays, then add an alpha channel for each array (or even pixel)  then each new pixel will be 24bit RGB {(pixelA red)*(alpha)+(pixelB red)*(1-alpha)}, {(pixelA green)*(alpha)+(pixelB green)*(1-alpha)}, {(pixelA blue)*(alpha)+(pixelB blue)*(1-alpha)}.  There are also more complex methods for blending pixels.

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 9 of 9
(3,671 Views)