From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Move picture inside of the picture control

All,
 
What I have been tasked to do is to use a picture control to display a picture and be able to zoom in and out of the picture. this works great. What I would like to be able to do is click and hold down the mouse and while the mouse is down move the picture with the coords of the mouse.
 
like this.
click and and hold.
mouse moves left then the picture moves to the left.
 
Any suggestions are appreciated.
 
thanks in advance



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 1 of 16
(5,731 Views)

The IMAQ picture control does this all.  You might need some vision package to use it?

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 16
(5,717 Views)
I would rather stick to the built in pic control. I am not going to buy the vision set just for this.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 3 of 16
(5,713 Views)

Hi Joe,

I can't point you at a complete solution but the "CC and Friends" thread has cod ethat will let you figure out where in the picture the mouse is and where the user clicked.

That will at leats give you a head-start on this challenge.

If that helps and you find the opertunity, please post back showing how you completed this task. We could use an exaple that shows how to do this.

I hope this helps,

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 16
(5,707 Views)

Thanks Ben,

I have looked at that post a lot today and still cannot come up with the solution. I even tried to open some of your VI's but I could not open them because it kept asking for a folder called for Ben.

 

I will keep working on it.

 

thanks




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 5 of 16
(5,699 Views)

All of the file should be there except the one CC mentioned and that VI can be found in a latter post.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 16
(6,349 Views)
I will dig around some more on Monday



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 7 of 16
(6,344 Views)
My suggestion was only if you already had IMAQ.  You can do what you want with dynamic mouse event registration.
\On mouse down register for mouse move, on mouse up unregister for mouse move.  In the mous move (now is a grab event since it is dynamically registered) move the image center by the difference (X, Y) noted by the mouse move event, than redraw with the new translation accounted for.
 
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 8 of 16
(6,343 Views)
Try this VI, soon to be part of the CCT. Note that it expects a boolean stop event reference.

___________________
Try to take over the world!
Message 9 of 16
(6,293 Views)

NICE work tst. How did you create the stop reference. I have seen this done before but I do not know how to create things like this.

Thank you for the VI. I will try it out soon.




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 10 of 16
(6,255 Views)