Class ScreenshotSinkExtension
- Namespace
- Datafication.Sinks.Connectors.WebConnector
- Assembly
- Datafication.WebConnector.dll
Extension methods for capturing DataBlocks as screenshot images.
public static class ScreenshotSinkExtension
- Inheritance
-
objectScreenshotSinkExtension
Methods
Screenshot(DataBlock, int, string?)
Captures the DataBlock as a screenshot.
public static byte[] Screenshot(this DataBlock dataBlock, int rowLimit = 100, string? title = null)
Parameters
dataBlockDataBlockThe DataBlock to capture.
rowLimitintMaximum number of rows to include. Default is 100.
titlestringOptional title to display above the table.
Returns
- byte[]
A byte array containing the image data.
ScreenshotAsync(DataBlock, int, string?)
Captures the DataBlock as a PNG screenshot.
public static Task<byte[]> ScreenshotAsync(this DataBlock dataBlock, int rowLimit = 100, string? title = null)
Parameters
dataBlockDataBlockThe DataBlock to capture.
rowLimitintMaximum number of rows to include. Default is 100.
titlestringOptional title to display above the table.
Returns
- Task<byte[]>
A byte array containing the PNG image data.
ScreenshotHighResAsync(DataBlock, int, string?)
Captures the DataBlock as a high-resolution screenshot (2x scale).
public static Task<byte[]> ScreenshotHighResAsync(this DataBlock dataBlock, int rowLimit = 100, string? title = null)
Parameters
dataBlockDataBlockThe DataBlock to capture.
rowLimitintMaximum number of rows to include. Default is 100.
titlestringOptional title to display above the table.
Returns
- Task<byte[]>
A byte array containing the high-resolution PNG image data.
ScreenshotToFile(DataBlock, string, int, string?, ScreenshotFormat, int?)
Captures the DataBlock as a screenshot and saves to file.
public static void ScreenshotToFile(this DataBlock dataBlock, string filePath, int rowLimit = 100, string? title = null, ScreenshotFormat format = ScreenshotFormat.Png, int? quality = null)
Parameters
dataBlockDataBlockThe DataBlock to capture.
filePathstringThe path to save the image to.
rowLimitintMaximum number of rows to include. Default is 100.
titlestringOptional title to display above the table.
formatScreenshotFormatImage format (PNG or JPEG). Default is PNG.
qualityint?JPEG quality (1-100). Only used when format is JPEG.
ScreenshotToFileAsync(DataBlock, string, int, string?, ScreenshotFormat, int?)
Captures the DataBlock as a screenshot and saves to file.
public static Task ScreenshotToFileAsync(this DataBlock dataBlock, string filePath, int rowLimit = 100, string? title = null, ScreenshotFormat format = ScreenshotFormat.Png, int? quality = null)
Parameters
dataBlockDataBlockThe DataBlock to capture.
filePathstringThe path to save the image to.
rowLimitintMaximum number of rows to include. Default is 100.
titlestringOptional title to display above the table.
formatScreenshotFormatImage format (PNG or JPEG). Default is PNG.
qualityint?JPEG quality (1-100). Only used when format is JPEG.
Returns
- Task
A task representing the asynchronous operation.