1 2 20 21 package javax.microedition.lcdui; 22 23 import java.io.IOException; 24 25 import com.barteo.emulator.device.DeviceFactory; 26 27 28 public class Image 29 { 30 31 32 public static Image createImage(int width, int height) 33 { 34 if (width <= 0 || height <= 0) { 35 throw new IllegalArgumentException(); 36 } 37 38 return DeviceFactory.getDevice().createImage(width, height); 39 } 40 41 42 public static Image createImage(String name) 43 throws IOException 44 { 45 return DeviceFactory.getDevice().createImage(name); 46 } 47 48 49 public static Image createImage(Image source) 50 { 51 return DeviceFactory.getDevice().createImage(source); 52 } 53 54 55 public static Image createImage(byte[] imageData, int imageOffset, int imageLength) 56 { 57 return DeviceFactory.getDevice().createImage(imageData, imageOffset, imageLength); 58 } 59 60 61 public Graphics getGraphics() 62 { 63 throw new IllegalStateException("Image is immutable"); 64 } 65 66 67 public int getHeight() 68 { 69 return 0; 70 } 71 72 73 public int getWidth() 74 { 75 return 0; 76 } 77 78 79 public boolean isMutable() 80 { 81 return false; 82 } 83 84 } 85 | Popular Tags |