Results 1 to 19 of 19

Thread: Picturebox not showing correct coordinates....HELP PLEASE

Threaded View

  1. #1

    Thread Starter
    Fanatic Member Avatarp's Avatar
    Join Date
    Sep 2002
    Location
    Calgary
    Posts
    826

    Talking 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
    Last edited by Avatarp; Apr 22nd, 2004 at 11:51 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width