The Size
property of the Bitmap
class provides the dimensions of the bitmap in terms of width and height. It is represented as a Vector2Int
, which contains two integer values: the width and the height of the bitmap.
The Size
property of the Bitmap
class provides the dimensions of the bitmap in terms of width and height. It is represented as a Vector2Int
, which contains two integer values: the width and the height of the bitmap.
Use the Size
property to retrieve or set the dimensions of a Bitmap
object. This property is useful when you need to know the size of the bitmap for operations such as resizing, cropping, or drawing.
// Example of accessing the Size property Bitmap bitmap = new Bitmap(); Vector2Int size = bitmap.Size; // Output the width and height int width = size.x; int height = size.y; // Set a new size bitmap.Size = new Vector2Int(1024, 768);