"Cannot open camera"

wheretheidivides

Active Member
Licensed User
Longtime User
So I followed the tutorial on the camera and got it to work nicely. I have buttons for everything and the autofocus works. The picture is on a panel.

Now, there are 2 buttons to exit the panel and go to another one. When You do, it releases the camera. The thing is if you start and stop the camera real fast it gives the error "cannot open camera". I tried to add a button to reset the camera with

B4X:
Sub Button5053ResetCam_Click
'---------------------------------------------
'Releases camera so other applications can use it
   camEx.Release

'---------------------------------------------
'ints camera for use
   InitializeCamera 'SUBROUTINE
   
'---------------------------------------------
End Sub

Private Sub InitializeCamera
'--------------------------------------------------
   camEx.Initialize(Panel5070, frontCamera, Me, "Camera1")
   frontCamera = camEx.Front
   
'--------------------------------------------------
End Sub

but that does not work. I wanted to reset the camera and get it to work right again. I know someone has had to have this problem with a fix. Any ideas?
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…