Bitmap: get png encoded data implementation

This commit is contained in:
Longri
2016-07-17 21:21:58 +02:00
committed by Emux
parent fab7020d3d
commit 44b40608f6
5 changed files with 37 additions and 0 deletions

View File

@@ -189,6 +189,13 @@ public class IosBitmap implements Bitmap {
return this.cgBitmapContext != null;
}
@Override
public byte[] getPngEncodedData() {
UIImage uiImage = new UIImage(cgBitmapContext.toImage());
NSData data = uiImage.toPNGData();
return data.getBytes();
}
/**
* Returns a ByteArray from InputStream