Hi
I have below code and i want to save croppedpicture
BitBlt croppedPic.hDC, 0, 0, 3000, 3000, originalPic.hDC, cropX, cropY, SRCCOPY
croppedPic.PaintPicture originalPic.Picture, 0, 0, 3000, 3000, cropX, cropY
Thanks
Hi
I have below code and i want to save croppedpicture
BitBlt croppedPic.hDC, 0, 0, 3000, 3000, originalPic.hDC, cropX, cropY, SRCCOPY
croppedPic.PaintPicture originalPic.Picture, 0, 0, 3000, 3000, cropX, cropY
Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sophia CarterPosted Mar 21, 2025, 1:47 PM
It seems like you are eager to save a cropped picture using Visual Basic code. In the code snippet provided, the `BitBlt` function is used to perform a bit-block transfer of the cropped area from the original picture to the cropped picture. Subsequently, the `PaintPicture` method is invoked to display the cropped area on the cropped picture.
To save the cropped picture after performing these operations, you can utilize further code to export the contents of the `croppedPic` to a file format, such as a JPEG or PNG. Below is an example of how you can save the cropped picture to a file:
In this snippet, `"C:\path\to\save\cropped_picture.jpg"` represents the file path where you want to save the cropped picture, and `vbJPEG` indicates the desired file format (you can use different formats as needed).
By incorporating the file-saving step after cropping and displaying the image, you can complete the process of saving the altered picture. If you have any more questions or need additional assistance, feel free to ask!