UOCL-244: receipts added to main code base

This commit is contained in:
2023-10-05 12:17:20 +01:00
parent 1174c0ccd6
commit 9497d52428
2 changed files with 12 additions and 1 deletions
@@ -117,11 +117,14 @@ public abstract class BasicTicket implements PrintItem {
for(Iterator i$ = this.m_aCommands.iterator(); i$.hasNext(); currenty += pi.getHeight()) {
pi = (PrintItem)i$.next();
if (pi instanceof PrintItemImage) {
((PrintItemImage) pi).setImage(negative(((PrintItemImage) pi).getImage()));
}
pi.draw(g2d, x, currenty, width);
}
try {
ImageIO.write(this.negative(image), "png", new File(System.getProperty("user.home") + "/test.png"));
ImageIO.write(this.negative(image), "png", new File(System.getProperty("user.home") + "/receipt.png"));
}
catch (Exception e) {
System.out.println("Error serialising receipt image !!! : " + e);
@@ -70,4 +70,12 @@ public class PrintItemImage implements PrintItem {
public int getHeight() {
return (int) (image.getHeight() * scale);
}
public BufferedImage getImage() {
return image;
}
public void setImage(BufferedImage image) {
this.image = image;
}
}