decodeRegion abstract method

ImageWrapper decodeRegion(
  1. Rectangle rect,
  2. double sampleSize
)

Method is used to decode rectangle region in the image specified by rect. rect area to render Rectangle sampleSize if set to a value > 1, requests the decoder to subsample the original image, returning a smaller image to save memory. Returns constructed bitmap

Example:

// Decode region with sample size 1 (full resolution)
ImageWrapper decodedImage = _decoder!.decodeRegion(sampleRect, 1);
print(
 "Decoded region: ${sampleRect.width}x${sampleRect.height} at sample size 1",
);

Implementation

ImageWrapper decodeRegion(Rectangle rect, double sampleSize);