Description
The InsertPadding
method is used to add padding to a bitmap. Padding is the space added around the content of the bitmap, effectively increasing its size by the specified margin values. This can be useful for creating a border or spacing around the bitmap content.
Usage
To use the InsertPadding
method, you need to provide a Sandbox.UI.Margin
object that specifies the amount of padding to add on each side of the bitmap. The margin object contains properties for the top, bottom, left, and right padding values.
Example
// Create a new Bitmap instance
Bitmap bitmap = new Bitmap();
// Define the margin to add as padding
Sandbox.UI.Margin margin = new Sandbox.UI.Margin(10, 10, 10, 10);
// Insert padding into the bitmap
bitmap.InsertPadding(margin);