Hi
When i am trying to save Picture it is giving Type Mismatch error
Dim originalPic As PictureBox
Dim croppedPic As PictureBox
' Assuming originalPic contains the original image
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 = 25000
centerY = 14000
' Calculate top-left coordinates for cropping (3000x3000)
Dim cropX As Long, cropY As Long
cropX = centerX - (3000 \ 2)
cropY = centerY - (3000 \ 2)
croppedPic.Width = 3000
croppedPic.Height = 3000
BitBlt croppedPic.hDC, 0, 0, 3000, 3000, originalPic.hDC, cropX, cropY, SRCCOPY
croppedPic.PaintPicture originalPic.Picture, 0, 0, 3000, 3000, cropX, cropY
SavePicture croppedPic.Picture, App.Path & "\C_" & tno & ".jpg"
On this line i got error
SavePicture croppedPic.Picture, App.Path & "\C_" & tno & ".jpg"
Thanks