com.objectxp.msg.ems
Class EMSPicture

java.lang.Object
  extended by com.objectxp.msg.ems.EMSElement
      extended by com.objectxp.msg.ems.EMSPicture
All Implemented Interfaces:
java.io.Serializable

public class EMSPicture
extends EMSElement

This class represents a EMS Picture.

Pictures are coded from upper left to lower right and in each byte the most significant bit represent the pixel at the left. The pictures are plain black and white, no colours or grey scales are supported. The bitvalue "0" represents a white pixel and the bitvalue "1" represents a black pixel.

There are three differend types of EMS pictures:

Since:
jSMS 1.7
See Also:
Serialized Form

Field Summary
static int LARGE
          Picture type: LARGE (32x32)
static int SMALL
          Picture type: SMALL (16x16)
static int VARIABLE
          Picture type: VARIABLE
 
Constructor Summary
EMSPicture(byte[] picture)
          Construct a small or large EMS Picture.
EMSPicture(byte[] picture, int width, int height)
          Construct a new variable sized EMS Picture.
EMSPicture(java.awt.Image img)
          Construct a new EMS Picture.
 
Method Summary
 java.awt.Image getImage()
           
 byte[] getImageData()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SMALL

public static final int SMALL
Picture type: SMALL (16x16)

See Also:
Constant Field Values

LARGE

public static final int LARGE
Picture type: LARGE (32x32)

See Also:
Constant Field Values

VARIABLE

public static final int VARIABLE
Picture type: VARIABLE

See Also:
Constant Field Values
Constructor Detail

EMSPicture

public EMSPicture(byte[] picture)
           throws java.lang.IllegalArgumentException
Construct a small or large EMS Picture.

Parameters:
picture - the picture data
Throws:
java.lang.IllegalArgumentException - if the picture is null or is neither a small (32 octets) or large (128 octets) picture.

EMSPicture

public EMSPicture(byte[] picture,
                  int width,
                  int height)
Construct a new variable sized EMS Picture.

The width of the picture must be a multiple of 8 pixels up to the screen width (ie. 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96).

The height of the picture may be from 1 to 255 pixels.

Note: The total product of Width and Height must never exceed 1024 pixels (128 octets).

Parameters:
picture - the picture data.
width - the width of the picture in pixels
height - the height of the picture in pixels.
Throws:
java.lang.IllegalArgumentException - if the picture is null, the picture data exceeds 128 octets or the width or height parameter has an illegal value.

EMSPicture

public EMSPicture(java.awt.Image img)
Construct a new EMS Picture. The AWT image will be transformed to a black and white picture with no gray colors.

The width of the picture must be a multiple of 8 pixels up to the screen width (ie. 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96).

The height of the picture may be from 1 to 255 pixels.

Note: The total product of Width and Height must never exceed 1024 pixels (128 octets).

Method Detail

getImage

public java.awt.Image getImage()

getImageData

public byte[] getImageData()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


object XP, Inc. © 2000-2008. All rights reserved object XP