ImageGear assemblies require explicit initialization at application startup.
Common File Formats
Assembly: ImageGear.Formats.Common.dll
Supported Formats: BMP, CLP, CUR, GIF, JPEG, PNG, TIFF
The Common File Formats component additionally provides two alternative file format implementations for JPEG and PNG. These file filters are based on native binary code which is unlike the default filters implemented on .NET.
ImGearCommonFormats.Initialize() method initializes the file filter list with default JPEG and PNG filters. Update the filter list using ImGearFileFilters.Set(IImGearFormat format) method, which should be called after initialization to replace the default filters with native.
PDF and PS Formats
Assembly: ImageGear.Formats.Pdf.dll
This assembly requires both initialization and termination. Furthermore, the ImGearPDF.Initialize method does not add PDF and PostScript formats to the global format filter list. PDF and PostScript formats should be added explicitly .
Global and Local Initialization
After initializing ImageGear format filters, we can specify filter control parameters. Many format filters in ImageGear have control parameters that affect filter operations, such as image reading and writing. Those parameters may be declared by the format specification, or they may be specific to the format implementation by ImageGear. There are two ways to specify filter control parameters:
Specify Parameters Globally
This affects all format reading and writing operations, and threads in the process. Use the Filters static property of the ImGearFileFormats class to set parameters globally:
Specify Parameters Locally
This affects only one reading or writing operation, and thus can be used for setting different parameters in different threads. To specify local parameters, create an instance of ImGearFileFilters class, assign it to ImGearLoadOptions.Filters property or ImGearSaveOptions.Filters property, and pass the Load or Save options object to the reading or writing method, correspondingly: