Android Paint

Paint  画笔

setAntiAlias  //设置画笔的锯齿效果

setColor    //设置画笔颜色

setARGB       //设置argb值

setAlpha       //设置画笔的alpha值

setTextSize     //设置字体的尺寸

setStyle       //设置画笔的风格  Style.FILL 填充,Style.STROKE//空心

setStrokeWidth    //设置空心边框的宽度



Canvas  画布

drawPoint(x,y,paint)//画点

drawLine(startX,startY,endX,endY,paint)//画线

float[] pts=new {startx0,starty0,endx0,endy0,startxn,startyn,start...};

drawLines(pts);//画多条线

drawRect(left,top,right,bottom,paint);//画矩形

drawRoundRect(left,top,right,bottom,radiusX,radiusY,paint);//画圆角矩形

drawCircle(circleX,circleY,radius,paint);//画圆

//画弧形

paint.setStyle(Paint.Style.STROKE);

drawArc(left,top,right,bottom,startAngle,sweepAngle,useCenter,paint);

//绘制椭圆

drawOval(left,top,right,bottom,paint);

//绘制文本

drawText(text,startX,startY,paint);

drawPosText(text,new float[]{x1,y1,x2,y2,....xn,yn},paint);

//绘制路径

Path path=new Path();

path.moveTo(50,50);

drawPath(path,paint);





你可能感兴趣的:(android,画图)