Hi Everyone, I am using this code to try and take a screenshot of the entire screen:
But this code takes a cropped screenshot. It does not include the title and status bar. Also I am used a tabbed application, so it does not take a photo of the tabs either.
B4X:
Log("TakeScreenshot activated")
' Take a screenshot.
Dim Obj1, Obj2 As Reflector
Dim bmp As Bitmap
Dim c As Canvas
Obj1.Target = Obj1.GetActivityBA
Obj1.Target = Obj1.GetField("vg")
bmp.InitializeMutable(Activity.Width, Activity.Height)
c.Initialize2(bmp)
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)
Dim Out As OutputStream
Out = File.OpenOutput(File.DirInternal, "Screenshot.png", False)
bmp.WriteToStream(Out, 100, "PNG")
Out.Close
ToastMessageShow("Screenshot Captured", False)
But this code takes a cropped screenshot. It does not include the title and status bar. Also I am used a tabbed application, so it does not take a photo of the tabs either.