1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package javax.microedition.lcdui;
25 import java.io.IOException;
26 import org.microemu.device.DeviceFactory;
27
28
29 public class Image
30 {
31
32
33
34
35
36
37 public static Image createImage(int width, int height)
38 {
39 if (width <= 0 || height <= 0) {
40 throw new IllegalArgumentException();
41 }
42 return DeviceFactory.getDevice().getDeviceDisplay().createImage(width, height);
43 }
44
45 public static Image createImage(String name) throws IOException
46 {
47 return DeviceFactory.getDevice().getDeviceDisplay().createImage(name);
48 }
49
50 public static Image createImage(Image source)
51 {
52 return DeviceFactory.getDevice().getDeviceDisplay().createImage(source);
53 }
54
55 public static Image createImage(byte[] imageData, int imageOffset, int imageLength)
56 {
57 return DeviceFactory.getDevice().getDeviceDisplay().createImage(imageData, imageOffset, imageLength);
58 }
59
60 public Graphics getGraphics()
61 {
62 throw new IllegalStateException("Image is immutable");
63 }
64
65 public int getHeight()
66 {
67 return 0;
68 }
69
70 public int getWidth()
71 {
72 return 0;
73 }
74
75 public boolean isMutable()
76 {
77 return false;
78 }
79
80
81
82
83 public void getRGB(int []argb, int offset, int scanlenght,
84 int x, int y, int width, int height) {
85
86 }
87
88 public static Image createImage(java.io.InputStream stream) throws IOException {
89 return DeviceFactory.getDevice().getDeviceDisplay().createImage(stream);
90 }
91
92 public static Image createImage(Image image, int x, int y,
93 int width, int height, int transform) {
94 return DeviceFactory.getDevice().getDeviceDisplay().createImage(
95 image, x, y, width, height, transform);
96 }
97
98 public static Image createRGBImage(int[] rgb, int width, int height,
99 boolean processAlpha) {
100 return DeviceFactory.getDevice().getDeviceDisplay().createRGBImage(rgb,
101 width, height, processAlpha);
102 }
103
104 }