Android Canvas Draw drawText(String strMsg, Canvas g, Paint paint, int setx, int sety, int fg, int bg)

Here you can find the source of drawText(String strMsg, Canvas g, Paint paint, int setx, int sety, int fg, int bg)

Description

draw Text

Declaration

public static void drawText(String strMsg, Canvas g, Paint paint,
            int setx, int sety, int fg, int bg) 

Method Source Code

//package com.java2s;

import android.graphics.Canvas;

import android.graphics.Paint;

public class Main {
    public static void drawText(String strMsg, Canvas g, Paint paint,
            int setx, int sety, int fg, int bg) {
        paint.setColor(bg);//  w  ww.  j a  v a 2  s  .  c  o m
        g.drawText(strMsg, setx + 1, sety, paint);
        g.drawText(strMsg, setx, sety - 1, paint);
        g.drawText(strMsg, setx, sety + 1, paint);
        g.drawText(strMsg, setx - 1, sety, paint);
        paint.setColor(fg);
        g.drawText(strMsg, setx, sety, paint);
        g.restore();

    }
}

Related

  1. drawCross(Bitmap bm, int x, int y)
  2. drawSelect(Bitmap bm, int x, int y, int cellWidth, int cellHeight)
  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)
  6. add(Bitmap firstlayer, Bitmap secondlayer)