LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Resize Image to a Container

Hi ,

 i want to Know how to Resize Image to match the  Container Using LabVIEW ? i use the code below but i find blank space in the picture .

Capture5.PNGCapture6.PNG

0 Kudos
Message 1 of 5
(2,433 Views)

Hi Emna,

 

to "fill" your image indicator you would need to apply two different scaling factors, for both X and Y axis: this is not supported for the image indicator.

 

You would need to scale the image on your own (or use an external 3rd party tool like imagemagick)!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(2,411 Views)

Your code HAS matched the container WIDTH. If you want the white space below disappear, adapt the 2D picture control height.

 

I suggest you do a search on "labview image resize" and "labview .net image resize" for some more info.

Certified LabVIEW Architect
0 Kudos
Message 3 of 5
(2,406 Views)

If you don't mind some .Net then you might want to checkout an example I made here which loads an image into a PictureBox which fits to the pane and resizes with it without extra code.  OpenG is needed.

 

https://forums.ni.com/t5/LabVIEW/Read-multi-image-tiff/m-p/3580103#M1002365

 

Of course I just went to try it and for some reason the control doesn't load so it might not actually work for you.

0 Kudos
Message 4 of 5
(2,376 Views)

@Hooovahh wrote:

If you don't mind some .Net then you might want to checkout an example I made here which loads an image into a PictureBox which fits to the pane and resizes with it without extra code.  OpenG is needed.

 

https://forums.ni.com/t5/LabVIEW/Read-multi-image-tiff/m-p/3580103#M1002365

 

Of course I just went to try it and for some reason the control doesn't load so it might not actually work for you.


It loads just fine here.

 

Nice demo. I didn't know about the "PNG data to LabVIEW Image.vi".

 

OP, don't be scared by that code, what you need can probably be done easier, using Image:Load(string) and SizeMode (and maybe something more). I suggest you search for the other threads about it and try it out.

Certified LabVIEW Architect
0 Kudos
Message 5 of 5
(2,357 Views)