Hi guys,
Been away too long man. LOL
SNAP PICTURE:
SAVE PICTURE TO FILE:
Question is, where do I call the Sub DataToFile and WHAT to pass in parameter Data() As Byte?
Thank you
Been away too long man. LOL
SNAP PICTURE:
B4X:
Public Sub TakePictureNow (MyTaskIndex As Int) As ResumableSub
If MyTaskIndex <> TaskIndex Then Return False
Camera.AbortCaptures
Dim builder As JavaObject = Camera.CreateCaptureBuilder
Dim SensorOrientation As Int = GetFromCameraCharacteristic("SENSOR_ORIENTATION")
Dim front As Int = 1
If getIsFrontFacingCamera Then front = -1
Dim orientation As Int = (SensorOrientation + jcamera.GetField("lastKnownOrientation") * front + 360) Mod 360
CaptureSettingMap.Put("JPEG_ORIENTATION", orientation)
SetSettingsFromMap(builder, CaptureSettingMap)
Dim CaptureRequest As Object = Camera.AddCaptureRequest(builder)
If PrintKeys Then PrintAllKeys(CaptureRequest, "Capture Request")
Wait For Camera_PictureTaken (Data() As Byte)
StartPreview(MyTaskIndex, False)
Return Data
End Sub
SAVE PICTURE TO FILE:
B4X:
Public Sub DataToFile(Data() As Byte, Dir As String, FileName As String)
Dim out As OutputStream = File.OpenOutput(Dir, FileName, False)
out.WriteBytes(Data, 0, Data.Length)
out.Close
End Sub
Question is, where do I call the Sub DataToFile and WHAT to pass in parameter Data() As Byte?
Thank you