Picturebox not showing correct coordinates....HELP PLEASE
I have 2 forms. One form functions as the File navigator to select the .JPG or .BMP and finally show the picture in a picbox. To get the part of the picture the User wants to see in the first form, I have a 2nd form that loads the full picture into a picbox. Within this picbox I have made a little Framing tool that is esentially 4 black rectangle to look like an actual picture frame and a transparent label over the top of the 4 rectangle shapes. The user can click on the transparent label and move the 4 shapes around to frame the part of the picture they want to show on the first form. I am using the PaintPicture function to paint the picture into the first form picbox but it always paints the top left of the picture. here is my code
The following code is attached to the "Okay" button on the second form.
Code:
Private Sub lblOk_Click()
PicPath = FirstForm.DirPhotos + "\" + FirstForm.flbPhotos
XSETTINGFORPIC = TransparentLabel.Left
YSETTINGFORPIC = TransparentLabel.Top
FirstForm.picboxClient.Picture = LoadPicture(PicPath)
FirstForm.picboxClient.PaintPicture SecondForm.picbxMain.Picture, 0, 0, SecondForm.TransparentLabel.Width, SecondForm.TransparentLabel.Height, XSETTINGFORPIC, YSETTINGFORPIC, SecondForm.TransparentLabel.Width, SecondForm.TransparentLabel.Height
Unload Me
End Sub
I step trough the code and I see that the correct coordinates do go into the Function. My ScaleMode is Twips.
Any help would be awesome. Thanks in advance
Picture Selecting techniques..
Well if nobody has any suggestions how about a couple suggestions for alternatives.
I have a picture box that shows the entire picture.
A Selecting tooling that the user moves to frame the desired area.
Once the area is framed the User clicks okay and the form unloads after it has loaded the statically sized picture box on the other form.
Sounds easy but I can't get this simple little program to work. Perhaps if some smart person has 5 minutes they could show me an example of this or even program this themselves.
1 Attachment(s)
Here is the small Application for you to try to help me with.
Anybody want to help me with this?
Look up about 5 messages and down load my little 2 form application. Included is the .vbp and the 2 forms. You will notice how my picturebox doesnt work consistently correctly at all.