Table of Contents

Method EncodeKitty

Namespace
Terminal.Gui.Drawing
Assembly
Terminal.Gui.dll

EncodeKitty(Color[,], int, int, int?)

Encodes the provided pixel array into a Kitty graphics protocol APC sequence string that, when written to the terminal, renders the image at the current cursor position occupying destCols columns and destRows rows.

public string EncodeKitty(Color[,] pixels, int destCols, int destRows, int? imageId = null)

Parameters

pixels Color[,]

The pixel array to encode, indexed as [x, y] where the first dimension is width and the second is height.

destCols int

The number of terminal columns the image should occupy.

destRows int

The number of terminal rows the image should occupy.

imageId int?

An optional stable image identifier (the Kitty i key). When supplied, placements can be deleted and replaced by id via EncodeDeletePlacements(int), which is required to erase a previous placement when the image is resized or moved. Use GetImageId(string) to derive a stable id from a string. When null the terminal assigns its own id and the placement cannot be targeted for deletion.

Returns

string

The complete Kitty APC escape sequence string.