Class ClipboardImage
Reads raw image data from the OS clipboard (e.g. an image copied from a browser, or a Win+Shift+S screenshot), which terminals cannot paste as text. Always returns PNG bytes: clipboard PNG data is passed through, clipboard bitmaps (CF_DIB) are re-encoded.
public static class ClipboardImage
- Inheritance
-
ClipboardImage
- Inherited Members
Methods
DibToPng(byte[])
Converts clipboard DIB bytes (a BITMAPINFOHEADER/V4/V5 + optional palette/masks + pixel data, i.e. a .bmp file without its 14-byte file header) to PNG. Returns null when the data is malformed or not decodable as a bitmap.
public static byte[]? DibToPng(byte[] dib)
Parameters
dibbyte[]
Returns
- byte[]
TryGetPng(out byte[])
public static bool TryGetPng(out byte[] png)
Parameters
pngbyte[]