direct2d

Windows StretchBlt API performance

五迷三道 提交于 2019-11-28 01:46:51
问题 I timed a DDB drawing operation which uses multiple StretchBlt and StretchDIBits calls. And I found that, time to complete is increase/decrease proportionally to the destination window size. With 900x600 window it takes around 5ms, but with 1920x1080 it takes as large as 55ms (source image is 1280x640). It seems Stretch.. APIs don't use any hardware acceleration features. Source image (actually this is temporary drawing canvas) is created with CreateDIBSection because I need resulting

How to save ID2D1Bitmap to PNG file

巧了我就是萌 提交于 2019-11-26 22:05:07
问题 I faced a problem when trying to save ID2D1Bitmap (that created from ID2D1HwndRenderTarget) to PNG File. The output image is just empty with white color. HRESULT returned from function call EndDraw() is -2003238894. Thanks for any help. Here is my code: HRESULT CImageUtil::SaveBitmapToFile(PCWSTR uri,ID2D1Bitmap* pBitmap,ID2D1RenderTarget* pRenderTarget) { HRESULT hr = S_OK; ID2D1Factory *pD2DFactory = NULL; IWICBitmap *pWICBitmap = NULL; ID2D1RenderTarget *pRT = NULL; IWICBitmapEncoder