Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Bitmap.Config;

public class Main {
    public static int BACKGROUND_COLOR = Color.argb(255, 128, 128, 128);

    public static Bitmap drawEmptyBackground(int size) {
        Bitmap bitmap = Bitmap.createBitmap(size, size, Config.RGB_565);
        Canvas cv = new Canvas(bitmap);

        Paint background = new Paint();
        background.setColor(BACKGROUND_COLOR);
        cv.drawRect(0, 0, size, size, background);
        return bitmap;
    }
}