The Windows Imaging Component (WIC) framework, provided with Windows Vista (and later) and Windows XP Service Pack 3, provides a single, common set of APIs that allow developers to create applications that process images, with no prior knowledge of the specific image formats required. Once an image format codec is written for WIC, and installed on a machine that supports WIC, you get system-wide support for that format in all applications that use WIC or WPF. This means that any application using WIC can access, display, process, save, and print images using a consistent interface for all image file formats.
LEAD has done the work of writing WIC codecs for you. The LEAD WIC-Enabled Codec set provides you with over forty image encoders and decoders that integrate seamlessly with the Windows Imaging Component (WIC) framework.
By registering your LEAD WIC-Enabled Codecs, applications that support WIC and WPF (like Vista Photo Explorer) will automatically have access to over forty image file formats. And, when using the Windows Explorer thumbnail view, users will see an actual thumbnail image for all of these file formats, instead of a generic icon.
Note: Registering some of the LEAD WIC Codecs can have undesired effects on applications that were written to use the Microsoft .Net WIC codec classes. This is a known bug in the Microsoft .Net runtime. The following list shows the LEAD WIC Codecs and the affected Microsoft .Net classes:
LEAD WIC Codec | Microsoft .Net Class |
---|---|
LEAD Bmp Decoder | System.Windows.Media.Imaging.BmpBitmapDecoder |
LEAD Gif Decoder | System.Windows.Media.Imaging.GifBitmapDecoder |
LEAD Icon Decoder | System.Windows.Media.Imaging.IconBitmapDecoder |
LEAD Jpeg Decoder | System.Windows.Media.Imaging.JpegBitmapDecoder |
LEAD Png Decoder | System.Windows.Media.Imaging.PngBitmapDecoder |
LEAD Tiff Decoder | System.Windows.Media.Imaging.TiffBitmapDecoder |
LEAD Hdp Decoder | System.Windows.Media.Imaging.WmpBitmapDecoder |
The following code illustrates the problem and shows how to work around this issue:
//You cannot use TiffBitmapDecoder if the LEAD WIC Tiff Decoder is registered. //This is a bug in the .Net runtime. TiffBitmapDecoder decoder = new BitmapDecoder(uri, BitmapCreateOptions.None, BitmapCacheOption.Default); //You can work around this by using the static Create method BitmapDecoder decoder = BitmapDecoder.Create(stream, BitmapCreateOptions.None, BitmapCacheOption.Default);
The LEAD WIC-Enabled Codec is a COM object that supports standard WIC codecs interfaces. The LEAD CLeadBitmapDecoder is the class that implements the LEAD Bitmap decoders. The LEAD CLeadBitmapEncoder is the class that implements the LEAD Bitmap Encoders. A summary of the interfaces implemented by these classes is given below:
CLeadBitmapDecoder Implemented Interfaces |
---|
IWICBitmapFrameDecode |
IWICBitmapDecoder |
IWICBitmapCodecProgressNotification |
IWICMetadataBlockReader |
IThumbnailProvider |
IInitializeWithStream |
CLeadBitmapEncoder Implemented Interfaces |
---|
IWICBitmapEncoder |
IWICBitmapFrameEncode |
IWICLeadBitmapEncoder |
The source code for LeadCodecDemo_Original.exe is installed as part of the toolkit. It is written in C++, and shows how to program with the LeadCodec.dll COM object directly.
The LeadCodecDemo_Original.exe can do the following:LEAD WIC Enabled Codecs Tutorials show how to programmatically work with the LEAD WIC Enabled Codecs, as well as any other codecs that are registered on your system.