Android无需复制即可旋转位图

Android无需复制即可旋转位图,第1张

概述有没有办法旋转位图而不复制它?或者也许是持有位图的imageview?现在我有类似的东西: Bitmap bm = BitmapFactory.decodeFile(...// get the orientationMatrix m = new Matrixm.postRotate(orientation)Bitmap new = Bitmap.createFromBitmap(bm, . 有没有办法旋转位图而不复制它?或者也许是持有位图的imagevIEw?现在我有类似的东西:

Bitmap bm = BitmapFactory.decodefile(...// get the orIEntationMatrix m = new Matrixm.postRotate(orIEntation)Bitmap new = Bitmap.createFromBitmap(bm,...,m);
解决方法 实际上算法并不是一种简单的方法来执行此旋转,而没有完全独立的新位置来放置旋转的副本,然后删除当前(非旋转的)副本.我可以想到一个潜在的算法,你基本上必须有一个像素的内存,但我将花费更多的时间来计算实际的算法.

另请查看此StackOverflow链接:
Algorithm to rotate an image 90 degrees in place? (No extra memory)

总结

以上是内存溢出为你收集整理的Android无需复制即可旋转位图全部内容,希望文章能够帮你解决Android无需复制即可旋转位图所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1124534.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-30
下一篇2022-05-30

发表评论

登录后才能评论

评论列表(0条)

    保存