//設置畫筆
Paint paint = new Paint();
//畫字String
設定顏色
paint.setColor(Color.BLACK)
paintTextA.setARGB(255, 200, 200, 200)
paint.setTextSize(45)//設定字體大小
paint.setAntiAlias(true)//無鋸齒效果
paint.setFakeBoldText(true); //true為粗體,false非粗體
paint.setTextSkewX(-0.5f); //負數表示右斜,正數左斜
paint.setUnderlineText(true); //true為下畫線,false為非下畫線
paint.setStrikeThruText(true); //true為刪除線,false非刪除線
canvas.drawText("Jacky And Justin", 150, 550, paint)
_canvas.drawColor(Color.WHITE);
//設置畫筆顏色
paint.setColor(Color.GRAY);
paint.setColor(Color.BLUE);
//畫圓
_canvas.drawCircle(160, 160, 150, paint);
//畫方
Rect rect = new Rect(100, 110, 150, 130);
_canvas.drawRect(rect, paint);
//畫圓角方
RectF rectf = new RectF(200, 110, 220, 130);
_canvas.drawRoundRect(rectf,10,10, paint);
//畫弧
RectF oval = new RectF(50, 150, 270, 250);
_canvas.drawArc(oval, 180, -180, true, paint);
//畫圓環
paint.setAntiAlias(true);
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(50);
_canvas.drawCircle(250.5f, 430.5f, 100.0f, paint);
沒有留言:
張貼留言