com.siemens.mp.lcdui
Class Image

java.lang.Object
  extended bycom.siemens.mp.misc.NativeMem
      extended bycom.siemens.mp.ui.Image
          extended bycom.siemens.mp.lcdui.Image

public class Image
extends Image

Siemens LCDUI API provides an improved implementation of the javax.microedition.lcdui.Image class.
This is currently only available on MC60! For all other phones pleas use com.siemens.mp.ui.Image!


Field Summary
 
Fields inherited from class com.siemens.mp.ui.Image
COLOR_BMP_8BIT
 
Method Summary
static Image createImageFromFile(String filename, boolean ScaleToFullScreen)
          Create an image from a PNG/JPG/GIF/BMP file.
static Image createImageFromFile(String filename, int ScaleToWidth, int ScaleToHeight)
          Create an image from a PNG/JPG/GIF/BMP file.
static int getPixelColor(Image image, int x, int y)
          Gets the current pixel color.
static void setPixelColor(Image image, int x, int y, int color)
          Sets the color of a pixel.
static void writeBmpToFile(Image image, String filename)
          write an image to a BMP picture file
 
Methods inherited from class com.siemens.mp.ui.Image
createImageFromBitmap, createImageWithoutScaling, createImageWithScaling, createRGBImage, createTransparentImageFromBitmap, getHeight, getNativeImage, getWidth, mirrorImageHorizontally, mirrorImageVertically, setNativeImage
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

writeBmpToFile

public static void writeBmpToFile(Image image,
                                  String filename)
                           throws IOException
write an image to a BMP picture file

Parameters:
image - the image to export to BMP file
filename - path and file name to write to
Throws:
IOException - in case of I/O problems

createImageFromFile

public static Image createImageFromFile(String filename,
                                        boolean ScaleToFullScreen)
                                 throws IOException
Create an image from a PNG/JPG/GIF/BMP file. The image can be scaled to fit into full screen. If the input is of type JPG, the image will be dithered to achieve best possible photo reproduction.

Parameters:
filename - path and file name to read from
ScaleToFullScreen - set to true to scale to the screen size. Note that the aspect ratio of image may change.
Returns:
the new image
Throws:
IOException - in case of I/O problems

createImageFromFile

public static Image createImageFromFile(String filename,
                                        int ScaleToWidth,
                                        int ScaleToHeight)
                                 throws IOException
Create an image from a PNG/JPG/GIF/BMP file. The image will be scaled if ScaleToWidth and/or ScaleToHeight is greater than zero. If the input is of type JPG, the image will be dithered to achieve best possible photo reproduction.

Parameters:
filename - path and file name to read from
ScaleToWidth - set to the desired size or 0.
ScaleToHeight - set to the desired size or 0.
Returns:
the new image
Throws:
IOException - in case of I/O problems

getPixelColor

public static int getPixelColor(Image image,
                                int x,
                                int y)
                         throws IllegalArgumentException
Gets the current pixel color. The value returned must be interpreted with the least significant eight bits giving the blue component, the next eight more significant bits giving the green component, and the next eight more significant bits giving the red component.

Parameters:
image - the image
x - the x coordinate of the pixel
y - the y coordinate of the pixel
Returns:
an integer in form 0xAARRGGBB
Throws:
IllegalArgumentException - if x or y are out of the image

setPixelColor

public static void setPixelColor(Image image,
                                 int x,
                                 int y,
                                 int color)
                          throws IllegalArgumentException
Sets the color of a pixel. The ARGB value passed in is interpreted with the least significant eight bits giving the blue component, the next eight more significant bits giving the green component, and the next eight more significant bits giving the red component. The high-order byte of the ARGB format specifies opacity; that is, 0x00RRGGBB specifies a fully transparent pixel and 0xFFRRGGBB specifies a fully opaque pixel.

Parameters:
image - the image
x - the x coordinate of the pixel
y - the y coordinate of the pixel
color - the color to set, an integer in form 0xAARRGGBB
Throws:
IllegalArgumentException - if x or y are out of the image


Generated on 2003-10-17For further information and updates, please visit Siemens mobile Developer Portal