use of javax.microedition.lcdui.Image in project qrcode by yanbe.
the class J2MEImage method drawPolygon.
public void drawPolygon(Point[] points, int color) {
Image bufImage = Image.createImage(image.getWidth(), image.getHeight());
Graphics g = bufImage.getGraphics();
g.drawImage(image, 0, 0, 0);
g.setColor(color);
int i = 0;
for (; i < points.length - 1; i++) {
g.drawLine(points[i].getX(), points[i].getY(), points[i + 1].getX(), points[i + 1].getY());
}
g.drawLine(points[i].getX(), points[i].getY(), points[0].getX(), points[0].getY());
image = bufImage;
repaint();
}
use of javax.microedition.lcdui.Image in project qrcode by yanbe.
the class J2MEImage method drawCross.
public void drawCross(Point point, int color) {
Image bufImage = Image.createImage(image.getWidth(), image.getHeight());
Graphics g = bufImage.getGraphics();
g.drawImage(image, 0, 0, 0);
g.setColor(color);
g.drawLine(point.getX() - 5, point.getY(), point.getX() + 5, point.getY());
g.drawLine(point.getX(), point.getY() - 5, point.getX(), point.getY() + 5);
image = bufImage;
repaint();
}
Aggregations