Table of Contents

Method GetResizedImageBox

Namespace
LMKit.Media.Image
Assembly
LM-Kit.NET.dll

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 int

The width of the bounding box in pixels.

targetHeight int

The height of the bounding box in pixels.

backgroundColor int

The 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.