LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to draw a rectangular area on a displayed image using mouse

Hi,
 
I am attaching the code I am using for displaying the image which is generated by photo diode as a result of sample scan. Based on this scan I want to select my area of interest (rectangular shape) using mouse which would be a sub-set of displayed image. Please let me know how to do it. I am attaching both the code and excel file.
 
(The code will ask "Do you want to move motor to desired location" if you will click inside the displayed image.  I have removed the motor-movement part. So, it will just diaplay the coordinate.)
 
Thanks,
Dushyant
0 Kudos
Message 1 of 6
(3,359 Views)
You could do something similar to my example in this recent thread. Let me know if you have questions.

Message Edited by altenbach on 11-01-2005 04:17 PM

0 Kudos
Message 2 of 6
(3,357 Views)

Thanks,

The code in second thread worked with minor modification.

Dushyant

0 Kudos
Message 3 of 6
(3,328 Views)

Hi,

I am having some problem in modifying my code as suggested by you. Basically I am also using "Zoom-factor" and "Scroll-bar". If zoom-value is at 100 (i.e. no zoom), I can display the selected area. However if zoom is not 100, I can not select area. Also, the red-dotted area which appears in original picture in your code, appaears in "selected" (i.e. resultant image) in my code. I could not sort out these issues.

I am attaching my code n an excel file.

Thanks,
Dushyant
0 Kudos
Message 4 of 6
(3,317 Views)
Well, you just need to keep track of the zoom factor in some way.
 
Basically, you just made a mess out of my code by adding unneeded shift registers and other odd constructs. I spend a few minutes to clean it up a bit. Seems to work OK now. 😉
 
 
0 Kudos
Message 5 of 6
(3,310 Views)
Thanks,

It worked.

Dushyant
0 Kudos
Message 6 of 6
(3,306 Views)