Table of Contents

Method FitImageInViewportCells

Namespace
Terminal.Gui.Views
Assembly
Terminal.Gui.dll

FitImageInViewportCells(Size)

Returns the size in cell terms of the given image resized to fit in the viewport.

public Size FitImageInViewportCells(Size imageSizeInPixels)

Parameters

imageSizeInPixels Size

The size of the image in pixels.

Returns

Size

The largest possible size of the image in cell terms that fits within the viewport.

Remarks

This method accounts for the terminal's cell resolution and the viewport's size, returning the exact pixel dimensions and position required for fully cover the viewport without changing the images aspect ratio.