LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Zoom Factor won't work with picture...

So first I am programmatically uploading my picture throught the Block Diagram. And for some reason that used to work but now it doesn't even though I haven't changed anything (that I know of). And secondly, I'm trying to zoom in/out of the picture using the zoom factor. However, I don't want to do it using the Zoom wheel. I want to programmatically zoom in on the picture.

 

I read about zoom factor and it says you can do this by feeding in a double integer into the Zoom control (0.5 is half size, 2.0 is double size, and so on). You can see where I've tried to implement that in the Block Diagram. But as for now, it's no dice. Anyone know how this thing works better than I? 

 

My VI is attached here.

 

 

0 Kudos
Message 1 of 8
(3,657 Views)

Can you upload for LabVIEW 2014?

 

Besides that, 0.5 is not an integer, so I'd suggest you carefully reread the documentation.

0 Kudos
Message 2 of 8
(3,646 Views)

Your code works fine, but your Picture indicator is messed up somehow. The only way I could ger the zoom to work is by deleting that Picture and creating a new one. My guess is you set the zoom factor to something impossible and that broke it.

 

You also don't need to open the picture with every iteration, so move that part outside the loop.

 

Why are you dividing by 0.2 for the zoom value? This just invalidates the value that the user is trying to select and means they can only ever have a 5x zoom at the lowest.

Zooming around.png

Should be more like this:

Zooming around faster.png

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 3 of 8
(3,641 Views)

  -

0 Kudos
Message 4 of 8
(3,634 Views)

I was divind by 0.2 because I thought (hoped) that is where you programmatically tell zoom factor to zoom (out in this case) by that much. I didn't want to use the wheel.

0 Kudos
Message 5 of 8
(3,621 Views)

Programmatically zooming in and out just means that the DBL value you write to the property node is what's setting the zoom.

You literally cannot use your mouse wheel to zoom in and out of a picture in LabVIEW, unless you write code to programmatically do it.

 

This code will programmatically zoom in and out from a factor of 1 to 11:

Zooming around on a rollercoaster.png

 

This code will programmatically zoom in and out by iterations of 0.1 zoom factor based on the mouse wheel being used while moused over the Picture indicator:

Zooming around on a wheel.png

 

This code is really spaztic and annoying:

Zooming like a spaz.png

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 6 of 8
(3,616 Views)

If you didn't see, I added a few examples to my last reply.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 7 of 8
(3,594 Views)

Oh, I definitely saw the examples. Thanks a lot, James. I'll get back to you how this works out.

0 Kudos
Message 8 of 8
(3,578 Views)