public void paint(SwtGraphics gc) { synchronized (this) { if (displayImage != null) { gc.drawImage(displayImage.img, 0, 0); } } }
private void drawImageInShape(SwtGraphics g, Image image, org.microemu.device.impl.Shape shape) { org.eclipse.swt.graphics.Rectangle clipSave = g.getClipping(); if (shape instanceof org.microemu.device.impl.Polygon) { // TODO not implemented yet // g.setCliping(region); } org.microemu.device.impl.Rectangle r = shape.getBounds(); g.drawImage(image, r.x, r.y, r.width, r.height, r.x, r.y, r.width, r.height); g.setClipping(clipSave); }
public void drawImage(Image img, int x, int y, int anchor) { int newx = x; int newy = y; if (anchor == 0) { anchor = javax.microedition.lcdui.Graphics.TOP | javax.microedition.lcdui.Graphics.LEFT; } if ((anchor & javax.microedition.lcdui.Graphics.RIGHT) != 0) { newx -= img.getWidth(); } else if ((anchor & javax.microedition.lcdui.Graphics.HCENTER) != 0) { newx -= img.getWidth() / 2; } if ((anchor & javax.microedition.lcdui.Graphics.BOTTOM) != 0) { newy -= img.getHeight(); } else if ((anchor & javax.microedition.lcdui.Graphics.VCENTER) != 0) { newy -= img.getHeight() / 2; } if (img.isMutable()) { g.drawImage(((SwtMutableImage) img).getImage(), newx, newy); } else { g.drawImage(((SwtImmutableImage) img).getImage(), newx, newy); } }
g.drawImage(((SwtImmutableImage) mode123Image.getImage()).getImage(), mode123Image.getRectangle().x, mode123Image.getRectangle().y); } else if (inputMode == InputMethod.INPUT_ABC_UPPER) { g.drawImage(((SwtImmutableImage) modeAbcUpperImage.getImage()).getImage(), modeAbcUpperImage.getRectangle().x, modeAbcUpperImage.getRectangle().y); } else if (inputMode == InputMethod.INPUT_ABC_LOWER) { g.drawImage(((SwtImmutableImage) modeAbcLowerImage.getImage()).getImage(), modeAbcLowerImage.getRectangle().x, modeAbcLowerImage.getRectangle().y);
Device device = DeviceFactory.getDevice(); gc.drawImage(((SwtImmutableImage) device.getNormalImage()).getImage() , 0, 0); rect = prevOverButton.getShape().getBounds(); if (rect != null) { gc.drawImage(((SwtImmutableImage) DeviceFactory.getDevice().getNormalImage()).getImage(), rect.x, rect.y, rect.width, rect.height, rect.x, rect.y, rect.width, rect.height); rect = overButton.getShape().getBounds(); if (rect != null) { gc.drawImage(((SwtImmutableImage) DeviceFactory.getDevice().getOverImage()).getImage(), rect.x, rect.y, rect.width, rect.height, rect.x, rect.y, rect.width, rect.height); rect = pressedButton.getShape().getBounds(); if (rect != null) { gc.drawImage(((SwtImmutableImage) DeviceFactory.getDevice().getPressedImage()).getImage(), rect.x, rect.y, rect.width, rect.height, rect.x, rect.y, rect.width, rect.height);