LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scaling a JPEG with ZoomFactor Property

Hello All,
 
I am trying to load a JPEG file and scale it to fit the drawing area of my picture display. I am trying to use the ZoomFactor property, which seems to distort the picture if the scale is less than 1. Interestingly, I found an example in the "examples" folder, and the zoomfactor property seems to work OK there.
 
Is there any magic I have to do in order to get the ZoomFactor to work right?
 
Thanks
-Ted
0 Kudos
Message 1 of 31
(3,757 Views)
What do you mean by "distort"? Simply the wrong aspect ratio maybe?
 
Could you show a screenshot of the "distortion"?

What are you doing differently compared to the example code?
What is your LabVIEW version?
0 Kudos
Message 2 of 31
(3,749 Views)

I assume you mean something like what is shown in this thread. LV seems to have some problems when resizing some images.

You can try using the messy example posted here to resize your image.


___________________
Try to take over the world!
0 Kudos
Message 3 of 31
(3,740 Views)
Take a look at the high resolution resize with Image Toolbox ($) at:  http://www.geocities.com/gzou999/imgtool.htm
George Zou
0 Kudos
Message 4 of 31
(3,733 Views)

Thanks for the reply folks. At least I somewhat understand it now. I hope NI can fix this in a future release -- every other freeware image viewer has a real time scaling that works well, so it shouldn't be that hard. In the interim, I'll pre-size the JPEG image to the size I want to display. I am enclosing the image since one of the posters requested to see it. It's pretty sad. This is too bad, since I was hoping to implement a help system for finding certain connectors on my printed wiring board. The idea was to zoom in on a photo of a board, and help the user identify the correct component.

 

 

Regards

-Ted

0 Kudos
Message 5 of 31
(3,728 Views)

You can still do what you want. Load the full size image and resize it to fit the display using one of the referenced VIs. When the user zooms in, take the original image again and do another resize on it with the new zoom value.


___________________
Try to take over the world!
0 Kudos
Message 6 of 31
(3,722 Views)

You can still do what you want. Load the full size image and resize it to fit the display using one of the referenced VIs. When the user zooms in, take the original image again and do another resize on it with the new zoom value.

Hi -- I presume you mean that I have to purchase a VI, and I cannot do it with the ZoomFactor property. Is that correct?

Regards

-Ted

0 Kudos
Message 7 of 31
(3,712 Views)

I mean that you can not do this with the zoom property because it doesn't work (note - it might work if you use PNG and not JPG, although I doubt it).

You don't have to buy George's VIs - you can simply follow the link I provided in my first reply which includes a VI which does this and a reference to another VI which does this.


___________________
Try to take over the world!
0 Kudos
Message 8 of 31
(3,705 Views)

I saw there is a .net picturebox control available. Is there any documentation on how that beast works? Maybe an activeX control is available as well. As usual, the msdn site is less than informative 🙂

Thanks again,

-Ted

0 Kudos
Message 9 of 31
(3,698 Views)
I don't know the .net control, but what's wrong with the method I suggested?

___________________
Try to take over the world!
0 Kudos
Message 10 of 31
(3,695 Views)