2
Answers

How to Crop Image Using Vb6

Ramco Ramco

Ramco Ramco

1w
80
1

Hi

  In below code i want that Original Image should get cropped to fit in another Picture whose size is 3000 X 3000

Dim originalPic As PictureBox
    Dim croppedPic As PictureBox

    Set originalPic = Picture1 ' Set your source PictureBox
    Set croppedPic = Picture2 ' Set your destination PictureBox

    ' Centre of the original image
    Dim centerX As Long, centerY As Long
    centerX = originalPic.ScaleWidth / 2
    centerY = originalPic.ScaleHeight / 2

Thanks

Answers (2)