如何在android中调整原始图像的大小

发布于 2024-10-10 19:05:59 字数 120 浏览 0 评论 0原文

我正在处理图像,上传原始图像在此原始图像中调整该图像保存到数据库

原始图像中的小图像的大小 -->调整大小(小图)-->小图像保存到数据库中,

请转发解决方案

,谢谢

i am working on image ,upload original image in this original image resize the small image this image saved in to database

original image --> resize it (small image )--> small image saved in to database

please forward solution

thanks

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最冷一天 2024-10-17 19:05:59

为此,您需要使用 Bitmap 类。

它有几个函数可以从以前的位图创建新的位图,

Bitmap bmp2 = Bitmap.createScaledBitmap(bmp, width, height, true);

完整列表可以在文档中找到:

http://developer.android.com/reference/android/graphics/Bitmap.html

关于保存到数据库我从未做过,但这取决于您的服务器。

To do this you'll want to play around with the Bitmap class.

It has several functions to create new bitmaps form previous ones

Bitmap bmp2 = Bitmap.createScaledBitmap(bmp, width, height, true);

a full list can be found in the documentation :

http://developer.android.com/reference/android/graphics/Bitmap.html

Regarding the save to a database I've never done but it would depend on your server.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文