Android Question Saving An Image With CamEx2

MODERN TALKING

Active Member
Licensed User
Longtime User
Hi guys,

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
 

MODERN TALKING

Active Member
Licensed User
Longtime User
Ah'm beggin' Holmes - anyone, someone - please show me how to SAVE THE DARN PICTURE

LOL

"Chillin' in mah crib, sippin' on Gin 'n Juice - with a loaded clip in mah carbine
Tell me where you at. Gimme an address" ~ IRB ;)
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
Upvote 0
Top