位图旋转失去Java的质量

发布于 2025-01-26 10:02:45 字数 420 浏览 4 评论 0原文

我正在尝试旋转一个位图映像,但是问题在于,每次旋转它时,图像都会松开质量,最后会变得模糊。

这是我的Java代码

public Bitmap rotateBitmap(Bitmap bitmap, int angle) {
    Matrix matrix = new Matrix ();
    matrix.setRotation(angle);
    Bitmap newBtmp = Bitmap.createBitmap(bitmap, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
    return newBtmp;
}

,然后我尝试将过滤器更改为false,但我仍然得到相同的结果。

请我如何在不失去质量的情况下旋转位图?

I'm trying to rotate a Bitmap image, but the problem is that the image looses quality Everytime I rotate it, and finally it gets blur.

Here's my Java code

public Bitmap rotateBitmap(Bitmap bitmap, int angle) {
    Matrix matrix = new Matrix ();
    matrix.setRotation(angle);
    Bitmap newBtmp = Bitmap.createBitmap(bitmap, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
    return newBtmp;
}

And then I tried to change thefilter to false, but I still get the same result.

Please how can I rotate a bitmap without loosing quality?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文