Tag Archive for Windows Imaging Component

Introduction to WIC: How to use WIC to load an image, and draw it with tranparency using only GDI?

A while ago I wrote an article: “Introduction to WIC: How to use WIC to load an image, and draw it with GDI?”

The code in that article didn’t handle transparency.
It’s actually trivial to implement transparency in that sample code. Read the rest of this entry »

Share

Introduction to WIC: How to use WIC to load an image, and draw it with GDI?

The Windows Imaging Component (WIC) is a flexible and robust API for working with images on Windows. The API is extensible. Third-party vendors can create new image codecs (readers and writers) to make new image formats available to all applications that use the WIC API. Here is a brief description from the MSDN:

The Windows Imaging Component (WIC) provides an extensible framework for working with images and image metadata. WIC makes it possible for independent software vendors (ISVs) and independent hardware vendors (IHVs) to develop their own image codecs and get the same platform support as standard image formats (for example, TIFF, JPEG, PNG, GIF, BMP, and HDPhoto). A single, consistent set of interfaces is used for all image processing, regardless of image format, so any application using the WIC gets automatic support for new image formats as soon as the codec is installed. The extensible metadata framework makes it possible for applications to read and write their own proprietary metadata directly to image files, so the metadata never gets lost or separated from the image.

The MSDN states the primary features of WIC as follows:

  • Enables application developers to perform image processing operations on any image format through a single, consistent set of common interfaces, without requiring prior knowledge of specific image formats.
  • Provides an extensible “plug and play” architecture for image codecs, pixel formats, and metadata, with automatic run-time discovery of new formats.
  • Supports reading and writing of arbitrary metadata in image files, with the ability to preserve unrecognized metadata during editing.
  • Preserves high bit depth image data, up to 32 bits per channel, throughout the image processing pipeline.
  • Provides built-in support for most popular image formats, pixel formats, and metadata schemas.

WIC comes with the following standard built-in codecs:

  • BMP (Windows Bitmap Format), BMP Specification v5.
  • GIF (Graphics Interchange Format 89a), GIF Specification 89a/89m
  • ICO (Icon Format)
  • JPEG (Joint Photographic Experts Group), JFIF Specification 1.02
  • PNG (Portable Network Graphics), PNG Specification 1.2
  • TIFF (Tagged Image File Format), TIFF Specification 6.0
  • Windows Media Photo, HD Photo Specification 1.0

All codecs can both load and save the specific image format, except the ICO codec which can only load icon files and not save them.

Reading all this, it looks like WIC is pretty powerful, and the best part is that it’s easy to use as I will demonstrate in this article. Read the rest of this entry »

Share