且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法在 Android 应用程序中导入 javax.imageio.ImageIO

更新时间:2023-10-10 22:01:22

您已使用 Android 标记了您的问题.javax.imageio.ImageIO 不是 Android 平台的一部分,所以很遗憾你不能使用它.相反,您需要使用 Android SDK 中的可用内容来读取和存储图像.

You have tagged your question with Android. javax.imageio.ImageIO is not part of the Android platform, so unfortunately you can't use it. Instead you need to use what's available in the Android SDK for reading and storing images.

看看位图BitmapFactory 类作为起点.

这些类包含读取(BitmapFactory.decode*(...) 方法)和写入(Bitmap.compress(...) 方法)的必要方法.

These classes contains the necessary methods to read (BitmapFactory.decode*(...) methods) and write (Bitmap.compress(...) method).