2013年5月20日

解析画布的clipRect方法

摘要: 画布的clipRect方法,boolean android.graphics.Canvas.clipRect(int left, int top, int right, int bottom) 在看clipRect方法之前先看看如果将res目录下的图片文件转换为bitmap对象,这里总结了两种方法,大家可以参考使用, 第一种方法,采用BitmapDrawable, //得到Resources... 阅读全文

posted @ 2013-05-20 15:17 勤修 阅读(9654) 评论(0) 推荐(0) 编辑

使用android画布的save()和restore()方法

摘要: 在调用画布的save()方法之后,可以对画布进行平移、旋转等操作, 然后再将需要画的内容draw到画布上去, 最后再调用restore()方法,恢复到调用save()方法之前的状态。 1 public class SubView extends TextView { 2 3 public SubView(Context context, AttributeSet attrs) {... 阅读全文

posted @ 2013-05-20 14:30 勤修 阅读(4163) 评论(0) 推荐(0) 编辑

导航