LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to resize and stretch an image to completely fit a picture frame

Hi, I am trying to programitaclly insert an image into a frame and then resize and strech the image to completely fill the frame, but not cut off parts of the image.

 

I found these instructions for how to do almost what I need

 

http://digital.ni.com/public.nsf/allkb/55EEBE3A1ECC38F58625765600796F1C

 

This resizes the image to make sure the entire thing is in the frame.

 

The problem is that it has white space on the sides if the picture does not have the same height and width ration as the frame.

 

What I need is to stretch the image so that it will completely fill up the frame without white space, but not cut of any part of the picture.

 

 

 

Also, I know that I can do this by right clicking on the frame, going to advanced-->customize. Then inserting an image at same size.

The problem with this is I cannot do this programitaclly, and I have to create/save a file to save the changes. 

I am making this program to be used by a uncomputer savy person so I am trying to avoid forcing them to create, rename, and save a file correctly.

All they have to do is select the file path for their picture.

 

 

Any help would be appreciated. Even if it is just to say there is no way to do this.

0 Kudos
Message 1 of 2
(4,379 Views)

If you do a search for "resize picture" here, this is one of the first results that come up, and there is example code there for how to scale the dimensions separately - http://forums.ni.com/t5/LabVIEW/How-to-Resize-a-picture/m-p/246785/highlight/true#M133860

 

Keep in mind that if you do that, the picture will appear distorted, because you're stretching it. It might be preferable to scale it to be larger than the indicator and then pan it using the origin property of the indicator.

 

Another option would be to use the size property of the indicator to make the indicator fit the image, but that's up to you.


___________________
Try to take over the world!
0 Kudos
Message 2 of 2
(4,368 Views)