LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Transparency in picture/draw functions

I always assumed that the picture functions only support the standard Labview color palette, which has no alpha channel (only 24bit RGB with a few "special" colors when the alpha byte is set to 0x01). 100% transparency is possible (0x01000000) but no adjustable opacity. I found some old workarounds, such as overlaying PNGs with alpha channels (which Labview can display correctly) or blending the displayed content with the background to mimick transparency or using .NET picture controls instead of Labview's altogether.

 

For my application these workarounds are not really practical because I want to programmatically draw semi-transparent overlays into the built-in picture control of an intensity graph to highlight specific regions of the data. I was about to accept that the picture functions just can't do alpha blending when I tested the "Draw Grayed Out Rect" function. It can draw a colored rectangle with what appears to be 50% opacity using true alpha blending with anything in the background (including other elements within the same picture!). There is no way to adjust the amount of transparency though. The documentation of this function suggests that it was supposed to do some kind of dithering using the 100% transparent color (maybe in earlier LV versions), but it's actually doing honest-to-goodness alpha blending (as of LV2018 at least). Is there any way to have this transparency with other primitive picture shapes?

0 Kudos
Message 1 of 2
(1,779 Views)

@Novgorod wrote:

Is there any way to have this transparency with other primitive picture shapes?


No.

 

You'll have to fake it by getting the image, and then manually blending the bytes of the overlay.

0 Kudos
Message 2 of 2
(1,759 Views)