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.Paint;

public class Main {
    public static Bitmap changeBitmapColor(Bitmap bmp, int color) {
        Bitmap b = Bitmap.createBitmap(bmp.getWidth(), bmp.getHeight(), bmp.getConfig());
        Canvas canvas = new Canvas(b);
        Paint paint = new Paint();
        paint.setColor(color);
        paint.setAntiAlias(true);
        canvas.drawBitmap(bmp, bmp.getWidth(), bmp.getHeight(), paint);
        return b;
    }
}