Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.03.27
Getting Started with LEAD WIC-Enabled Codecs
See Also

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);

Installing LEAD WIC-Enabled Codecs into Windows Vista or Windows XP SP3

  1. Install the required LEAD libraries in the Global Assembly Cache (GAC) by dragging them to the GAC location (typically c:\windows\assembly), or by using a utility like gacutil.exe (the .NET utilty used to work with the GAC).
  2. Register the LEAD WIC-Enabled Codecs that you want to use. 

Programming with the LEAD WIC Enabled Codec

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

Demos

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:

  • Display all WIC decoders and encoders that are registered on your system.
  • Display the property bag items of all encoders on your system.
  • Open and display image files using any of the codecs registered on your system. The log shows detailed information about the decoder used.
  • Save image files using any of the codecs registered on your system. When choosing one of the LEAD Encoders, the IWICLeadBitmapEncoder interface is used to show detailed options in the file save dialog.

Tutorials

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.

See Also