resize image after taken picture with camera

fifiddu70

Well-Known Member
Licensed User
Longtime User
possible resize image after taken picture with camera on my device?
i use advanced camera libraries.
please helpme.
 

vb1992

Well-Known Member
Licensed User
Longtime User
Something like this, [needs reflection library]


B4X:
Sub Camera_PictureTaken2(Data() As Byte)


Dim bmp As Bitmap
Dim CamData As InputStream

CamData.InitializeFromBytesArray(data, 0, data.Length)

bmp.Initialize2(CamData)
bmp = CreateScaledBitmap(bmp,200,200,true)

end sub



Sub CreateScaledBitmap(Original As Bitmap, Width As Int, Height As Int, Filter As Boolean) As Bitmap

    Dim r As Reflector

    Dim b As Bitmap

    b = r.RunStaticMethod("android.graphics.Bitmap", "createScaledBitmap", _
        Array As Object(Original, Width, Height, Filter), _
        Array As String("android.graphics.Bitmap", "java.lang.int", "java.lang.int", "java.lang.boolean"))
    Return b


End Sub



**note that you do not have to write the photo to disk once
you take the picture like most ACL examples show in this forum

You could display this in a preview window asking the user to save it? YES/NO
 
Last edited:
Upvote 0
Top