Android Question Resize an image

Discussion in 'Android Questions' started by ttsolution, Feb 9, 2015.

  1. ttsolution

    ttsolution Member Licensed User

    Dear all,

    How can we resize an image taking from phone camera to a smaller size ?
    for example: after taking the image, if the image size > 1MB then I want to resize to 1MB only.

    many thanks for any help

  2. KZero

    KZero Active Member Licensed User

    try this code to resize the image

    you will need to enable "Refliction" Library

    Sub CreateScaledBitmap(Original As Bitmap, Width As Int, Height As Int) As Bitmap
    Dim r As Reflector
    Dim Filter As Boolean =False
    Dim b As Bitmap
        b = r.RunStaticMethod(
    """createScaledBitmap", _
    Array As Object(Original, Width, Height, Filter), _
    Array As String("""""""java.lang.boolean"))
    Return b
    End Sub
  3. ttsolution

    ttsolution Member Licensed User

    It's works.

    Thanks Kzero
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice