TiffDecoderReadRegion Method |
Namespace: Atalasoft.Imaging.Codec
public AtalaImage ReadRegion( Stream stream, Rectangle region, int frameIndex, ProgressEventHandler progress )
Exception | Condition |
---|---|
Thrown if the image stream is not located at the beginning of a valid TIFF file. | |
Thrown if the region parameter is outside the image bounds. |
This method will read only the strips or tiles that it needs in order to compose and image of the indicated rectangular region, and trim any excess data. This can be significantly faster than reading the entire image if only a specified region needs to be decoded. To maximize benefit of this method, use multiple tiles or strips per image.
For reading only a single strip or tile, see ReadStrip(Stream, Int32, Int32, ProgressEventHandler) or ReadTile(Stream, Point, Int32, ProgressEventHandler).
Note that the image data is not corrected for orientation even when CorrectOrientation is true.