public class testView extends View {
public testView(Context context) {
super(context);
// TODO Auto-generated constructor stub
}
protected void onDraw(Canvas canvas)
{
String mstrTitle = "感受Android带给我们的新体验";
Paint p = new Paint();
p.setColor(Color.RED);
float py = this.getHeight()/4.0f;
float px = this.getWidth()/4.0f;
Matrix matrix = new Matrix();
matrix.setRotate(30,px,py);
canvas.setMatrix(matrix);
canvas.drawText(mstrTitle,0,100,p);
super.onDraw(canvas);
}
}
阅读(933) | 评论(0) | 转发(0) |