Here you can find the source of drawSelect(Bitmap bm, int x, int y, int cellWidth, int cellHeight)
public static void drawSelect(Bitmap bm, int x, int y, int cellWidth, int cellHeight)
//package com.java2s; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Paint.Style; import android.graphics.Rect; public class Main { public static void drawSelect(Bitmap bm, int x, int y, int cellWidth, int cellHeight) { Canvas canvas = new Canvas(bm); canvas.drawColor(Color.TRANSPARENT, android.graphics.PorterDuff.Mode.CLEAR); Paint paint = new Paint(); paint.setARGB(255, 255, 0, 0);/*from w w w . j a va 2s . com*/ paint.setStyle(Style.STROKE); paint.setStrokeWidth(3f); canvas.drawRect(new Rect((x - 1) * cellWidth, (y - 1) * cellHeight, (x + 2) * cellWidth, (y + 2) * cellHeight), paint); } }