Hello. I want to make a simple application that captures the mobile screen and saves the capture in a jpg file. I have searched but I have not found anything. Is there a way to do it?
B4A B4XPages ScreenRecorder - version 0.7 (25/09/2016) 25/01/2021 - Updated the sample app to use SDK29, foreground services, and also wrote it as a B4XPages app. There are no changes to the library. Here is a wrapper/library which lets you record the screen and save it as a video file. It...
I already looked at the link, but it is for recording video. I suppose this information will be useful to me later. I am looking for something that takes a screenshot and saves it to a jpg file.
Even though I copied the library to the B4A library folder, I tried to compile the example without modifying anything, but it does not compile.
I checked the code, but I didn't find anything about how to take a screenshot. I must have overlooked it.
Sub Tomar_ScreenShot
Dim lcView As B4XView = Activity
Dim lcScreenShot As Bitmap = lcView.Snapshot
Dim Out As OutputStream
Dim lcFileName As String = Starter.wceNombreEncuesta & ".png"
Out = File.OpenOutput(File.DirDefaultExternal, lcFileName, False)
lcScreenShot.WriteToStream(Out, 100, "PNG")
Out.Close
End Sub
Sub Tomar_ScreenShot
Dim lcView As B4XView = Activity
Dim lcScreenShot As Bitmap = lcView.Snapshot
Dim Out As OutputStream
Dim lcFileName As String = Starter.wceNombreEncuesta & ".png"
Out = File.OpenOutput(File.DirDefaultExternal, lcFileName, False)
lcScreenShot.WriteToStream(Out, 100, "PNG")
Out.Close
End Sub