Palm API
Beta 2

com.sun.kjava
Class Bitmap

java.lang.Object
  |
  +--com.sun.kjava.Bitmap

public class Bitmap
extends java.lang.Object

An object of this class represents a black and white bitmap.


Constructor Summary
Bitmap(short[] data)
          Constructor to create a bitmap.
Bitmap(short width, byte[] pixels)
          Constructor defines the bitmap.
 
Method Summary
 int getRows()
          Return the number of rows in the bitmap.
 int getWidth()
          Return the width of the space in pixels used to display the bitmap.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Bitmap

public Bitmap(short[] data)
Constructor to create a bitmap. The array is the exact representation of a bitmap in the Palm OS including the headers and flags.
Parameters:
data - The Palm OS representation of a bitmap.

Bitmap

public Bitmap(short width,
              byte[] pixels)
Constructor defines the bitmap. The bits of a bitmap are given as an array of bytes, each byte defining 8 bits of the bitmap.

On the Palm OS, the width (in bytes) must be even. If a bitmap is constructed with an odd width, padding is automatically added. It is padded width that is given by a call to getWidth. The maximum width for a bitmap on this platform is currently 32.

Parameters:
width - the width of the bitmap in bytes.
pixels - the bits of the object.
Method Detail

getWidth

public int getWidth()
Return the width of the space in pixels used to display the bitmap. This will be a multiple of 16 and so may not correspond with the width specified when constructing the bitmap.
Returns:
the width of the space in pixels used to display the bitmap.

getRows

public int getRows()
Return the number of rows in the bitmap.
Returns:
the number of rows in the bitmap

Submit a bug or feature

The GUI classes provided with this release are NOT part of CLDC, and they will be removed in later releases of this software. Official GUI classes for Java 2 Micro Edition will be defined separately through the Java Community Process and included in J2ME profiles. Java is trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2000 Sun Microsystems, Inc.
901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
All Rights Reserved.