Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.graphics.Bitmap;

import android.util.Log;

public class Main {
    static public Bitmap scaleToFitHeight(Bitmap b, int height) {
        Log.e("Hieght", height + "");
        float factor = height / (float) b.getHeight();

        return Bitmap.createScaledBitmap(b, (int) (b.getWidth() * factor), height, false);

    }
}