Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.graphics.Bitmap;

public class Main {
    public static Bitmap getImageThumbnail(Bitmap input) {
        int desiredWidth = 500;
        Float width = new Float(input.getWidth());
        Float height = new Float(input.getHeight());
        Float ratio = width / height;
        return Bitmap.createScaledBitmap(input, (int) (desiredWidth * ratio), desiredWidth, false);
    }
}