If you are experiencing an issue please mention the full platform your issue applies to:
IDE: NetBeans/Eclipse/IDEA NetBeans 8.2
Desktop OS Windows
Simulator latest
Device PC
In Java, I can retrieve byte [] from Image with this code. However ImageIo class in codename1 does not support a write method.
public byte[] getBytesFromImage(java.awt.Image image) {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
try {
ImageIO.write((RenderedImage) image, "jpeg", stream);
} catch (Exception e) {
e.printStackTrace();
}
return stream.toByteArray();
}
Can you please advise an alternate codename1 method to convert a com.codename1.ui.Image in memory to a byte array?