From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

add two pictures

Solved!
Go to solution

I'd like to add multiple pictures (pictures = object of the labview data accessed through Grahpics & Sounds -> Picture Functions).  Right now I can use one picture as an input to a picture function (such as Draw Rectangle or Draw Circle), and I can cascade different drawing commands to get a composite picture.  But I'd like to store different pictures that I use for Intensity Graph overlays and toggle them on and off for the user.  It seems as if a function to add two pictures, which appears to be intrinsic to all the drawing vi's, should exist but I can't find it anywhere.  Does one exist?

 

thanks,

Doug

0 Kudos
Message 1 of 5
(3,598 Views)

you could try simple running the wires of the two pictures into the "Add" primitive. As long as they're the same dimensions, LabVIEW will automatically do matrix addition to give you an "added" version of the two pictures.

0 Kudos
Message 2 of 5
(3,597 Views)

No luck with that.  

 

I dug into the "Draw Rectangle" vi and somehow it adds a picture type to another drawing (which was generated by an unspecified typecast) through a concatenate.   I don't understand how that works, otherwise I'd try to backward-engineer it and make use of it.

 

 

0 Kudos
Message 3 of 5
(3,593 Views)
Solution
Accepted by topic author dch2

Looks like "Concatenate String" does the trick.  Who would have thought pictures were strings? And could be concatenated?  NI might want to make this easier to find in the documentation it it's already there.  Or add it if it's not.

0 Kudos
Message 4 of 5
(3,590 Views)

From looking at it, pictures are stored in some sort of binary format, flush with opcodes and the like. Strings are just binary data, so they're simply storing all the information within a string. LabVIEW must parse it all out when it reads it to make the display.

0 Kudos
Message 5 of 5
(3,587 Views)