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 cutBitmap(Bitmap bitmap, int tagWidth, int tagHeight) {
        if (null == bitmap) {
            return null;
        }
        Bitmap tmpBmp = Bitmap.createScaledBitmap(bitmap, tagWidth, tagHeight, false);
        return Bitmap.createBitmap(tmpBmp, 0, 0, tagWidth, tagHeight);
    }

    public static Bitmap cutBitmap(Bitmap bitmap, int size) {
        return cutBitmap(bitmap, size, size);
    }
}