【发布时间】:2022-03-18 21:24:37
【问题描述】:
我使用内存中的数据创建了一个 IWicBitmap 使用
hr=pFactory->CreateBitmapFromMemory(512,512,GUID_WICPixelFormat8bppGray,512,512*512,ptr,&Bitmap1)
现在我想在位图上绘图,所以我正在创建 bitmaprendertarget
hr= m_pDirect2dFactory->CreateWicBitmapRenderTarget(Bitmap1,props,&target);
但它没有形成目标 - 它返回错误:
-2003292288
我不明白如何解决它 我也设置了属性
D2D1_RENDER_TARGET_PROPERTIES props = D2D1::RenderTargetProperties();
props.minLevel = D2D1_FEATURE_LEVEL_DEFAULT;
D2D1_PIXEL_FORMAT pixelFormat = D2D1::PixelFormat(DXGI_FORMAT_UNKNOWN,D2D1_ALPHA_MODE_IGNORE);
props.pixelFormat=pixelFormat;
【问题讨论】: