#1
Posted
:
Wednesday, July 17, 2019 1:53:40 PM(UTC)
Groups: Registered
Posts: 4
I'm using the Android MICR demo to play around with some of Leadtool's functionality. I want to display the image that is captured and analyzed to get the MICR information. To do that, I try to convert the RasterImage to a Bitmap image, but get the following error:
Code:Failed converting to bmp
leadtools.RasterException: Invalid parameter passed
at leadtools.RasterImage.updateBitmapHandle(RasterImage.java:704)
at leadtools.converters.RasterImageConverter.convertToBitmap(RasterImageConverter.java:64)
at leadtools.converters.RasterImageConverter.convertToBitmap(RasterImageConverter.java:53)
at leadtools.micrdemo.MicrDemoActivity.showAboutDialog(MicrDemoActivity.java:1213)
at leadtools.micrdemo.MicrDemoActivity.access$800(MicrDemoActivity.java:97)
at leadtools.micrdemo.MicrDemoActivity$10.run(MicrDemoActivity.java:771)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
I added one line to MicrDemoActivity.java in the MicrDemo example, and I've tried both 0 and null for the second parameter (line 770 or so of the actual file):
Code:if (displayResult && mContinueCapture) {
// MICR data found, display the result
runOnUiThread(new Runnable() {
@Override
public void run() {
android.graphics.Bitmap displayableImg = RasterImageConverter.convertToBitmap(img, null);
displayResults(result);
}
});
}
Any ideas why it fails to convert the image? Thanks
#2
Posted
:
Thursday, July 18, 2019 11:19:45 AM(UTC)
Groups: Registered
Posts: 4
Solved, added this line to
Code:protected MicrResult doInBackground(YUVImage... yuvImages)
:
Code:
.......................................
RasterImage rasterImage = RasterImage.createFromYUVImage(mYUVImage, 24);
imgToConvert = new RasterImage(rasterImage); // Added this
if (mPreviewBufferRotation != 0) { ..................................
imgToConvert can then be converted to a Bitmap
#3
Posted
:
Friday, July 19, 2019 10:31:54 AM(UTC)
Groups: Registered, Manager, Tech Support, Administrators
Posts: 107
Was thanked: 9 time(s) in 9 post(s)
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.