Search code examples
windowsdirectxdirect2dwic

DIfference between ID2D1Bitmap and IWicBitmap


What is the differnce betweem ID2D1Bitmap and IWicBitmap I have raw memory data and i wanted to create a bitmap


Solution

  • A WIC bitmap represents an image in system memory that can be in a wide range of formats (JPEG, PNG, BMP, etc.). A D2D bitmap represents an image in GPU memory that is one of a handful of hardware-accelerated fomats.

    Assuming you want to draw the bitmap to the screen using D2D, and your raw memory data is in a format compatible with D2D, you should use ID2D1RenderTarget::CreateBitmap directly. If it is not a compatible format (e.g. it is a pointer to the raw data of a .png file), you will need to load it into an IWicBitmap and then use ID2D1RenderTarget::CreateBitmapFromWicBitmap.