view中path的使用
来源:互联网 发布:手绘图片是什么软件 编辑:程序博客网 时间:2024/06/05 13:39
Path mPath = new Path();
1,Path.Direction.CCW和 Path.Direction.CW
Path.Direction.CW表示顺时针
Path.Direction.CCW表示逆时针
2 lineTo moveTo
在lineTo表示轨迹运动点 moveTo表示轨迹运动起点
在path画图中,如果不设置moveTo系统默认在(0,0)
设置moveTo
mPath.moveTo(20,40);
mPath.lineTo(30,80);
canvas.drawPath(mPath, mPaint);
不设置moveTo
mPath.lineTo(30,80);
canvas.drawPath(mPath, mPaint);
3,贝塞尔曲线
3.1path.quadTo(float x1, float y1, float x2, float y2)
float x1表示操作的起点x轴坐标
float y1表示操作起始点y轴坐标
float x2 表示操作结束点x轴坐标
float y2 表示操作结束点y轴坐标
mPath.moveTo(20,40);
mPath.quadTo(30,20,50,60);
canvas.drawPath(mPath, mPaint);
3.2 rCubicTo(float x1, float y1, float x2, float y2,
float x3, float y3)
float x2, float y2, 同样表示操作起点
4矩形
addRect(float left, float top, float right, float bottom, Direction dir)
left 左边坐标 x
top 上边坐标值 y
right 右边坐标值 x
bottom 底部坐标值 y
dir 画图方向 看第一条介绍,两个枚举值
mPath.addRect(30,30,90,90, Path.Direction.CCW);
canvas.drawPath(mPath, mPaint);
5 圆角矩形
addRoundRect(float left, float top, float right, float bottom, float rx, float ry,Direction dir) 注 这个要求sdk最低版本呢是21
向下兼容要使用
addRoundRect(RectF rect, float rx, float ry, Direction dir)
mPath.addRoundRect(new RectF(30,30,90,90),5,5, Path.Direction.CCW);
- view中path的使用
- gdi中path的使用
- spring的配置文件中mvc:view-controller path使用方法
- spring的配置文件中mvc:view-controller path使用方法
- spring的配置文件中mvc:view-controller path使用方法
- spring的配置文件中mvc:view-controller path使用方法
- spring的配置文件中mvc:view-controller path使用方法
- spring的配置文件中mvc:view-controller path使用方法
- Android 自定义View——Path的使用
- Android 自定义View——Path的使用
- <mvc:view-controller path="" view-name=""/>这个的具体使用
- UNIX中环境变量PATH的使用
- VB 中App.Path的使用
- WPF 中Path路径的使用示例
- Android中Path类的使用
- Android中Path类的使用
- sqlserver中FOR XML PATH 的使用
- android中Path类的使用
- Memcached 与 Redis 实现的对比(上)
- 解决Ajax请求跨域问题
- 如何使用sourcetree
- navicat for Mysql查询数据不能直接修改
- HTTP中Get和Post的区别
- view中path的使用
- zabbix 自动部署
- org.apache.hadoop.ipc.Client: Retrying connect to server: localhost/127.0.0.1:7359. Already tried 7
- 智慧北京:顶部图片的加载
- Spring MVC的请求
- C#设计模式- 观察者模式(1)
- frame访问、设置简化
- 团队在Github上协同开发项目流程
- 发送E-mail