LEADTOOLS provides several methods/classes for compressing and decompressing images in buffers.
To begin the compression process, the StartCompress method must be called. This method initializes the compression engine, sets the characteristics such as compression factor and output type for the compression. The CodecsCompressDataCallback delegate passed to the method will handle the compressed data. Compression is actually carried out by calling the Compress method Once the Compress method is called, the CompressData event is called each time the buffer is filled with compressed data, or when the compression is complete. When compression is completed, call the StopCompress method
To begin the decompression process, the StartDecompress method must be called. This method initializes the decompression engine and establishes characteristics of the decompression, such as whether strips or tiles will be decompressed, the format of the image, the view perspective, the load order, and where to place the decompressed image. For more information about the decompression characteristics set by this method, refer to the CodecsStartDecompressOptions class. For each strip or tile to be decompressed, the Decompress method must be called. When decompression is completed, call the StopDecompress method.
TWAIN buffer transfers can return data in raw compressed form. These methods provide a means of decompressing this data. Consequently, these methods only work for certain file types. These file types and the corresponding TWAIN constant are given below:
LEAD file constant |
Twain constant |
RasterImageFormat.Jpeg |
TwainCapabilityValue.CompressionJpeg |
RasterImageFormat.RawRle4 |
TwainCapabilityValue.CompressionRle4 |
RasterImageFormat.RawRle8 |
TwainCapabilityValue.CompressionRle8 |
RasterImageFormat.RawBitfields |
TwainCapabilityValue.CompressionBitfields |
RasterImageFormat.RawPackbits |
TwainCapabilityValue.CompressionPackbits |
RasterImageFormat.RawCcitt |
TwainCapabilityValue.CompressionGroup31D |
RasterImageFormat.FaxG31Dim |
TwainCapabilityValue.CompressionGroup31DEol |
RasterImageFormat.FaxG32Dim |
TwainCapabilityValue.CompressionGroup32D |
RasterImageFormat.FaxG4 |
TwainCapabilityValue.CompressionGroup4 |
Products |
Support |
Feedback: Compressing and Decompressing Buffers |
Introduction |
Help Version 19.0.2017.6.21
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.