ImagePacker imagePacker = ImagePacker.create();
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
ImagePacker.PackingOptions packingOptions = new ImagePacker.PackingOptions();
imagePacker.initializePacking(byteArrayOutputStream, packingOptions);
imagePacker.addImage(pixelMap);
imagePacker.finalizePacking();
byte[] bytes = byteArrayOutputStream.toByteArray();
String base64String=Base64.getEncoder().encodeToString(bytes);
harmony--PixelMap转Base64
最新推荐文章于 2024-08-20 13:13:17 发布