MFC Support for Direct2D – Saving to files

Once have enabled Direct2D support in an MFC application, there is no sweat to load an image from a file, by using one of CD2DBitmap constructors. Unfortunately, we cannot find a CD2DBitmap method to save it into a image file (something similar to CImage::Save or Gdiplus::Image::Save). No problem, we can try to do it ourselves. … Read more

Read IFD and EXIF Metadata with WIC and MFC

A graphic file can store additional information abaout image (camera model, camera manufacturer, date and time, etc). Windows Imaging Component (WIC) provides interfaces which allow dealing with image metadata. Basically, for reading metadata we need an IWICMetadataQueryReader instance to call its GetMetadataByName method. The first argument of GetMetadataByName is based in Metadata Query Language and is composed by … Read more

Using Direct2D for Rendering WIC Bitmap Sources

Once having a WIC (Windows Imaging Component) source, we can render it by using GDI, GDI+ or Direct2D. There are many examples over the internet including MSDN Library that describes how to perform this. This article describes how to use WIC Wrapper Library, which is designed for using WIC without worrying about directly deal with COM interfaces. … Read more

WIC File Open Dialog Using IFileOpenDialog Interface

A previoius article extends CFileDialog MFC class, in order to make a File Open or a File Save dialog that automatically filters files, according to available WIC (Windows Imaging Component) codecs. This article presents how to show a similar File Open dialog using IFileOpenDialog interface. This way, it can be used not only in an … Read more

WIC Wrapper Library – Version 1.1

WIC Wrapper Library v1.1 has the following: new and completed methods for existing wrapper classes in the previous version; new classes: wic::Bitmap and wic::Palette; a new header containg enums, WicWrapEnums.h. Download: Example 2: Using wic::ImagingFactory::CreateBitmapFromHICON and wic::Bitmap The following example is close to the previous one, except that it uses wic::ImagingFactory::CreateBitmapFromHICON to display an icon … Read more

WIC Wrapper Library – Version 1.0

I’ve begun writing a series of wrapper classes over WIC (Windows Imaging Component) interfaces, that can easily be used in MFC, ATL, or Win32 applications without worry about directly dealing with COM interfaces. This first version contains basic operation for loading, scaling and converting source image formats that are supported by WIC. Download: WIC Wrapper … Read more

MFC-extension WIC File Dialogs

A previous article showed how to enumerate WIC (Windows Imaging Component) codecs, that are available in system. Now, let’s use the codecs list in order to make File Open and File Save As dialogs which are dealing with WIC-compliant image files, i.e. having “File of type” filter list according to available WIC codecs (see the images, below).   CWICFileDialog class … Read more