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

public class Main {
    public static void drawImage(Canvas canvas, Paint paint, Bitmap bitmap, float x, float y, float r) {
        canvas.save();
        Path path = new Path();
        path.addCircle(x, y, r, Path.Direction.CCW);
        canvas.clipPath(path);
        canvas.drawBitmap(bitmap, x - r, y - r, paint);
        canvas.restore();
    }
}