LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Draw image at point in picture control

Is there a VI for drawing an image at a certain point in a picture control?  Something like the "Draw Text at Point" or "Draw Rectangle" VIs but with an image.
0 Kudos
Message 1 of 10
(10,610 Views)
Most of the picture functions have some sort of coordinates mapping for the top left corner...such as "Draw Unflatten Pixmap". Will that work for you?
________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
0 Kudos
Message 2 of 10
(10,602 Views)

An example using Unflatten pixmap... redraw the same image after a 50 pixel shift in x and y :



Message Edité par chilly charly le 11-16-2007 02:00 PM
Chilly Charly    (aka CC)
Message 3 of 10
(10,591 Views)
Thanks for posting that example....
And of course the first picture doesn't have to be the same as the picture you use unflatten pixmap on...i.e. You can combine different pictures, including one that is blank (starting background).
________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
0 Kudos
Message 4 of 10
(10,588 Views)

I think you are correct, you can combine the images.

The image at the Unflatten Pixmap.vi would have to be different (so for the example, open two seperate jpg files).

RayR

0 Kudos
Message 5 of 10
(10,582 Views)

See attached image

 



Message Edited by JoeLabView on 11-16-2007 08:30 AM
Message 6 of 10
(10,578 Views)

I know this post is old but I was looking for the same question in 2021. I figured out you can also set the image position in the picture by directly manipulating the image data / Rectangle, just make sure you keep the same aspect ratio and size or it will draw a funky picture. see code snipit. 

set pic origin.png

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 7 of 10
(4,562 Views)

To be fully correct you should actually also apply the offset to the left and top coordinates. While that is usually 0 and 0, it won't be once you do such funky offset manipulations. And it's even imaginable that an image has actually another than a 0, 0 origin. Image formats like PNG would support such things with optional Tags, although I'm not sure the LabVIEW PNG read function supports such things.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 8 of 10
(4,557 Views)

Well I would never want to be fully correct on anything, I'm ok with technically correct ; )

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 9 of 10
(4,553 Views)

Also for completeness the 2D picture control is just a string, with operations describing how to draw the thing, drawing on top of the image.  The Concatenate String function work on 2D pictures to put one on top of the other.  As a result you can draw your image, and then shift it by adjusting the operations of the image.  One great example of this is by Norm over on LAVA.

 

Using this you could draw the image, then shift it, then concatenate it on an existing image if you needed.

0 Kudos
Message 10 of 10
(4,528 Views)