Method GetResizedImageBox
GetResizedImageBox(int, int, int)
Resizes the image to fit within the specified box, adding padding with the given background color to preserve aspect ratio.
public ImageBuffer GetResizedImageBox(int targetWidth, int targetHeight, int backgroundColor)
Parameters
targetWidth
intThe width of the bounding box in pixels.
targetHeight
intThe height of the bounding box in pixels.
backgroundColor
intThe ARGB background color used for padding.
Returns
- ImageBuffer
A new ImageBuffer containing the resized and padded image.
Exceptions
- InvalidOperationException
Thrown if the image resizing operation fails.