I'm taking a screenshot of a scrollview with this code, the scrollview contain an image and a label that may contain up to 1500 characters.
The problem is that the more is "high" is the scrollview panel.height the more the screenshot dimensions are reduced, the width of the screenshot is reduced proportionally, i can't find better words to explain sorry.
If the text contained in the label is short then the screenshot dimensions are not reduced and it looks good.
The problem is that the more is "high" is the scrollview panel.height the more the screenshot dimensions are reduced, the width of the screenshot is reduced proportionally, i can't find better words to explain sorry.
If the text contained in the label is short then the screenshot dimensions are not reduced and it looks good.
B4X:
Dim Obj1, Obj2 As Reflector
Dim bmp As Bitmap
Dim c As Canvas
Obj1.target = Obj1.GetActivityBA
Obj1.target = scrollview.Panel
bmp.InitializeMutable(Activity.Width,scrollview.Panel.Height)
c.Initialize2(bmp)
DoEvents
Dim args(1) As Object
Dim types(1) As String
Obj2.target = c
Obj2.target = Obj2.GetField("canvas")
args(0) = Obj2.target
types(0) = "android.graphics.Canvas"
Obj1.RunMethod4("draw", args, types)
DoEvents
Dim out As OutputStream
out = File.OpenOutput(File.DirRootExternal&"/folder" , Filename, False)
bmp.WriteToStream(out, 100, "JPEG")
out.Close