B4X:
Sub Activity_Pause (UserClosed As Boolean)
Camera1.StopPreview
Camera1.Release
End Sub
Sub Activity_Resume
Camera1.Initialize(pnlCamera,"Camera1")
End Sub
Sub Camera1_Ready (Success As Boolean)
If Success Then
Camera1.PictureSize(640,480)
Camera1.OriPortrait
Camera1.StartPreview
Else
ToastMessageShow("Cannot open camera.", True)
End If
End Sub
Sub btnTakePhoto_Click
If chkFlash.Checked Then
Camera1.FlashOn
Else
Camera1.FlashOff
End If
Camera1.TakePicture
End Sub
Sub Camera1_PictureTaken (Data() As Byte)
pnlCapture.Visible=False
Camera1.StartPreview
Dim Bm As Bitmap
Bm.Initialize3 (Camera1.rotateBitmap2(Data,90))
Dim Out As OutputStream
Out = File.OpenOutput (File.DirInternalCache ,"cache.jpg",False)
Bm.WriteToStream(Out,75,"JPEG")
'.........and more picture code
End Sub
If the flash is not used in this code the program runs fine. If the flash is enabled (anywhere) in the code then the Camera1_PictureTaken event does not fire.... there is no exception.... the event simply does not fire.
Any ideas?