Java tutorial
//package com.java2s; import android.graphics.Bitmap; public class Main { private static Bitmap crop(Bitmap source) { int width = source.getWidth() - 2; int height = source.getHeight() - 2; if (width <= 0 || height <= 0) { return source; } return Bitmap.createBitmap(source, 1, 1, width, height); } }