Android Paint画笔及Color .
引自:http://blog.csdn.net/q445697127/article/details/7736926
Paint paint = new Paint();
// 设置paint为无锯齿
paint.setAntiAlias(true);
// 设置颜色
paint.setColor(Color.RED);
// 设置颜色
paint.setColor(Color.rgb(255, 0, 0));
// 设置透明度
paint.setAlpha(256);
// 提取颜色
Color.red(0xcccccc);
// 设置为另一个paint对象
paint.set(new Paint());
// 设置字体尺寸
paint.setTextSize(14);
// 空心 Paint.Style.FILL 实心
paint.setStyle(Paint.Style.STROKE);
// 空心外框宽度
paint.setStrokeWidth(5);
// 空心矩形
canvas.drawRect((320 - 80) / 2, 20, (320 - 80) / 2 + 80, 20 + 40, paint);
// 实心
paint.setStyle(Paint.Style.FILL);
// 实心矩形
canvas.drawRect(0, 20, 40, 20 + 40, paint);
color
Color.BLACK:// 黑色 Color.BLUE:// 蓝色 Color.CYAN:// 青绿色 Color.DKGRAY:// 灰黑色 Color.YELLOW:// 黄色 Color.GRAY:// 灰色 Color.GREEN:// 绿色 Color.LTGRAY:// 浅灰色 Color.MAGENTA:// 红紫色 Color.RED:// 红色 Color.WHITE:// 白色 Color.TRANSPARENT:// 透明
Android Paint画笔及Color .的更多相关文章
- 【读书笔记《Android游戏编程之从零开始》】13.游戏开发基础(Paint 画笔)
1.Paint画笔 Panit(画笔)是绘图额辅助类,其类中包含文字和位图额样式.颜色等属性信息.Paint 的常用方法如下: setAntiAlias(boolean aa) 作用:设置画笔是否无锯 ...
- Android Paint的使用以及方法介绍(附源码下载)
要绘图,首先得调整画笔,待画笔调整好之后,再将图像绘制到画布上,这样才可以显示在手机屏幕上.Android 中的画笔是 Paint类,Paint 中包含了很多方法对其属性进行设置,主要方法如下: se ...
- Android ---paint类
引自:http://www.cnblogs.com/-OYK/archive/2011/10/25/2223624.html Android Paint和Color类 要绘图,首先得调整画笔,待画 ...
- 【转】Android Paint之 setXfermode PorterDuffXfermode 讲解
[置顶] Android Paint之 setXfermode PorterDuffXfermode 讲解 分类: android动效篇2015-04-07 17:23 978人阅读 评论(8) 收藏 ...
- 自定义控件详解(四):Paint 画笔路径效果
Paint 画笔 ,即用来绘制图形的"笔" 前面我们知道了Paint的一些基本用法: paint.setAntiAlias(true);//抗锯齿功能 paint.setColo ...
- Android Paint和Color类绘画实例
要绘图,首先得调整画笔,待画笔调整好之后,再将图像绘制到画布上,这样才可以显示在手机屏幕上.Android 中的画笔是 Paint类,Paint 中包含了很多方法对其属性进行设置,主要方法如下: se ...
- Android Paint和Color类
要绘图,首先得调整画笔,待画笔调整好之后,再将图像绘制到画布上,这样才可以显示在手机屏幕上.Android 中的画笔是 Paint类,Paint 中包含了很多方法对其属性进行设置,主要方法如下: se ...
- Android -----paint cap join 理解 ,paint画笔形状设置
引自:http://www.2cto.com/kf/201501/370215.html 网上查了很多资料,对paint的里面的枚举类cap join讲的不是很透彻.在这里自己做一个比较深入的研究. ...
- Android Paint、Canvas、Matrix使用讲解(一、Paint)
http://blog.csdn.net/tianjian4592/article/details/44336949 好了,前面主要讲了Animation,Animator 的使用,以及桌面火箭效果和 ...
随机推荐
- Servie之前台Service
public class MyService extends Service { public static final String TAG = "MyService"; pri ...
- 您可能无法使用服务器管理器,如果两个线程同时访问 IIS 管理 IIS 的修补程序
http://support.microsoft.com/kb/946517 如果多线程操作 win2003 iis 失败, 打上这个补丁就好了
- python常用函数年初大总结
1.常用内置函数:(不用import就可以直接使用) help(obj) 在线帮助, obj可是任何类型 callable(obj) 查看一个obj是不是可以像函数一样调用 repr(obj) 得到o ...
- cPanel 安装方法
. 如何安装cPanel/WHM? 答:安装过程较长,建议使用screen或nohupscreen: yum -y install screen perl screen -S cpanel cd /h ...
- how to add a shared lib in C?
http://www.cprogramming.com/tutorial/shared-libraries-linux-gcc.html Basically, 2 steps: 1) make the ...
- 自己写的select元素可编辑、可筛选JQuery插件 jquery.inputselectbox.js
/* 功能:实现对select下拉框可输入的功能, 输入时会对下拉框的内容进行动态过滤. 参数:没有选择任何值时默认显示的文字 如何使用:$("#firstLevel").inpu ...
- could not perform addBatch
在执行存数据到数据库的操作时,由于增加的ID值小于或等于对应的索引值时会报这个错误
- 循环ip段 转载 出处不明
public struct IP { public byte A; public byte B; public ...
- MySQL数据库分区修改【原创】
之前有个表分区添加时s201607添加成s201617,所以在查询7月份数据时报错 错误的 alter table statistics_ticket add partition (partition ...
- JSP基本语法--实例演练
基本语法概括:<%@page>,<%@include>,<jsp:include>,<jsp:forward> 加上数据库操作,可以开发动态web了. ...