Vector2 Center { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Center property of the Bitmap class provides the coordinates of the center point of the bitmap. This is represented as a Vector2, which contains the X and Y coordinates of the center.

Usage

Use the Center property to quickly access the central point of a bitmap. This can be useful for operations that require centering, such as drawing or transformations.

Example

// Example of accessing the Center property of a Bitmap
Bitmap myBitmap = new Bitmap();
Vector2 centerPoint = myBitmap.Center;

// Use the centerPoint for further operations
// For example, drawing a circle at the center of the bitmap
myBitmap.DrawCircle(centerPoint, 50.0f);