mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
minor image update
This commit is contained in:
Binary file not shown.
@@ -145,15 +145,16 @@ public class Image extends AbstractTransparentComponent<Void> {
|
|||||||
|
|
||||||
public ImageIcon getImage() {
|
public ImageIcon getImage() {
|
||||||
if (image != null) {
|
if (image != null) {
|
||||||
|
// when loading old files, convert the stored image to byte array and then then discard it, we won't be needing it anymore
|
||||||
BufferedImage bi = ((ToolkitImage) image.getImage()).getBufferedImage();
|
BufferedImage bi = ((ToolkitImage) image.getImage()).getBufferedImage();
|
||||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||||
try {
|
try {
|
||||||
ImageIO.write(bi, "png", baos);
|
ImageIO.write(bi, "png", baos);
|
||||||
} catch (IOException e) {
|
// make it official
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
data = baos.toByteArray();
|
data = baos.toByteArray();
|
||||||
|
} catch (IOException e) {
|
||||||
|
}
|
||||||
|
// don't save back to the file
|
||||||
image = null;
|
image = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user