rgbData
in a format with 24
bits of RGB and an eight-bit alpha value (0xAARRGGBB
), with the first value stored at the specified offset. The scanlength
specifies the relative offset within the array between the corresponding pixels of consecutive rows. Any value for scanlength
is acceptable (even negative values) provided that all resulting references are within the bounds of the rgbData
array. The ARGB data is rasterized horizontally from left to right within each row. The ARGB values are rendered in the region specified by x
, y
, width
and height
, and the operation is subject to the current clip region and translation for this Graphics
object. Consider P(a,b)
to be the value of the pixel located at column a
and row b
of the Image, where rows and columns are numbered downward from the top starting at zero, and columns are numbered rightward from the left starting at zero. This operation can then be defined as:
|
for
|
This capability is provided in the Graphics
class so that it can be used to render both to the screen and to offscreen Image
objects. The ability to retrieve ARGB values is provided by the {@link Image#getRGB}method.
If processAlpha
is true
, 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. Intermediate alpha values specify semitransparency. If the implementation does not support alpha blending for image rendering operations, it must remove any semitransparency from the source data prior to performing any rendering. (See Alpha Processing for further discussion.) If processAlpha
is false
, the alpha values are ignored and all pixels must be treated as completely opaque.
The mapping from ARGB values to the device-dependent pixels is platform-specific and may require significant computation.
@param rgbData an array of ARGB values in the format0xAARRGGBB
@param offset the array index of the first ARGB value
@param scanlength the relative array offset between thecorresponding pixels in consecutive rows in the rgbData
array
@param x the horizontal location of the region to be rendered
@param y the vertical location of the region to be rendered
@param width the width of the region to be rendered
@param height the height of the region to be rendered
@param processAlpha true
if rgbData
has an alpha channel, false if all pixels are fully opaque
@throws ArrayIndexOutOfBoundsException if the requested operationwill attempt to access an element of rgbData
whose index is either negative or beyond its length
@throws NullPointerException if rgbData
is null
|
|
|
|