Hello Guys,
I am trying to capture a screen shot from a video playing in a VideoView. This video is paused and on screen. The code I am using was from Agrahams post. It saves anything on the screen just fine other than a VideoView. The VideoView is saved, it's just a black image. The same thing happens when doing a screen shot from the B4A IDE. Hoping someone will know a way to mod the code so it will get the VideoView Image. Didn't know if the VideoView could be set as the Target?
Thanks,
Margret
I am trying to capture a screen shot from a video playing in a VideoView. This video is paused and on screen. The code I am using was from Agrahams post. It saves anything on the screen just fine other than a VideoView. The VideoView is saved, it's just a black image. The same thing happens when doing a screen shot from the B4A IDE. Hoping someone will know a way to mod the code so it will get the VideoView Image. Didn't know if the VideoView could be set as the Target?
B4X:
Sub ScreenShot2(my_fn As String)
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
namevar = s.Left(my_fn, s.Len(my_fn)-3) & "jpg"
Out = File.OpenOutput("/Removable/MicroSD/My Files/Videos", namevar, False)
bmp.WriteToStream(out, 100, "JPEG")
Out.Close
Return
End Sub
Thanks,
Margret