Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mousing a cropping selection box over an image

Status
Not open for further replies.

button71

Programmer
Nov 8, 2006
69
AU
I am using

Code:
.container1.imgcontrol1.Picture = (mypicture)

( mypicture being the fullpathname of a say jpg file).

to put a picture in a container on my form.

I would like to know if it is possible to have a control which sets the mouse to draw a selection area on the image - collect the coordinates - and return the amount of cropping on each dimension.
 
The image's mouseDown and mouseMove events both know the co-ordinates of the mouse position so you should be able to do some arithmetic with these and with the image coordinates. Drawing and redrawing the box as the mouse moves will be more difficult. I think you'll need to alter the form's drawMode so that you can undraw the lines.

Geoff Franklin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top