Hello,
This is ERROR_NO_BITMAP and it usually happens if your code does not check for errors. For example, when the load process fails and your code doesn’t check to see if it succeeded, and then the code tries to apply some sort of image processing on the image. Since the load failed, the function that expects a valid image has to return this error. If you are using the OCX, one way to check is to make sure LEAD1.Bitmap is not 0 before calling any function that needs a valid image.
I simulated a case by code. This could happen in your project if one of your users tries to open a 'bad' file, then a function is called without checking if LEAD1.Bitmap is non-zero.
10 LEAD1.EnableMethodErrors = False
20 Debug.Print LEAD1.Load("j:\images\OCR1.TIF", 1, 1, 1)
30 Debug.Print LEAD1.Bitmap
40 Debug.Print LEAD1.Load("c:\boot.ini", 1, 1, 1)
50 Debug.Print LEAD1.Bitmap
60 Debug.Print LEAD1.Flip
Output of line 20 is 0 because it's a valid image
Output of line 30 is 23464076 (it should be any non-zero value)
Output of line 40 is 20009 ERROR_FILE_FORMAT because the file exists but is not an image.
Output of line 50 is 0 because there's not bitmap now
Output of line 60 is 20002 ERROR_NO_BITMAP because there's no image now to Flip.
Maen Badwan
LEADTOOLS Technical Support
Edited by moderator Tuesday, March 28, 2017 7:54:12 AM(UTC)
| Reason: Not specified