Home > other >  The return value is not s ok direct2d create bitmap great god see where is problem
The return value is not s ok direct2d create bitmap great god see where is problem

Time:09-25

#include
ID2D1Factory * zhujiekou;
ID2D1HwndRenderTarget * chuangkouchengxianqi;
ID2D1Bitmap * weitu;
Void chuangjianziyuan (HWND zhuchuangkoujubing)
{
Retrieves the hr=D2D1CreateFactory (D2D1_FACTORY_TYPE_MULTI_THREADED, & amp; Zhujiekou);
D2D1_RENDER_TARGET_PROPERTIES chengxianqimubiaoxuanxiang=D2D1: : RenderTargetProperties (
D2D1_RENDER_TARGET_TYPE_DEFAULT,
D2D1: : PixelFormat (DXGI_FORMAT_B8G8R8A8_UNORM D2D1_ALPHA_MODE_UNKNOWN),
NULL, NULL,
D2D1_RENDER_TARGET_USAGE_NONE,
D2D1_FEATURE_LEVEL_DEFAULT
);
D2D1_SIZE_U daxiao;
Daxiao. Height=500;
Daxiao. Width=500;
D2D1_HWND_RENDER_TARGET_PROPERTIES chengxianqimubiaoxuanxiang2;
Chengxianqimubiaoxuanxiang2=D2D1: : HwndRenderTargetProperties (
Zhuchuangkoujubing,
Daxiao,
D2D1_PRESENT_OPTIONS_IMMEDIATELY);
Retrieves documents (=zhujiekou - & gt; CreateHwndRenderTarget (chengxianqimubiaoxuanxiang chengxianqimubiaoxuanxiang2, & amp; Chuangkouchengxianqi);
D2D1_SIZE_U daxiao1;
Daxiao1. Height=500;
Daxiao1. Width=500;
D2D1_BITMAP_PROPERTIES miaoshuweitu;
Miaoshuweitu=D2D1: : BitmapProperties (D2D1: : PixelFormat (DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_UNKNOWN), NULL, NULL);
HRESULT hr2=chuangkouchengxianqi - & gt; CreateBitmap (daxiao miaoshuweitu, & amp; Weitu);

}
Hr2 return values are not s ok great god and see what is going wrong

CodePudding user response:

You look at the return values of hr2 will close
  • Related