I am currently learning Direct2D and I successfully implemented image loading into my test application as described in:
How to Load a Bitmap from a File (https://learn.microsoft.com/en-us/windows/win32/direct2d/how-to-load-a-direct2d-bitmap-from-a-file) and How to Load a Bitmap from a Resource (https://learn.microsoft.com/en-us/windows/win32/direct2d/how-to-load-a-bitmap-from-a-resource)
But now I stumbled across the subsection in What's new in Direct2D -> Improved image loading APIs (https://learn.microsoft.com/en-us/windows/win32/direct2d/what-s-new-in-direct2d-for-windows-8-consumer-preview#improved-image-loading-apis).
Can someone explain to me why these new APIs for loading images are better than the ones used in "How to Load a Bitmap from a File/Resource"? As far as I understand these new functions provide D2D1Image types, which must be converted to D2D1Bitmap before they can be used by the RenderTarget?
According to the Doc:Supported Pixel Formats and Alpha Modes
CreateBitmapFromWicBitmap must match the pixel format of the
WIC bitmap source. ID2D1ImageSource can be instantiated from eitherWICor anIDXGISurface. An ID2D1ImageSource that is instantiated from IDXGISurface also supports some YUV pixel formats.When you create a render target, you must specify its pixel format. For a list of pixel formats and alpha modes supported by each render target, see Supported Pixel Formats and Alpha Modes.