Table of Contents

Class ScreenshotSinkExtension

Namespace
Datafication.Sinks.Connectors.WebConnector
Assembly
Datafication.WebConnector.dll

Extension methods for capturing DataBlocks as screenshot images.

public static class ScreenshotSinkExtension
Inheritance
object
ScreenshotSinkExtension

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

dataBlock DataBlock

The DataBlock to capture.

rowLimit int

Maximum number of rows to include. Default is 100.

title string

Optional 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

dataBlock DataBlock

The DataBlock to capture.

rowLimit int

Maximum number of rows to include. Default is 100.

title string

Optional 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

dataBlock DataBlock

The DataBlock to capture.

rowLimit int

Maximum number of rows to include. Default is 100.

title string

Optional 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

dataBlock DataBlock

The DataBlock to capture.

filePath string

The path to save the image to.

rowLimit int

Maximum number of rows to include. Default is 100.

title string

Optional title to display above the table.

format ScreenshotFormat

Image format (PNG or JPEG). Default is PNG.

quality int?

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

dataBlock DataBlock

The DataBlock to capture.

filePath string

The path to save the image to.

rowLimit int

Maximum number of rows to include. Default is 100.

title string

Optional title to display above the table.

format ScreenshotFormat

Image format (PNG or JPEG). Default is PNG.

quality int?

JPEG quality (1-100). Only used when format is JPEG.

Returns

Task

A task representing the asynchronous operation.