2012.10.08 安卓游戏开发笔记(十二)_Bitmaps的位图渲染于操作
来源:互联网 发布:腾讯视频 for mac 编辑:程序博客网 时间:2024/06/05 06:30
Bitmaps:
1) 位图的获取:采用位图工厂
Bitmap bit = BitmapFactory.decodeResource(this.getResources(), R.drawable.ic_launcher);
2) 位图的绘制:canvas.drawBitmap();函数绘制位图
3) 位图的旋转,分为两种: 1> 使用save()和restore()旋转画布实现
canvas.save();canvas.rotate(30, bit.getWidth()/2, bit.getHeight()/2);canvas.drawBitmap(bit, 0, 0, paint);canvas.restore();canvas.drawBitmap(bit, 100, 0, paint);2>使用Matrix矩阵实现
Matrix matrix = new Matrix();matrix.postRotate(30, bit.getWidth(), bit.getHeight());canvas.drawBitmap(bit, matrix, paint);4) 位图的平移1> canvas.translate(); new Matrix().posttranslate();
5) 位图的缩放1>canvas.scale(floate x,float y,float px,float py),前两个分别对画布x,y的缩放比例,后两个为缩放的坐标 ;2>new Matrix().postscale();(先使用translate)同上
6) 位图的镜像 只是把scale中参数作为修改第一个参数-1为x轴的镜像,第二个参数-1为y轴方向的镜像;
- 2012.10.08 安卓游戏开发笔记(十二)_Bitmaps的位图渲染于操作
- 2012.10.07 安卓游戏开发笔记(十二)_SurfaceView视图
- Android游戏开发基础part4--Bitmap位图的渲染与操作
- 【读书笔记《Android游戏编程之从零开始》】14.游戏开发基础(Bitmap 位图的渲染与操作)
- Bitmap 位图的渲染与操作
- 游戏开发学习笔记(十二)快捷键的使用
- Bitmap位图渲染与操作
- 安卓随手笔记:十二(app的安装方式)
- Android中Bitmap位图的渲染与操作
- 矢量图本质是渲染器+矢量数据;不存在于“位图”等同的“矢量图”实体
- 2012.9.12 安卓游戏开发笔记(一)_Button
- 2012.9.13 安卓游戏开发笔记(二)_ImageButton
- 2012.9.14 安卓游戏开发笔记(三)_EditText&CheckBox
- 2012.9.15 安卓游戏开发笔记(四)_RadioButton
- 2012.9.16 安卓游戏开发笔记(五)_ProgressBar&SeekBar
- 2012.9.17 安卓游戏开发笔记(六)_TabHost*TabSpec
- 2012.9.19 安卓游戏开发笔记(七)_ListView_ArrayAdapter
- 2012.9.22 安卓游戏开发笔记(八)_ListView_SimpleAdapter
- const的一点总结
- int A[nSize],其中隐藏着若干0,其余非0整数,写一个函数int Func(int* A, int nSize),使A把0移至后面,非0整数移至数组前面并保持有序
- Biker's Trip Odomete
- Software Code Areas【1009】-每日一译
- Substring子序列
- 2012.10.08 安卓游戏开发笔记(十二)_Bitmaps的位图渲染于操作
- linux chkconfig命令参数及用法详解
- 几种打开新页面传递参数的例子
- tar命令
- gcc 编译及动态库和静态库
- 从电脑版页面获取新闻正文html代码
- xml解析比较
- C语言编码风格(一)——缩进和空白
- C语言知识点总结