wip
This commit is contained in:
@@ -325,7 +325,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.unicenta</groupId>
|
<groupId>com.unicenta</groupId>
|
||||||
<artifactId>unicenta-plugins</artifactId>
|
<artifactId>unicenta-plugins</artifactId>
|
||||||
<version>1.2-SNAPSHOT</version>
|
<version>1.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.gluonhq</groupId>
|
<groupId>com.gluonhq</groupId>
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ public class StartPOS {
|
|||||||
metrics.setUniCentaVersion(AppLocal.APP_VERSION);
|
metrics.setUniCentaVersion(AppLocal.APP_VERSION);
|
||||||
Application application = new Application();
|
Application application = new Application();
|
||||||
application.postMetrics(metrics);
|
application.postMetrics(metrics);
|
||||||
application.startEventListener(host);
|
//application.startEventListener(host, jRootApp);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Problem with starting the uniCenta plugin application:${}", e.getMessage());
|
log.error("Problem with starting the uniCenta plugin application:${}", e.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,11 +96,34 @@ public abstract class BasicTicket implements PrintItem {
|
|||||||
@Override
|
@Override
|
||||||
public void draw(Graphics2D g2d, int x, int y, int width) {
|
public void draw(Graphics2D g2d, int x, int y, int width) {
|
||||||
|
|
||||||
|
BufferedImage image = new BufferedImage(width + 10, 10, 1);
|
||||||
|
g2d = image.createGraphics();
|
||||||
|
|
||||||
int currenty = y;
|
int currenty = y;
|
||||||
for (PrintItem pi : m_aCommands) {
|
for (PrintItem pi : m_aCommands) {
|
||||||
pi.draw(g2d, x, currenty, width);
|
pi.draw(g2d, x, currenty, width);
|
||||||
currenty += pi.getHeight();
|
currenty += pi.getHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
ImageIO.write(this.negative(image), "png", new File(System.getProperty("user.home") + "/test.png"));
|
||||||
|
} catch (Exception var10) {
|
||||||
|
System.out.println("Error serialising receipt image !!! : " + var10);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public BufferedImage negative(BufferedImage img) {
|
||||||
|
for(int x = 0; x < img.getWidth(); ++x) {
|
||||||
|
for(int y = 0; y < img.getHeight(); ++y) {
|
||||||
|
int RGBA = img.getRGB(x, y);
|
||||||
|
Color col = new Color(RGBA, true);
|
||||||
|
col = new Color(Math.abs(col.getRed() - 255), Math.abs(col.getGreen() - 255), Math.abs(col.getBlue() - 255));
|
||||||
|
img.setRGB(x, y, col.getRGB());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return img;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user