- CurrentFrame As Bitmap [read only]
Returns current videoframe which can be used for screenshot.
B4X:
Sub Globals
Dim bitmap As Bitmap
Private ImageView1 As ImageView
End Sub
...............
Sub Button4_Click
ImageView1.Bitmap=vvvit5.CurrentFrame
bitmap=ImageView1.Bitmap
Dim Out As OutputStream
Out = File.OpenOutput(File.DirRootExternal, "test1.png", False)
bitmap.WriteToStream(Out, 90, "PNG")
Out.Close
End Sub
video_button4_click (java line: 455)
java.lang.RuntimeException: Object should first be initialized (Bitmap).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.WriteToStream(CanvasWrapper.java:693)
at vitamio.test.test.video._button4_click(video.java:455)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:4633)
at android.view.View$PerformClick.run(View.java:19274)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5593)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method)
java.lang.RuntimeException: Object should first be initialized (Bitmap).
hi..
this code does not work in android 4.1, 4.2, 4.4. But android works at 6, 7, 8.
I am getting such an error. I've tried a lot of methods. I could not. how can i solve the problem. Thank you.
Last edited: