COLUMNWISE_MONOCHROME

public static final int COLUMNWISE_MONOCHROME

Deprecated.use a rowwise format and then perform a rotation.

Columnwise, monochrome bitmap type.

This bitmap type stores data in pixel wide columns in
successive bytes. Each bit in a byte is a pixel value: 0 is white and 1 is
black. Uppermost pixels are in the less significant bits within a byte,
and lower numbered bytes contain the uppermost pixels within a column.

ROWWISE_MONOCHROME

public static final int ROWWISE_MONOCHROME

Deprecated.

Rowwise, monochrome bitmap type.

This bitmap type stores data in rows, with 1 bit per pixel.
A 0 is black and 1 is white.
Each row is a multiple of 4 bytes. Leftmost pixels
are in the less significant bits within a byte, and lower numbered bytes
contain the leftmost pixels within a row.

TRUE_BLACK

FILTER_LANCZOS

public static final int FILTER_LANCZOS

Lanczos interpolation filter.

Lanczos interpolation is considered to give best image quality,
but it is slower then Bitmap.FILTER_BOX and Bitmap.FILTER_BILINEAR.
Lanczos interpolation produces the sharpest images, but may also
introduce some ringing artifacts.

SCALE_TO_FIT

public static final int SCALE_TO_FIT

This bitmap scaling option marks that scaling is done with preserving
the aspect ratio. The source bitmap is fit to the dimensions of the
destination bitmap and a part of destination bitmap remains unchanged.

SCALE_TO_FILL

public static final int SCALE_TO_FILL

This bitmap scaling option marks that scaling is done with preserving
the aspect ratio. The source bitmap fills the destination bitmap
completely and outstanding parts of the source bitmap are not copied
to the destination bitmap.

Bitmap

public Bitmap(int type,
int width,
int height,
byte[] data)

Constructs a new bitmap of a specific type from existing data.

Note that this method makes a copy of your provided bitmap data.

This method requires that the provided data be consistent with the
specified bitmap type and dimensions. This includes any necessary padding
to ensure that stride breaks occur on DWORD (4-byte) boundaries.

Parameters:

type - Type of this bitmap.

width - Width of this bitmap.

height - Height of this bitmap.

data - Data from which to build this bitmap.

Throws:

IllegalArgumentException - Thrown if the length of the data array is
incorrect, the width or height are invalid, or the type is invalid.

The interpolation is required to eliminate blocky appearance of rescaled bitmap due
to change in the number of pixels and hence the digital sampling rate. Interpolation
resamples digital data removing blocky appearance. There are three filters available
for use with bitmap scaling methods:

Bitmap.FILTER_LANCZOS - Lanczos interpolation is considered to give best image quality, but it is the slowest
out the other three interpolation algorithms. Lanczos interpolation produces the sharpest
images, but may also introduce some ringing artifacts.

Bitmap.FILTER_BILINEAR - Bilinear filter produces good results for image reduction and enlargement,
but displays sharp transition lines. Very fast computation. This filter is popular
in rendering of the previews.

Visual result of each filter looks different when applied to various types of images.
Therefore, it is up to the user to choose suitable interpolation and make speed vs. quality trade off.

SCALE_TO_FIT – With this option the aspect ratio is preserved. In case the
source and the output bitmaps have different aspect ratios the scale is
MIN((height_out/height_in), (width_out/width_in)). In other words, it will scale
to match the smallest destination dimension (height or width). The source bitmap
data is rendered in the center of the output bitmap. The source bitmap is fit to
the dimensions of the destination bitmap and a part of destination bitmap remains
unchanged.

SCALE_TO_FILL – With this option the aspect ratio is preserved. In case the
source and the output bitmaps have different aspect ratios the scale is
MAX((height_out/height_in), (width_out/width_in)). In other words, it will scale
to match the largest destination dimension (height or width). The source bitmap
fills the destination bitmap completely and outstanding parts of the source bitmap
are not copied to the destination bitmap.

Since:

BlackBerry API 5.0.0

scaleInto

Scales the rectangular area in this bitmap and stores the result in the rectangular area in the
provided bitmap. If "copy" or "paste" areas exceed boundaries of the source or destination bitmaps
they are automatically cut to the boundaries.

Parameters:

srcLeft - X coordinate of the top left corner of the area to be copied from the source bitmap.

srcTop - Y coordinate of the top left corner of the area to be copied from the source bitmap.

The interpolation is required to eliminate blocky appearance of rescaled bitmap due to change
in the number of pixels and hence the digital sample rate. Interpolation resamples digital data
removing blocky appearance.

Lanczos interpolation is considered to give best image quality, but it is the slowest out the
other three interpolation algorithms. Lanczos interpolation produces the sharpest images, but may
also introduce some ringing artifacts.

getBitmapResource

This method looks for the resource in both the .cod file that called this
method and any .cod files that it relies on. The resource files are automatically generated by the compiler
when a new graphic (PNG, GIF, or, JPG) is added to a project.

Parameters:

module - Name of the module containing the bitmap resource. If
not specified, the name of the calling module is used.

name - Name of the bitmap resource.

Returns:

New Bitmap object, or null if this method couldn't find your
named resource.

getBitmapResource

This method looks for the resource in both the .cod file that called this
method and any .cod files that it relies on. The resource files are automatically generated by the compiler
when a new graphic (PNG, GIF, or, JPG) is added to a project.

Parameters:

name - Name of the bitmap resource.

Returns:

New Bitmap object, or null if this method couldn't find your
named resource.