Android Question problem with Draw Bitmap from WebView

Roberto P.

Well-Known Member
Licensed User
Longtime User
Hello
I can not solve the problem of truncation of the page when I create image from web view.

is only generated image of the first page !? I saw that there are other identical reports and did various tests, but I could not find a way to solve the problem.
Can anyone help me please.

B4X:
Example 1

    Dim bmp As Bitmap         =     mWV.CaptureBitmap()       
    Dim out As OutputStream
   
    out =    File.OpenOutput(mPathSavedReport, mFileSavedReport, False)
       
    bmp.WriteToStream(out, 100, "PNG")

    out.Close

Example 2

Dim Canvas1 As Canvas
Dim Bitmap1 As Bitmap
   
 Bitmap1.InitializeMutable(100dip, 100dip)
     
   Canvas1.Initialize2(mWV.CaptureBitmap()) 'this canvas will draw on the activity background
     
    SetDensity(Canvas1.Bitmap, 300)
     
   'Canvas1.DrawTextRotated("Pincode: 1234567", 150dip, 250dip, Typeface.DEFAULT_BOLD, 18, Colors.Black, "CENTER", -90)
   
   Dim Out As OutputStream

    Out = File.OpenOutput(File.DirRootExternal, "Test.png", False)
   
   Canvas1.Bitmap.WriteToStream(Out, 100, "PNG")
   Out.Close

Thank you
 

Attachments

  • image.png
    image.png
    71.7 KB · Views: 190
  • rapportino part one.png
    rapportino part one.png
    57.8 KB · Views: 163
  • rapportino part two.png
    rapportino part two.png
    14.8 KB · Views: 186

Roberto P.

Well-Known Member
Licensed User
Longtime User
Erel
The problem is that the image is created of the only part visible in the device. In other words, if the web view has a higher height of the screen is generated the image of one area that you see.
I hope it is clear.
I think the problem depends on the image of the web view generation.
thank you
 
Upvote 0

Roberto P.

Well-Known Member
Licensed User
Longtime User
HI Erel,
make a small example is a complex task that requires very little time. I ask the great courtesy to tell me how to work the DrawBitmap function or send me the source of the same way I analyze where is the problem with our html.
Thanks so much
 
Upvote 0
Top