What's New for WIC in Windows 8

In Windows 8, Windows Imaging Component (WIC) has been updated with several new features. The updated version of WIC is also available on Windows 7 and Windows Server 2008 R2 via the Platform Update for Windows 7, which is available through the Platform Update for Windows 7. This topic provides a quick introduction to these new features.

This topic contains the following sections.

Improved Direct2D integration

WIC in Windows 8 provides these APIs to improve Direct2D integration with WIC:

Changes to BMP codec alpha support

WIC in Windows 8 supports loading BITMAPV5HEADER image files as WICPixelFormat32bppBGRA-formatted images. In addition, the BMP encoder supports a new Boolean ,encoder option "EnableV5Header32bppBGRA", which instructs the encoder to write a BITMAPV5HEADER with the 32bppBGRA image data.

For more info about BMP formats, see BMP Format Overview.

New pixel formats

WIC in Windows 8 defines these new pixel formats:

  • GUID_WICPixelFormat32bppRGB
  • GUID_WICPixelFormat64bppRGB
  • GUID_WICPixelFormat96bppRGBFloat
  • GUID_WICPixelFormat64bppPRGBAHalf

Note  The TIFF built-in codec will return GUID_WICPixelFormat96bppRGBFloat data. The other three formats are not used by built-in codecs.

Restrictions to component extensibility in AppContainer

When running in an AppContainer process, which includes all Windows Store apps, WIC will only use Windows-provided components, regardless of whether additional components are installed on the system. App that are not running in AppContainer are not affected.

Apps don't need to make any code changes to run in an AppContainger, but the WICComponentEnumerateOptions flag and vendor GUID parameters will have no effect. WIC will fail to load an image if it cannot be decoded by a Windows provided codec, and calling the CreateComponentEnumerator method will only return Windows provided components.

Changes to CLSID_WICPngDecoder and PNG decoder color context support

CLSID_WICPngDecoder1 has been added with the same GUID as CLSID_WICPngDecoder, and CLSID_WICPngDecoder2 has been added.

When compiled against the Windows 8 SDK, CLSID_WICPngDecoder is #defined to CLSID_WICPngDecoder2 to promote newly compiled apps using the new PNG decoder behavior. Apps should continue to specify CLSID_WICPngDecoder.

Specifying CLSID_WICPngDecoder2 will create a version of the WIC PNG decoder that will generate an IWICColorContext from cHRM and gAMA chunks. This allows this color space metadata to be used with other Windows APIs for color managing the source image. An IWICColorContext is not generated from the gAMA and cHRM chunks if an iCCP chunk is present, if an sRGB chunk is present, or if the gAMA and cHRM chunks indicate an sRGB color space.

An app can specify CLSID_WICPngDecoder1 to create a version of the WIC PNG decoder that does not generate an IWICColorContext from the gAMA and cHRM chunks. This matches the behavior of the PNG decoder in previous versions of Windows.

Changes to WINCODEC_SDK_VERSION

When compiled against the Windows 8 SDK, WINCODEC_SDK_VERSION is #defined to WINCODEC_SDK_VERSION2 to promote newly compiled apps using the new PNG decoder behavior. Otherwise, it is #defined to WINCODEC_SDK_VERSION1. Apps should continue to specify WINCODEC_SDK_VERSION.

Specifying WINCODEC_SDK_VERSION when calling WICCreateImagingFactory_Proxy to create the imaging factory causes CLSID_WICPngDecoder2 to be created instead of CLSID_WICPngDecoder1 from the CreateDecoder method and its variants. Also, a decoder component info enumerator will return CLSID_WICPngDecoder2 component info, but not CLSID_WICPngDecoder1 info.

Specifying WINCODEC_SDK_VERSION1 will cause CLSID_WICPngDecoder1 to be used instead of CLSID_WICPngDecoder2 in the above cases.

Changes to CLSID_WICImagingFactory

CLSID_WICImagingFactory1 has been added with the same GUID as CLSID_WICImagingFactory, and CLSID_WICImagingFactory2 has been added.

When compiled against the Windows 8 SDK, CLSID_WICImagingFactory is #defined to CLSID_WICImagingFactory2 to promote newly compiled apps using the new PNG decoder behavior. Apps should continue to specify CLSID_WICImagingFactory.

Specifying CLSID_WICImagingFactory2 when calling CoCreateInstance to create the imaging factory causes CLSID_WICPngDecoder2 to be created instead of CLSID_WICPngDecoder1 from the CreateDecoder method and its variants. Also, a decoder component info enumerator will return CLSID_WICPngDecoder2 component info, but not CLSID_WICPngDecoder1 info.

Specifying CLSID_WICImagingFactory1 will cause CLSID_WICPngDecoder1 to be used instead of CLSID_WICPngDecoder2 in the above cases.

 

 

Build date: 11/26/2013

Community Additions

Show:
© 2014 Microsoft