title: How to read a png image and transfer to ID2D1Bitmap?
body: <p>I have a C++ project which uses <strong>Windows Animation Manager with Direct2D</strong> under Visual Studio 2010 to implement image sparkled animation.
  But when I load a png image, the transparent can’t display correctly.<BR><BR>
  I use <strong>IWICImagingFactory</strong> and <strong>IWICBitmap</strong> to load the png image, and then create a D2D bitmap from the WIC bitmap.  The <strong>D2D1_PIXEL_FORMAT’s</strong> alphaMode set as <strong>D2D1_ALPHA_MODE_PREMULTIPLIED</strong> and format set as <strong>DXGI_FORMAT_B8G8R8A8_UNORM</strong>.  It seems only opaque and transparent without semitranslucent.  And I try to change the D2D1_PIXEL_FORMAT’s alphaMode to <strong>D2D1_ALPHA_MODE_STRAIGHT</strong> but it doesn’t work.<BR><BR>  I also follow the sample code from MSDN ( <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ee719658%28v=vs.85%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/windows/desktop/ee719658(v=vs.85).aspx</a> ), but nothing display.  Can someone help me that how to load a png image and transfer to ID2D1Bitmap with correct alpha value? Thanks!</p>