Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
// Licensed under the MIT license.

import android.graphics.Bitmap;

import android.graphics.Canvas;
import android.graphics.Color;

import android.graphics.Paint;

public class Main {
    public static Bitmap highlightSelectedFaceThumbnail(Bitmap originalBitmap) {
        Bitmap bitmap = originalBitmap.copy(Bitmap.Config.ARGB_8888, true);
        Canvas canvas = new Canvas(bitmap);
        Paint paint = new Paint();
        paint.setAntiAlias(true);
        paint.setStyle(Paint.Style.STROKE);
        paint.setColor(Color.parseColor("#3399FF"));
        int stokeWidth = Math.max(originalBitmap.getWidth(), originalBitmap.getHeight()) / 10;
        if (stokeWidth == 0) {
            stokeWidth = 1;
        }
        bitmap.getWidth();
        paint.setStrokeWidth(stokeWidth);
        canvas.drawRect(0, 0, bitmap.getWidth(), bitmap.getHeight(), paint);

        return bitmap;
    }
}