LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multilayer Images

Is it possible to display an image with the picture VIs, that is composed of
several single picture-layers. Let's say, Layer A is A.jpg and layer B
consists of B.jpg. Can I put them together to get a 2Layer Image?

Thanks for your response

Oli
0 Kudos
Message 1 of 6
(5,103 Views)
Are you trying to have the bottom image visible through the top (semi-transparent) or are you trying to combine two images such that you can't see what is covered by the topmost image?
0 Kudos
Message 2 of 6
(5,103 Views)
I thought of combining layers in a non-semitransparent way.

boltzmann2 schrieb in Nachricht
<101-5065000000050000007C170000-981958153000@quiq.com>...
>Are you trying to have the bottom image visible through the top
>(semi-transparent) or are you trying to combine two images such that
>you can't see what is covered by the topmost image?
0 Kudos
Message 3 of 6
(5,103 Views)
I'm trying to do semi-transparent.
Or, at least define a "null" value that can be "overwritten" by the subsequent picture.
Can a picture have a "null" value, or does any # represent a color?
If I have a VI with a picture in, and I want to "overlay" it with a picture out, I'm going to need to analyze the data in the picture in. But I don't seem to be able to extract the data by any means. That is, unlike most data types such as enum, I can't multiply it by a #, I can't slice it, I can't do anything with it. Is there any way to "get at" the data in a picture control/indicator?
0 Kudos
Message 4 of 6
(5,103 Views)
> Or, at least define a "null" value that can be "overwritten" by the
> subsequent picture.
> Can a picture have a "null" value, or does any # represent a color?
> If I have a VI with a picture in, and I want to "overlay" it with a
> picture out, I'm going to need to analyze the data in the picture in.
> But I don't seem to be able to extract the data by any means. That
> is, unlike most data types such as enum, I can't multiply it by a #, I
> can't slice it, I can't do anything with it. Is there any way to "get
> at" the data in a picture control/indicator?

There is a datatype in LV called the picture datatype, and a somewhat
new addition which is a cluster of pixmap information.

The picture data is a command stream and is you can easily add a new
drawing command either below or above any other picture by prepending or
appending to a given picture. If you open one of the picture VIs you
will see that there is some string casting going on and the picture is
basically treated as a string. In reality, it is a derived type from
string and is just a binary opcode/opdata stream. Others have reverse
engineered the picture VIs and recoded them over the years for various
performance reasons. You can do this also, though it is a bit tedious,
and it doesn't really sound like you need to do this.

If you are really talking about the image cluster, then this is a
different story. The image cluster is a combination of data including a
mask that can be used to record or draw bitmaps with transparency. It
doesn't look like it supports alpha blending, pixels are either the
source or the destination pixel values, but this will allow for holes in
your pixmap.

To directly answer your original set of questions, LV does have a
defined value for a transparent color. Unfortunately, there is no good
standard for this and this is not something we can pass on to the OSes.
For this reason, the transparent color can be used for many
operations, but it doesn't work inside of pixmaps. The cost of
searching every pixmap looking for transparent colors, when most of the
time it won't be found, would be pretty expensive and isn't supported.
Placing transparent colors in a pixmap will result in the pixel going
black since that is how the OS will interpret the transparent color LV uses.

For more info on pictures, you might want to look at the examples such
as the graphing demos or the robot arm.

Greg McKaskle
0 Kudos
Message 5 of 6
(5,103 Views)
Thanks for your answers!

I did end up just overwriting by using the Draw Point VI (builtin function). I got acceptable performance, as long as I didn't update the picture every time after I called the VI. (I just used two for loops on the additional 2D data w/ wired shift registers & called the VI only if the new data was not a null.)

I'm able to create a "semi-transparent" overlaid picture by simply passing the 2D data used for each picture to some code that interpolates a new color as based upon the colors present in each, & interpreting a certain value as a "null" (i.e., either black or white). This way, I don't have to "extract" the data back from the picture. I just use the data that I originally supplied to the Draw Picture VI.


These have turned out to be acceptable solutions, so I don't need to delve into the things you mentioned.
0 Kudos
Message 6 of 6
(5,103 Views)