Android系列之手机多点触摸画圆
来源:互联网 发布:员工培训档案软件 编辑:程序博客网 时间:2024/06/06 01:38
1、先写个实体类,代表圆
- public class MyCircle {
- public float x;
- public float y;
- public int r=100;
- public int pointId;
- int red;
- int green;
- int blue;
- Random random=new Random();
- public MyCircle(float x, float y, int pointId) {
- this.x = x;
- this.y = y;
- this.pointId = pointId;
- red=random.nextInt(255);
- green=random.nextInt(255);
- blue=random.nextInt(255);
- }
- public void drawSelf(Canvas canvas, Paint paint){
- paint.setStyle(Paint.Style.STROKE);
- paint.setColor(Color.rgb(red,green,blue));
- canvas.drawCircle(x,y,r,paint);
- }
- }
最后我们在MainaActivity中改一句代码就可以了
- setContentView(new MyView(this));
阅读全文
0 0
- Android系列之手机多点触摸画圆
- Android系列之手机多点触摸画圆
- Android手机检测多点触摸
- 19.实现多点触摸画圆(拖动+检测手机多点触摸的点数+随机颜色)
- Android 实现多点触摸画圆
- Android使用多点触摸画圆
- 多点触摸画圆
- 多点触摸画圆
- Android 检测手机多点触摸点数
- Android-检测手机多点触摸点数
- Android-检测手机多点触摸点数
- Android—检测手机多点触摸点数
- 测试手机多点触摸
- 检测手机多点触摸
- Android游戏开发之单点触摸与多点触摸
- Android-单点触摸-多点触摸
- 检测手机多点触摸数
- 检测手机多点触摸事件
- 通过C语言实现猜数字游戏
- div盒子大小总结
- 重看android(二) android启动
- 【软工学习】第八章——面向对象基础知识
- Kotlin-37.类型别名(typealias)
- Android系列之手机多点触摸画圆
- 【C++泛读总结】
- delphi aes加密
- 【LeetCode-面试算法经典-Java实现】【所有题目目录索引】
- 字符串编码
- python学习(12)——面向对象编程
- 【C++泛读总结】
- 使用ThinkPHP框架快速搭建网站
- Window编程之旅(五)