Chinaunix首页 | 论坛 | 博客
  • 博客访问: 347186
  • 博文数量: 78
  • 博客积分: 3380
  • 博客等级: 中校
  • 技术积分: 857
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-16 19:39
文章分类

全部博文(78)

文章存档

2011年(31)

2010年(47)

分类: Java

2011-02-17 14:04:31

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);  
 }
}
阅读(900) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~