BitmapData
Inheritance: java.lang.Object
public final class BitmapData
Specifies the attributes of a bitmap image. The BitmapData class is used by the E:Bitmap.LockBits
and M:Bitmap.UnlockBits(BitmapData)
methods of the Bitmap class. Not inheritable.
Constructors
Constructor | Description |
---|---|
BitmapData() |
Methods
Method | Description |
---|---|
getWidth() | Gets the pixel width of the Bitmap object. |
setWidth(int value) | Sets the pixel width of the Bitmap object. |
getHeight() | Gets the pixel height of the Bitmap object. |
setHeight(int value) | Sets the pixel height of the Bitmap object. |
getStride() | Gets the stride width (also called scan width) of the Bitmap object. |
setStride(int value) | Sets the stride width (also called scan width) of the Bitmap object. |
getPixelFormat() | Gets the format of the pixel information in the Bitmap object that returned this BitmapData object. |
setPixelFormat(int value) | Sets the format of the pixel information in the Bitmap object that returned this BitmapData object. |
getScan0() | Gets the address of the first pixel data in the bitmap. |
setScan0(int[] value) | Sets the address of the first pixel data in the bitmap. |
BitmapData()
public BitmapData()
getWidth()
public int getWidth()
Gets the pixel width of the Bitmap object. This can also be thought of as the number of pixels in one scan line.
Returns: int - The pixel width of the Bitmap object.
setWidth(int value)
public void setWidth(int value)
Sets the pixel width of the Bitmap object. This can also be thought of as the number of pixels in one scan line.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int | the pixel width of the Bitmap object. |
getHeight()
public int getHeight()
Gets the pixel height of the Bitmap object. Also sometimes referred to as the number of scan lines.
Returns: int - The pixel height of the Bitmap object.
setHeight(int value)
public void setHeight(int value)
Sets the pixel height of the Bitmap object. Also sometimes referred to as the number of scan lines.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int | the pixel height of the Bitmap object. |
getStride()
public int getStride()
Gets the stride width (also called scan width) of the Bitmap object.
Returns: int - The stride width, in bytes, of the Bitmap object.
setStride(int value)
public void setStride(int value)
Sets the stride width (also called scan width) of the Bitmap object.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int | the stride width (also called scan width) of the Bitmap object. |
getPixelFormat()
public int getPixelFormat()
Gets the format of the pixel information in the Bitmap object that returned this BitmapData object.
Returns:
int - A PixelFormat
(.getPixelFormat/.setPixelFormat(int)) that specifies the format of the pixel information in the associated Bitmap object.
setPixelFormat(int value)
public void setPixelFormat(int value)
Sets the format of the pixel information in the Bitmap object that returned this BitmapData object.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int | the format of the pixel information in the Bitmap object that returned this BitmapData object. |
getScan0()
public int[] getScan0()
Gets the address of the first pixel data in the bitmap. This can also be thought of as the first scan line in the bitmap.
Returns: int[] - The address of the first pixel data in the bitmap.
setScan0(int[] value)
public void setScan0(int[] value)
Sets the address of the first pixel data in the bitmap. This can also be thought of as the first scan line in the bitmap.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int[] | the address of the first pixel data in the bitmap. |