Click or drag to resize

Jb2DecoderReadRegion Method

Decodes a specified region of a JBIG2 image given a source Stream.

Namespace:  Atalasoft.Imaging.Codec.Jbig2
Assembly:  Atalasoft.dotImage.Jbig2 (in Atalasoft.dotImage.Jbig2.dll) Version: 11.4.0.9.0.377 (.NET 4.5.2, x86)
Syntax
public virtual AtalaImage ReadRegion(
	Stream stream,
	Rectangle region,
	int frameIndex,
	ProgressEventHandler progress
)

Parameters

stream
Type: System.IOStream
The stream to read.
region
Type: System.DrawingRectangle
A rectangular region of the image to decode.
frameIndex
Type: SystemInt32
The zero based frame index to load from a multi-page JBIG2 file.
progress
Type: Atalasoft.ImagingProgressEventHandler
A progress Delegate. Pass in null (Nothing in VB, 0 in C++) to ignore progress events.

Return Value

Type: AtalaImage
Returns an AtalaImage containing the decoded JBIG2 image.
Remarks
If rectangle region is not set, then the full region will be decoded.
Examples
region decoding C# (C#)
using Atalasoft.Imaging; 
using Atalasoft.Imaging.Codec.Jbig2; 
.... 
FileStream fs = new FileStream(sourceFilename, FileMode.Open); 
Jb2Decoder jb2d = new Jb2Decoder(); 
// assume that region and frameindex are set
AtalaImage target = jb2d.ReadRegion(fs, region, frameIndex, null); 
....
region decoding C++ (CPP)
using namespace Atalasoft::Imaging; 
using namespace Atalasoft::Imaging::Codec::Jbig2; 
.... 
FileStream* fs = new FileStream(sourceFilename, FileMode.Open); 
Jb2Decoder* jb2d = new Jb2Decoder(); 
// assume that region and frameindex are set
AtalaImage* target = jb2d->ReadRegion(fs, region, frameIndex, null); 
....
See Also