Hi
I have below code and i want to save croppedpicture
VB.NET
BitBlt croppedPic.hDC, 0, 0, 3000, 3000, originalPic.hDC, cropX, cropY, SRCCOPY
croppedPic.PaintPicture originalPic.Picture, 0, 0, 3000, 3000, cropX, cropYThanks
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, cropYThanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sophia CarterRank #4,018 · 371 reputationPosted Mar 21, 2025, 9:47 AM EDT
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:
croppedPic.Save "C:\path\to\save\cropped_picture.jpg", vbJPEGIn 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!