Android 使用Matrix.postRotate方法旋转图片.rar

时间:2022-07-30 06:26:13
【文件属性】:
文件名称:Android 使用Matrix.postRotate方法旋转图片.rar
文件大小:33KB
文件格式:RAR
更新时间:2022-07-30 06:26:13
Android源码-图像处理 Android图像操作一例,使用Matrix.postRotate方法旋转图片,这些的图片格式是BMP,其它格式可能也能用吧,没测试,旋转BMP图片的效果如截图所示,用户单击向左或向右按钮后,图片旋转90度,旋转角度根据自己需要自定义。旋转方法主要是使用Matrix.postRotate,旋转的过程保持图片原有的比例,实现思路,以向左旋转图片为例:   程序刚运行,加载默认的Drawable ,设置维持的图像比例,ScaleTimes=1,维持1:1的宽高比例,使用Matrix.postScale设置维度 ,使用Matrix.postRotate方法旋转Bitmap,然后再创建新的Bitmap对象。   向右旋转则与此相似,具体实现请下载源码包。
【文件预览】:
codesc.net
----xuanzhuan()
--------.project(845B)
--------src()
--------AndroidManifest.xml(635B)
--------res()
--------.settings()
--------gen()
--------default.properties(384B)
--------.classpath(280B)

网友评论