LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help setting/ Calculating "Origin Left" value for a right indent of a resized image.

Hi,

I am trying to resize images and indent them to right side of 2D Picture indicator. Please see the examples below:

1) Default (Origin Left value: 0)

Xonmyth_0-1717190893116.png

 

2) Indented right (Origin Left value: -385)

Xonmyth_1-1717190968747.png

 

2D Container is 305 wide, image is 225 wide. What I am failing to understand is where this -385 value is coming from. I would like to calculate and auto adjust image position based on calculated "Origin Left value". This values changes if I used a different resolution image but the aspect ratio would be same.

 

Another example but of different resolution and aspect ratio: (Origin left: -690)

Xonmyth_2-1717191279870.png

Image is 1280 wide.

 

This is my code:

DEL Snippet.png

I have attached both the images I used as attachment too. I would really appreciate if someone could educate me a little here.

 

Thank you for reading.

 

Download All
0 Kudos
Message 1 of 2
(735 Views)

Ummm, I found a solution from in a post. I modified it and it works. Although I still do not understand it fully. Will probably have to do some digging when I have time. Posting my solution if someone like me wants a solution.

 

 

DEL_Open Image.png

DEL_Right Indent Solution.png

  

0 Kudos
Message 2 of 2
(719 Views)