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.graphics.Canvas;
import android.graphics.Rect;

public class Main {
    public static int drawIn(Canvas canvas, Bitmap bitmap, Rect display, int x) {
        if (bitmap != null) {
            Rect source = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
            display = new Rect(display.left + x, display.top + x, display.right - x, display.bottom - x);
            canvas.drawBitmap(bitmap, source, display, null);
            return x + display.width();
        }
        return 0;
    }
}