登录
首页 » Android » Android 使用Matrix.postRotate方法旋转图片

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

于 2022-03-14 发布 文件大小:32.93 kB
0 173
下载积分: 2 下载次数: 1

代码说明:

Android图像操作一例,使用Matrix.postRotate方法旋转图片,这些的图片格式是BMP,其它格式可能也能用吧,没测试,旋转BMP图片的效果如截图所示,用户单击向左或向右按钮后,图片旋转90度,旋转角度根据自己需要自定义。旋转方法主要是使用Matrix.postRotate,旋转的过程保持图片原有的比例,实现思路,以向左旋转图片为例:   程序刚运行,加载默认的Drawable ,设置维持的图像比例,ScaleTimes=1,维持1:1的宽高比例,使用Matrix.postScale设置维度 ,使用Matrix.postRotate方法旋转Bitmap,然后再创建新的Bitmap对象。   向右旋转则与此相似,具体实现请下载源码包。

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 安卓蓝牙连接
    这是一款基于蓝牙连接的安卓程序,可以让新手迅速上手安卓蓝牙的开发。通过导入到Eclipse中可以快速的查看到陌生类和方法的API,从而可以快速了解到安卓拉亚的连接,通过socket发送和接受信息。
    2023-04-30 06:40:04下载
    积分:1
  • 书城
    自己的图书商店 自己的图书商店 自己的图书商店 自己的图书商店 自己的图书商店 自己的图书商店 自己的图书商店 自己的图书商店 自己的图书商店 自己的图书商店 自己的图书商店 自己的图书商店 自己的图书商店 自己的图书商店 自己的图书商店 自己的图书商店 自己的图书商店 自己的图书商店
    2022-02-01 23:36:03下载
    积分:1
  • 换肤框架源码
    支持在线换肤,按照指定的格式进行生成皮肤包即可,包括对于代码中的图片及样式的调整,整个app的色调也可以更换
    2023-01-26 04:55:16下载
    积分:1
  • android 异步 执行 任务 例子 附讲解
    Rules::The AsyncTask instance must be created in UI thread. .execute must be invoked on the UI thread.Never call  objMyTask.onPreExecute(), objMyTask.doInBackground(), objMyTask.onProgressUpdate(),  objMyTask.onPostExecute manually.The AsyncTask can be executed only once (an exception will be thrown if a second execution is attempted.)AsyncTask have Four Main Method... onPreExecute()  doInBackground() onProgressUpdate() onPostExecute()  onPreExecute-This method is called first when you start AsyncTask using objAsync.execute().And mostly this method is use for initializing dialog(ProgressDialog,CustomDialog) and showing. doInBackground-The main purpose of AsyncTask is accomplished by this method.Any non-UI thread process is running in this method.Such as Rss Feed Reader,Image and video Uploading and Downloading.You cant handle your View in this method.Because this method is non-UI thread.While any background process is running if you want to handle UI therea are  onProgressUpdate method. after completion of process this method send result to OnPostExecute. onProgressUpdate-While backgrounding task is running ,you can handle your UI using this method .Such as status of downloading or uploading task.and this method is called from  doInBackground.Using publishProgress() you can call onProgressUpdate method to update UI while process is running. onPostExecute -This method is called after the background computation finishes.The result of background process in passed in this method as parameters.And now you can dismiss progress dialog ,to indicate that background task is completed. You can cancel AsyncTask using objAsyncTask.cancel().then you just check in doInBackground, if (isCancelled()) { break; } else {        //continue... } See this Image For more Clear.
    2013-07-05下载
    积分:1
  • Android通讯录
    【实例简介】本APP主要实现联系人信息的本地存取,同时兼具打电话和发短信的功能。 对于想学习Android开发的初学者非常有参考价值!
    2021-08-07 00:30:51下载
    积分:1
  • autojs支付宝自动偷能量
    autojs支付宝自动偷能量
    2020-11-04下载
    积分:1
  • 基于Android的家庭物联网应用
            基于Android开发客户端,使用J2EE模拟物联网关,通过Andriod平台移动终端为用户提供友好操作界面,对家用电器及家具安防设施进行智能远程监视与控制。移动终端主要功能有:1、 空调控制器:空调控制器主要功能是发起开启、关闭空调设备,调节空调温度,以及显示空调当前设置温度。 2、 热水器控制器:热水器控制器主要功能是发起开启、关闭热水器设
    2023-06-18 14:25:07下载
    积分:1
  • Android 网络编程详解 Socket编程实例
    Android 4.0网络编程详解一书第7章中的一个实例:Android中的Socket编程,这是该例子的源代码,涉及到以下的技术要点:线程池、监听端口、存放断点数据、创建线程池,池中具有(cpu个数*50)条线程、启动服务、为支持多用户并发访问,采用线程池管理每一个用户的连接请求。。。
    2022-07-06 15:17:06下载
    积分:1
  • java 飞翔的小鸟 小游戏示例源码
    java基础编写的飞翔的小鸟
    2017-12-26下载
    积分:1
  • 高级定制Android WebView
    应用背景这个项目是一个HTML的应用程序运行时,建立在开源的基础上,扩展了Web平台的新功能。该网络平台已经有很多优势,从易云服务集成到灵活的用户界面元素。最近,该平台已经变得更加有吸引力,其重点是移动性能和设备的接口。然而,对于许多开发人员来说,基本的功能仍然缺少,使得它很难通过网络,因为它是今天。有了这个项目,这种情况发生了变化。通过使用这个项目,应用程序开发人员可以:使用所有功能在现代Web浏览器的HTML5,CSS3,JavaScript可用。获取最新推荐和新兴网络标准。关键技术我使用人行横道的框架,是世界级的减少了碎片,WebCL:图形加速,SIMD:并行执行
    2022-07-04 16:01:11下载
    积分:1
  • 696516资源总数
  • 106409会员总数
  • 8今日下载