public Point computeSize(int wHint, int hHint, boolean changed) { javax.microedition.lcdui.Image tmp = DeviceFactory.getDevice().getNormalImage(); return new Point(tmp.getWidth(), tmp.getHeight()); }
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(((J2SEMutableImage) img).getImage(), newx, newy, null); } else { g.drawImage(((J2SEImmutableImage) img).getImage(), newx, newy, null); } }
} else { width = device.getNormalImage().getWidth(); height = device.getNormalImage().getHeight();
if (x_src + width > src.getWidth() || y_src + height > src.getHeight() || width < 0 || height < 0 || x_src < 0 || y_src < 0) { throw new IllegalArgumentException("Area out of Image");
public Dimension getPreferredSize() { Device device = DeviceFactory.getDevice(); if (device == null) { return new Dimension(0, 0); } DeviceDisplayImpl deviceDisplay = (DeviceDisplayImpl) DeviceFactory.getDevice().getDeviceDisplay(); if (deviceDisplay.isResizable()) { return new Dimension(deviceDisplay.getFullWidth(), deviceDisplay.getFullHeight()); } else { javax.microedition.lcdui.Image img = device.getNormalImage(); return new Dimension(img.getWidth(), img.getHeight()); } }
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); } }
throw new NullPointerException(); if (x + width > image.getWidth() || y + height > image.getHeight() || width <= 0 || height <= 0 || x < 0 || y < 0) { throw new IllegalArgumentException("Area out of Image");
public Image createImage(Image image, int x, int y, int width, int height, int transform) { if (image == null) throw new NullPointerException(); if (x + width > image.getWidth() || y + height > image.getHeight() || width <= 0 || height <= 0 || x < 0 || y < 0) throw new IllegalArgumentException("Area out of Image");
resize(device.getDeviceDisplay().getFullWidth(), device.getDeviceDisplay().getFullHeight()); } else { resize(device.getNormalImage().getWidth(), device.getNormalImage().getHeight());