1、Rect类和RectF类 
参考资料:http://byandby.iteye.com/blog/826230 
管方文档:Rect 类: http://developer.android.com/reference/android/graphics/Rect.html 
RectF类:http://developer.android.com/reference/android/graphics/RectF.html

RectF和Rect都表示的是一个矩形的区域,他们的构造方法类似,详细请看官方文档,这里以RectF为例,如下: 
RectF() :构造一个无参的矩形;

RectF(float left,float top,float right,float bottom)构造一个指定了4个参数的矩形 ,这些参数都是坐标,即矩形的宽width = right - left ,高height = bottom - top;如下图所示 
RectF rectF = new RectF(150,75,260,120); 

150指的是矩形区域左上角的横坐标,即A; 
75指的是矩形区域左上角的纵坐标,即B; 
260指的是矩形区域右下角的横坐标,即C; 
120指的是矩形区域右下角的纵坐标,即D;

RectF(Rect F r)根据指定的RectF对象来构造一个RectF对象(对象的左边坐标不变) 。

RectF(Rect r)根据给定的Rect对象来构造一个RectF对象。

这就是RectF的功能了,Rect 也具有这个功能。两者的区别在于: 
RectF 中的参数是单精度浮点型的; 
Rect 中的参数是整形的。

2、Matrix 
参考资料:http://blog.163.com/lww2626@126/blog/static/27384067201192564628645

http://www.cnblogs.com/plokmju/p/android_Matrix.html#MatrixRotate

http://blog.csdn.net/programchangesworld/article/details/49078387

3、Paint 画笔

参考资料:http://www.cnblogs.com/-OYK/archive/2011/10/25/2223624.html

参数官方API解释:

public RectF (float left, float top, float right, float bottom)

Added in  API level 1

Create a new rectangle with the specified coordinates. Note: no range checking is performed, so the caller must ensure that left <= right and top <= bottom.

Parameters
left The X coordinate of the left side of the rectangle
top The Y coordinate of the top of the rectangle
right The X coordinate of the right side of the rectangle
bottom The Y coordinate of the bottom of the rectangle

百度翻译一下:

用指定坐标创建新矩形。注意:没有进行范围检查,所以调用者必须确保,左<=右和顶部<=底部。

左边矩形的x坐标
矩形顶部的y坐标
右边矩形的x坐标

矩形底部y坐标

更多相关文章

  1. android 坐标布局 AbsoluteLayout
  2. Android(安卓)自定义 View 理论基础
  3. Android(安卓)matrix偏移(平移),旋转,缩放,倾斜的原理
  4. 切换Activity时的动画overridePendingTransition(A,B)解析
  5. 十二、Android(安卓)UI开发专题
  6. 【自定义控件系列四】android绘制实战(一)通过Canvas+Path+Paint
  7. Android(安卓)屏幕(View)坐标系统
  8. android 自定义相机 取矩形内内容 注意事项
  9. Android高手进阶教程(三)之----Android(安卓)中自定义View的应用

随机推荐

  1. Android实现计算器布局(四种布局方式)之Lin
  2. Android高手速成--第三部分 优秀项目
  3. 移植Android3.0 SDK到freescale imx51_bb
  4. Android-屏幕元素层次结构
  5. Android(安卓)Display System Surface Fl
  6. Android(安卓)监听ContentProvider中数据
  7. Android(安卓)ImageView的scaleType属性
  8. Android访问本机ip
  9. 梦幻曲:Android系统启动
  10. 设置透明背景的Listview和选中状态