@Override
protected void onDraw(Canvas canvas) {
// TODO Auto-generated method stub
super.onDraw(canvas);
canvas.drawColor(Color.WHITE); //设置画布颜色
paint.setColor(Color.BLACK); //设置画笔颜色 ,画笔颜色必须用的是graphyis;
paint.setStrokeWidth((float) 5.0); //设置画笔颜色宽度
paint.setAntiAlias(true); //设置不带锯齿
float startx=0,starty=0,stopx,stopy;
canvas.drawLine(startx, starty, stopx, stopy, paint);//画线
}
时间: 2024-10-08 20:46:07