Hello,
I would like to capture the bitmap of an entire webpage with WebBrowser1.CaptureBitmap, however I receive the following error:
when WebBrowser1.CaptureBitmap is called.
Here is my code:
Can anyone help me please?
Tomas
I would like to capture the bitmap of an entire webpage with WebBrowser1.CaptureBitmap, however I receive the following error:
java.lang.IllegalArgumentException: width and height must be > 0
when WebBrowser1.CaptureBitmap is called.
Here is my code:
B4X:
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim WebView1 As WebView
Dim btmp As bitmap
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Downloader.bal")
WebView1.JavaScriptEnabled = True
WebView1.ZoomEnabled = True
'btmp.InitializeMutable(500,800)
End Sub
Sub Activity_Resume
WebView1.LoadUrl("http://www.rootsoftllc.com")
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub WebView1_PageFinished (Url As String)
'btmp = WebView1.CaptureBitmap
Dim out As OutputStream
out.InitializeToBytesArray(1000)
Dim data() As Byte
WebView1.CaptureBitmap.WriteToStream(out,100,"PNG")
data = out.ToBytesArray
End Sub
Can anyone help me please?
Tomas