Επεξεργασία

Κοινή χρήση μέσω


D1123: DXGI Format Unknown Not Allowed

DXGI_FORMAT_UNKNOWN is not allowed as a parameter to this API.

 

Possible Causes

For Direct2D functionality which accepts a surface format as a parameter, the surface format should be fully specified. In some cases, it can be left unknown; for example, while calling ID2D1RenderTarget:: CreateHwndRenderTarget or ID2D1RenderTarget::CreateDxgiSurfaceRenderTarget, Direct2D may infer a surface format from the swap chain format or backing Direct3D surface format, as the case may be.

Possible Fixes

In cases where it was not possible to infer the surface format, Direct2D will not create the resource, and will output this message. To address this, modify the application to specify a surface format other than UNKNOWN for the operation causing this message. A reasonable default surface format to use, in case of doubt, is DXGI_FORMAT_B8G8R8A8_UNORM. If the application must create a Direct2D resource to interoperate with a Direct3D or WIC resource, choose a format that matches the interoperated resource. The semantics for WIC resources differ slightly from DXGI resources; please see Supported Pixel Formats and Alpha Modes for additional guidance.