Another very random question I know! I'm looking for a way to show a camera preview on two separate panels within my application... is this possible? I've been taking a look at libraries and come up with nothing. Even if I could just somehow get one panel to mirror what was on the other panel that would work... Thanks a ton in advance
Your only option is to handle the Camera_Preview event and then convert the preview data to Jpeg image (see CameraEx class) and show it on the second panel. The FPS of the second panel will be lower than the rate of the panel connected to the camera.
Thanks Erel That's roughly what I'm doing (except loading the same BMP into both panels to avoid difference in FPS). I think there must be some way to do it more smoothly though as I've seen it in a couple of other camera apps. I will check out the reflection library. Anyone got any pointers on where to start there?
This is the code I'm currently using (Camera22 is initialized to a panel way off screen). Is this the fastest way to do it? Thanks again for your help, this is a v exciting project I'm working on currently
B4X:
Sub Camera22_Preview (PreviewPic() As Byte)
Dim jpeg() As Byte = camera22.PreviewImageToJpeg(PreviewPic, 20)
Dim In As InputStream
In.InitializeFromBytesArray(jpeg, 0, jpeg.Length)
Dim bmp As Bitmap
bmp.Initialize2(In)
In.Close
camera2panel.SetBackgroundImage(bmp)
camera1panel.SetBackgroundImage(bmp)
End Sub