绘制图形经常回传入left, top, right, bottom 四个参数,然后绘制出来,要明确正确概念,这里写一下了,用RectF类的构造函数参数举例说明

Android RectF类的构造函数参数说明:
以下是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

比如new一个RecF类:
绘制图形的宽
w=left -right
绘制图形的高
h=bottom -top
RectF rf1 = new RectF(100,100,200,200);
则在屏幕中的位置示意图为:

更多相关文章

  1. Jenkins构建android
  2. Android(安卓)ViewGroup中addView方法使用
  3. android 点击获取验证码显示倒计时并不可用
  4. Window窗口机制——WindowManager,ViewRootImpl,View理解
  5. android中的适配器
  6. android 自定义控件继承TextView
  7. Android下Achartengine绘制折线图
  8. 实习入职第二十天:Android(安卓)中文 API(123) —— AbsListView
  9. 动态文字闪烁效果

随机推荐

  1. Android在子线程中更新UI的方法汇总(共七
  2. android自带图片资源图标一览,android.R.d
  3. Android 使用View的旋转实现漂亮的动画效
  4. android studio 简单二维码扫描实现
  5. Android之解析Android Map地图返回的Json
  6. 基于 Android(安卓)NDK 的学习之旅-----
  7. Android架构分析之硬件抽象层(HAL)
  8. Activity has leaked window that was or
  9. Android P系统输出图像镜像翻转实现
  10. 使用logcat命令