Hi
On below line i am getting error "Invalid Property Value"
SavePicture croppedPic.Picture, App.Path & "\C_" & tno & ".jpg"
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"
Thanks
Emily FosterPosted Mar 21, 2025, 1:58 PM
It seems like you're encountering an "Invalid Property Value" error in your code snippet while trying to save an image using the `SavePicture` method. This error typically occurs when one of the properties that you are attempting to set or save does not have a valid value.
In your specific case, the issue could be related to how the `croppedPic.Picture` is being handled or accessed. To debug this, you might want to ensure that `croppedPic.Picture` is set correctly and that the path being generated with `App.Path & "\C_" & tno & ".jpg"` is valid and properly formatted.
Here are a few steps you can take to troubleshoot this error:
1. Check if `croppedPic.Picture` is properly loaded or set before attempting to save it using `SavePicture`.
2. Verify that the path generated by `App.Path & "\C_" & tno & ".jpg"` is forming a valid file path where the image can be saved.
3. Ensure that `tno` holds a valid value that can be concatenated to the file path without causing any issues.
4. Double-check the dimensions and format of the image you are trying to save to ensure compatibility with the `SavePicture` method.
By reviewing these aspects of your code, you should be able to pinpoint the exact cause of the "Invalid Property Value" error. Feel free to adjust your code based on these recommendations and test it again to resolve the issue. If you encounter any further challenges, don't hesitate to ask!