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.
I step trough the code and I see that the correct coordinates do go into the Function. My ScaleMode is Twips.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
Any help would be awesome. Thanks in advance




Reply With Quote