Android Question how can i take picture and show data in imageview without save as bitmap?

tango

Active Member
Licensed User
Longtime User
how can i take picture and show data in imageview without save as bitmap?
 

TILogistic

Expert
Licensed User
Longtime User
see example:


B4XImageView1.Bitmap = RotateJpegIfNeeded(bmp, Data)
B4X:
Sub TakePicture
    Try
        SetState(openstate, True, VideoMode)
        Wait For(cam.FocusAndTakePicture(MyTaskIndex)) Complete (Data() As Byte)
        SetState(openstate, False, VideoMode)
        cam.DataToFile(Data, VideoFileDir, "1.jpg")
        Dim bmp As Bitmap = cam.DataToBitmap(Data)
        Log("Picture taken: " & bmp) 'ignore
        pnlBackground.SetVisibleAnimated(100, True)
        B4XImageView1.Bitmap = RotateJpegIfNeeded(bmp, Data)
        Sleep(4000)
        pnlBackground.SetVisibleAnimated(500, False)
    Catch
        HandleError(LastException)
    End Try
   
End Sub
 
Upvote 1

TILogistic

Expert
Licensed User
Longtime User
 
Upvote 1
Top