Skip to content

Commit

Permalink
Fix featurecat#870 (saveImage for jpg and bmp)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiraoka committed Feb 12, 2021
1 parent 1aefbf2 commit 2a336fa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/featurecat/lizzie/gui/BoardPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,11 @@ public void saveImage() {
return;
}
}
// Never use ARGB here for supporting JPG!
// (cf.)
// https://stackoverflow.com/questions/57673051/writing-jpg-or-jpeg-image-with-imageio-write-does-not-create-image-file
BufferedImage bImg =
new BufferedImage(this.getWidth(), this.getHeight(), BufferedImage.TYPE_INT_ARGB);
new BufferedImage(this.getWidth(), this.getHeight(), BufferedImage.TYPE_INT_RGB);
Graphics2D cg = bImg.createGraphics();
paintAll(cg);
try {
Expand Down

0 comments on commit 2a336fa

Please sign in to comment.