[英]How to save Bitmap to .tiff in Android?
I know it is possible to save bitmap to png or jpg 我知道可以将位图保存为png或jpg
now i want to save bitmap to .tiff,anybody can help? 现在我想将位图保存到.tiff,有人可以帮忙吗?
I believe this is is a repost from here: Convert a bitmap image to an uncompressed tif image in Java 我相信这是从这里进行的转贴:在Java中将位图图像转换为未压缩的tif图像
To answer the question, the above answer suggested the following using the Java Advanced Imaging (JAI) library: 为了回答这个问题,以上答案建议使用Java Advanced Imaging(JAI)库进行以下操作:
TIFFImageWriterSpi spi = new TIFFImageWriterSpi();
ImageWriter writer = spi.createWriterInstance();
ImageWriteParam param = writer.getDefaultWriteParam();
param.setCompressionMode(ImageWriteParam.MODE_DISABLED);
ImageOutputStream ios = ImageIO.createImageOutputStream(new File("output.tif"));
writer.setOutput(ios);
writer.write(null, new IIOImage(bmp, null, null), param);
您始终可以将位图另存为.png
并将其转换为.tiff
Android hasn't support for tiff images. Android不支持tiff图像。 You should use some library for working with tiff.
您应该使用一些库来处理tiff。 For example my: https://github.com/Beyka/Android-TiffBitmapFactory
例如我的: https : //github.com/Beyka/Android-TiffBitmapFactory
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.