Width and Height of math editor image getting 0

I am trying to get image of editor through:
Bitmap b = mWidget.getResultAsImage();
but sometime it get width and height of the image 0 and app crashes.Following are the errors:

Fatal Exception: java.lang.IllegalArgumentException
width and height must be > 0 ( (
com.myscript.atk.math.widget.export.PictureExporter.generateData (
com.myscript.atk.math.widget.controller.MathWidgetController.getResultAsImage (
com.myscript.atk.math.widget.MathWidget.getResultAsImage (
com.dd.fosterlearning.EquationEditor.EquationSolvingActivity.getEEData (
com.dd.fosterlearning.EquationEditor.EquationSolvingActivity.access$100 (
com.dd.fosterlearning.EquationEditor.EquationSolvingActivity$3.onClick (
android.view.View.performClick (
dalvik.system.NativeStart.main (

1 Comment

Dear Sulman,

Thank you for your question.

Can you confirm you are calling the getResultAsImage function in the onRecognitionEnd function?

Indeed, this function is called when you have a result ; if you do not have a result, it is likely you will not get an image.

I also recommend you have a look to the following topic:

Best regards,


Login or Signup to post a comment