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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Graphic selection in VB 5

Status
Not open for further replies.

Cirvam

Programmer
Nov 23, 1999
58
US
How can I take one bitmap and select various portions of it and put it in another picturebox?<br>
<br>
Thanks<br>
Erik
 
I have not been able to get the picturebox to do any of the following<br>
1. zoom in or out<br>
2. move around (like panning)<br>
3. copy a portion of it to the clipboard<br>
<br>
But maybe this will get you going<br>
AutoRedraw property needs to be True on both pictures.<br>
Start with the mouse down event of the first picture box<br>
you need to save the X & Y coordinates of the first click in global variables<br>
then put a small cross hair there with the line property of the picture so your eye knows where you clicked.<br>
<br>
Next click the other corner of the picture get its X-Y coords.<br>
I put two text boxes on the form so I can see the X and Y coords when I programming a picture box <br>
You can erase them later.<br>
Change the mouse to cross hair if you like in the pictures MouseIcon property<br>
<br>
After that I'm not sure<br>

 
Erik<br>
<br>
What exactly do you want to do? <br>
1) Do you want to mark parts of a picture with a mouse and then copy those to another picture? <br>
2) If Yes, are these regular, i.e. Square, Rectangular, Circular, or are they irregular, i.e. drawn freehand?<br>
or<br>
3) Do you want to click on a button to have a predefined part of a picture copied?<br>
<br>
Based on your answers to these I can send you info on how to do each. In the mean time, if you are not familiar with the BitBlt API function, I would suggest having a look at the code code I posted a few weeks ago.<br>
<br>
-Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top