Android Canvas Draw drawSelect(Bitmap bm, int x, int y, int cellWidth, int cellHeight)

Here you can find the source of drawSelect(Bitmap bm, int x, int y, int cellWidth, int cellHeight)

Description

draw Select

Declaration

public static void drawSelect(Bitmap bm, int x, int y, int cellWidth,
            int cellHeight) 

Method Source Code

//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);
    }
}

Related

  1. drawCross(Bitmap bm, int x, int y)
  2. drawText(String strMsg, Canvas g, Paint paint, int setx, int sety, int fg, int bg)
  3. drawTextAtCanvasCenter(Canvas canvas, Paint paint, String text)
  4. circle(Canvas canvas, int color, int stroke, float x, float y, float radius)
  5. rect(Canvas canvas, int color, int stroke, float x, float y, float width, float height)