Table of Contents

Class SKImagePyramidDziSource

Namespace
SkiaSharp.Extended
Assembly
SkiaSharp.Extended.dll

Represents a Deep Zoom Image (DZI) tile source. Parses the DZI XML descriptor and provides tile pyramid math for computing tile URLs and dimensions.

public class SKImagePyramidDziSource : ISKImagePyramidSource
Inheritance
SKImagePyramidDziSource
Implements
Inherited Members

Constructors

SKImagePyramidDziSource(int, int, int, int, string)

Properties

AspectRatio

Image aspect ratio (width / height).

CacheExpiry

The recommended maximum age for cached tiles from this source. null means tiles are considered immutable (cache indefinitely). The controller passes this to the cache as a hint when loading a new source.

DisplayRects

Display rectangles for sparse images. If empty, the image is not sparse and all pixels are available at all levels.

Format

Image format (e.g., "jpg", "png").

ImageHeight

Full image height in pixels at maximum resolution.

ImageWidth

Full image width in pixels at maximum resolution.

MaxLevel

Maximum pyramid level. Level 0 is 1×1 pixel.

Overlap

Overlap in pixels between adjacent tiles.

SourceId

A stable, short identifier for this source derived from its content and base URI. Used as a directory name in disk-based tile caches to namespace tiles per image source.

TileSize

Tile size in pixels (typically 254 or 256).

TilesBaseUri

Gets or sets the base URI used to resolve tile URLs. Typically derived from the DZI file path: "{name}_files/".

TilesQueryString

Gets or sets a query string (e.g., "?sig=ABC") appended to each tile URL. Used for signed/SAS URLs where authentication tokens must be preserved.

Methods

GetFullTileUrl(int, int, int)

Gets the full tile URL using TilesBaseUri and optional TilesQueryString.

GetLevelHeight(int)

Computes the image height at a given pyramid level.

GetLevelWidth(int)

Computes the image width at a given pyramid level.

GetOptimalLevel(double, double)

Selects the optimal pyramid level for rendering, where one tile pixel ≈ one screen pixel.

GetTileBounds(int, int, int)

Gets the pixel bounds of a tile within its pyramid level, including overlap. Returns a Rect<T> of int in level-pixel coordinates (XYWH).

GetTileCountX(int)

Number of tile columns at a given level.

GetTileCountY(int)

Number of tile rows at a given level.

GetTileUrl(int, int, int)

Gets the relative tile URL (e.g., "8/3_2.jpg").

Parse(Stream)

Parses a DZI XML from a stream.

Parse(Stream, string?)

Parses a DZI XML from a stream with a tiles base URI.

Parse(Stream, Uri)

Parses a DZI XML from a stream, deriving the tiles base URI from the DZI file URI.

Parse(string)

Parses a DZI XML string.

Parse(string, string?)

Parses a DZI XML string with a tiles base URI.

Parse(string, Uri)

Parses a DZI XML string, deriving the tiles base URI from the DZI file URI using the Deep Zoom convention: {name}_files/ relative to the DZI location.