GetSamplesAt(Int32) Method

Definition

Assembly Broadside.dll

Returns the image's samples at a reduction of 2^reduction, or at the finest one that is cheaper to get: a finer reduction already decoded, or the largest the codec delivers (MaxReduction).

public DisplayImageSamples? GetSamplesAt(int reduction)

Parameters

reduction
Int32

The reduction asked for: 0 for the image's own resolution, 1 for half, 2 for a quarter, 3 for an eighth.

Returns

Nullable<DisplayImageSamples>
The samples, with the reduction delivered (Reduction, never more than asked for) and the image's own size; null when the image cannot be decoded, which was recorded as a diagnostic of the document the first time, and which paints nothing.

Remarks

ISO 32000-2 §8.9.3 and §8.9.4. Reduced samples are for displaying an image smaller than its resolution, where at least GetReduction(in Matrix, Double, PdfColorConverter?)'s samples per device pixel remain: never for printing, export or image extraction, which use the image's own samples (reduction 0, or Decode()).

Thread-safe: each reduction is decoded at most once however many threads ask for it at the same time, and is then kept in the document's image cache, charged against ImageCacheBudget; an evicted reduction is decoded again when next asked for. Samples larger than the budget, or with a budget of 0, stay with the image for as long as the list holds it.