Method FitImageInViewportInPixels
FitImageInViewportInPixels(Size)
Scales an image to fit within the current Viewport while maintaining aspect ratio.
public Size FitImageInViewportInPixels(Size imageSize)
Parameters
imageSizeSizeThe original size of the image to scale.
Returns
Remarks
This method calculates the largest possible size for the given image that will fit within the current Viewport while maintaining its aspect ratio.
The calculation is based on the terminal's cell resolution and the Viewport size, returning the exact pixel dimensions and position required for the scaled image.