Class ClipboardExtensions
- Namespace
- PaintDotNet.Clipboard
- Assembly
- PaintDotNet.Core.dll
public static class ClipboardExtensions
- Inheritance
-
ClipboardExtensions
- Inherited Members
Methods
- OpenAndUseWithRetry(IClipboard, Action<IClipboardTransaction>)
Opens a clipboard transaction, passes it to the given callback, and then closes the clipboard transaction. If there is an exception while opening the clipboard or calling the callback, this process is repeated after a short delay. After too many failed attempts, this method will either throw the first exception that was caught (if they are all the same) or an AggregateException (if they are different).
- OpenAndUseWithRetry(IClipboard, nint, Action<IClipboardTransaction>)
Opens a clipboard transaction, passes it to the given callback, and then closes the clipboard transaction. If there is an exception while opening the clipboard or calling the callback, this process is repeated after a short delay. After too many failed attempts, this method will either throw the first exception that was caught (if they are all the same) or an AggregateException (if they are different).
- OpenAndUseWithRetry(IClipboard, IWin32Window, Action<IClipboardTransaction>)
Opens a clipboard transaction, passes it to the given callback, and then closes the clipboard transaction. If there is an exception while opening the clipboard or calling the callback, this process is repeated after a short delay. After too many failed attempts, this method will either throw the first exception that was caught (if they are all the same) or an AggregateException (if they are different).
- OpenAndUseWithRetry<T>(IClipboard, Func<IClipboardTransaction, T>)
Opens a clipboard transaction, passes it to the given callback, and then closes the clipboard transaction. If there is an exception while opening the clipboard or calling the callback, this process is repeated after a short delay. After too many failed attempts, this method will either throw the first exception that was caught (if they are all the same) or an AggregateException (if they are different).
- OpenAndUseWithRetry<T>(IClipboard, nint, Func<IClipboardTransaction, T>)
Opens a clipboard transaction, passes it to the given callback, and then closes the clipboard transaction. If there is an exception while opening the clipboard or calling the callback, this process is repeated after a short delay. After too many failed attempts, this method will either throw the first exception that was caught (if they are all the same) or an AggregateException (if they are different).
- OpenAndUseWithRetry<T>(IClipboard, IWin32Window, Func<IClipboardTransaction, T>)
Opens a clipboard transaction, passes it to the given callback, and then closes the clipboard transaction. If there is an exception while opening the clipboard or calling the callback, this process is repeated after a short delay. After too many failed attempts, this method will either throw the first exception that was caught (if they are all the same) or an AggregateException (if they are different).
- SetImage(IClipboard, IBitmapSource)
Takes the bitmap and puts it onto the clipboard in a few standard formats. The clipboard is first emptied.
- SetImage(IClipboard, IBitmapSource, IColorContext?)
Takes the bitmap and puts it onto the clipboard in a few standard formats. The clipboard is first emptied.
This overload also allows including a color profile for the clipboard types that support it, such as PNG. For formats that do not support an embedded color profile, such as DIB/DIBv5, the image will not be converted to any particular color space and the color profile will not be included.
- SetImage(IClipboard, ISurface<ColorBgra>)
Takes the bitmap and puts it onto the clipboard in a few standard formats. The clipboard is first emptied.
- SetImage(IClipboard, Bitmap)
Takes the bitmap and puts it onto the clipboard in a few standard formats. The clipboard is first emptied.
- SetImage(IClipboard, Image)
Takes the bitmap and puts it onto the clipboard in a few standard formats. The clipboard is first emptied.
- TryGetImage(IClipboard)
Retrieves the image that is on the clipboard, if possible.
- TryGetImage(IClipboard, in PixelFormat)
Retrieves the image that is on the clipboard, if possible.
The image is converted to the requested pixel format if necessary.
- TryGetImageBgra32(IClipboard)
Retrieves the image that is on the clipboard, if possible.
The image is converted to BGRA32 if necessary.
- TryGetImage<TPixel>(IClipboard)
Retrieves the image that is on the clipboard, if possible.
The image is converted to the requested pixel format if necessary.