LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Importing image as background and being able to zoom in and pan

Solved!
Go to solution
I need to write an application that takes an image file (jpeg, bitmap, etc) and applies it inside a labview window.  I need to be able to zoom in on a selected area and pan in every direction.  The zoom and pan feature can use external controls.  Has anybody done something similar?  I am thinking of using a picture control but the zoom and pan part is the problem.  I would have to re-draw a smaller section of the original image.  Is there a better way to do this?  Thanks, any help would be much appreciated.
0 Kudos
Message 1 of 12
(4,190 Views)
Solution
Accepted by topic author SiliconValleyRob
Not exactly what you are looking for, but should give you an idea.  Click and drag to pan, use the scale to zoom.  Right now it loads a PNG file, you can change to whatever format you want.
Message Edited by Darin.K on 12-08-2009 07:19 PM
Message 2 of 12
(4,184 Views)
Another option is the Code Capture Tool, which does the implementation of the panning slightly differently from Darin's example. It's more polished, but Darin's example has the advantage that it only shows that part, so it's easier to understand.

___________________
Try to take over the world!
0 Kudos
Message 3 of 12
(4,156 Views)

Darin:  I have labview 8.2 and can't open the vi you posted.  You think you can re-compile and post again pls?

 

tst:  Can you explain a little further how I can use that snipet tool for my application?  I watched the video and read the thread on your link but it's still not 100% clear.

 

Thanks for the help

0 Kudos
Message 4 of 12
(4,140 Views)
The CCT is used for capturing images of LabVIEW code. One of its features is a preview of the image, which you can both zoom and pan. The code is open source and saved in LV 7.0, so you can have a look at it.

___________________
Try to take over the world!
0 Kudos
Message 5 of 12
(4,130 Views)
Here it is in 8.2
0 Kudos
Message 6 of 12
(4,127 Views)

TST,

 

Ok now I understand what you meant.  I opened up the source for the CCT vi and it seems like it's pretty high level programming.   I'm going to study it further to see if I can find a way to make it work for my application.  Do you think you can re-compile the vi posted earlier for labview 8.2 and re-post it so I can also use that for reference.

 

Thanks

0 Kudos
Message 7 of 12
(4,121 Views)

Hey TST,

 

Here is the VI posted by Darin.K in LabVIEW 8.2

Hope this helps.
-Ben

WaterlooLabs
0 Kudos
Message 8 of 12
(4,109 Views)
Thank you all for your input.  Does anybody know if it is possible to display files that are not image-type (png, jpeg, bitmap) on a picture control?  Is it possible to display an autoCad or dxf file graphically on a picture control??
0 Kudos
Message 9 of 12
(4,096 Views)

The picture control VIs are pretty basic and only support a few image types, so it wouldn't support stuff like that.

 

LabVIEW has another type of control called the 3D picture control which probably supports some of the common formats, but I have no experience with it. Presumably the documentation has the details.

 

Another option is seeing if you can get an ActiveX or .NET control made by a third party (like Autodesk, in the case of AutoCAD) which allows displaying those files and then embedding that control in your VI.


___________________
Try to take over the world!
0 Kudos
Message 10 of 12
(4,078 Views)