D Dman Active Member Licensed User Longtime User Nov 16, 2012 #1 I am trying to copy an html page to an image and can't seem to do it. I only found 1 topic here dealing with this error and I can't seem to get it working. I made a sample app to test it. It gives a height and width must be >0 error. Any help would be appreciated. TIA Attachments caperror.zip caperror.zip 10.8 KB · Views: 260 Last edited: Nov 18, 2012
I am trying to copy an html page to an image and can't seem to do it. I only found 1 topic here dealing with this error and I can't seem to get it working. I made a sample app to test it. It gives a height and width must be >0 error. Any help would be appreciated. TIA
Erel B4X founder Staff member Licensed User Longtime User Nov 17, 2012 #2 Can you post the full error message from the logs? Upvote 0
D Dman Active Member Licensed User Longtime User Nov 17, 2012 #3 This? java.lang.IllegalArgumentException: width and height must be > 0 at android.graphics.Bitmap.createBitmap(Bitmap.java:638) at android.graphics.Bitmap.createBitmap(Bitmap.java:620) at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.InitializeMutable(CanvasWrapper.java:543) at anywheresoftware.b4a.objects.WebViewWrapper.CaptureBitmap(WebViewWrapper.java:131) at com.reportsample.njdude.main._webview1_pagefinished(main.java:509) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:165) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:153) at anywheresoftware.b4a.BA.raiseEvent(BA.java:149) at anywheresoftware.b4a.objects.WebViewWrapper$1.onPageFinished(WebViewWrapper.java:60) at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:327) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4745) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) at dalvik.system.NativeStart.main(Native Method) java.lang.IllegalArgumentException: width and height must be > 0 Upvote 0
This? java.lang.IllegalArgumentException: width and height must be > 0 at android.graphics.Bitmap.createBitmap(Bitmap.java:638) at android.graphics.Bitmap.createBitmap(Bitmap.java:620) at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.InitializeMutable(CanvasWrapper.java:543) at anywheresoftware.b4a.objects.WebViewWrapper.CaptureBitmap(WebViewWrapper.java:131) at com.reportsample.njdude.main._webview1_pagefinished(main.java:509) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:165) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:153) at anywheresoftware.b4a.BA.raiseEvent(BA.java:149) at anywheresoftware.b4a.objects.WebViewWrapper$1.onPageFinished(WebViewWrapper.java:60) at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:327) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4745) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) at dalvik.system.NativeStart.main(Native Method) java.lang.IllegalArgumentException: width and height must be > 0
klaus Expert Licensed User Longtime User Nov 17, 2012 #4 The link in the first post is 'invalid' ! Best regards. Upvote 0
D Dman Active Member Licensed User Longtime User Nov 18, 2012 #6 Hmm. This appears to make an image from a html page on a website just fine but it doesn't seem to work on an html page stored on the device. Upvote 0
Hmm. This appears to make an image from a html page on a website just fine but it doesn't seem to work on an html page stored on the device.
klaus Expert Licensed User Longtime User Nov 18, 2012 #7 The problem is in the WebView1_PageFinished routine that doesn't seem allow to capture the bitmap. I modified the program: - Added a menu Item SaveBitmap - The SaveBitmap_Click routine saves the bitmap of the Report WebView. Best regards. Attachments caperror_1.zip caperror_1.zip 12.8 KB · Views: 351 Upvote 0
The problem is in the WebView1_PageFinished routine that doesn't seem allow to capture the bitmap. I modified the program: - Added a menu Item SaveBitmap - The SaveBitmap_Click routine saves the bitmap of the Report WebView. Best regards.
D Dman Active Member Licensed User Longtime User Nov 18, 2012 #8 That works awesome. Thanks! Upvote 0