开发者

An exception when creating CompatibleRenderTarget from DcRenderTarget

开发者 https://www.devze.com 2023-04-02 03:40 出处:网络
I’m using the .Net Direct2D API in “Window开发者_JS百科s API Code Pack for .NET” to improve the drawing performance, it always throws the “Exception from HRESULT: 0x88982F80” when creating the Co

I’m using the .Net Direct2D API in “Window开发者_JS百科s API Code Pack for .NET” to improve the drawing performance, it always throws the “Exception from HRESULT: 0x88982F80” when creating the CompatibleRenderTarget from DcRenderTarget, I don’t know why, it has been troubled me for two days. And here is my code:

var renderTarget = dcRenderTarget.CreateCompatibleRenderTarget(CompatibleRenderTargetOptions.None, new PixelFormat(Format.R8G8B8A8UNorm, AlphaMode.Straight), new size);

It works fine if I change the “AlphaMode” to others, such as “Ignore”, but it’s unable to make the renderTarget transparent, or gives a bad drawing quality.

Hope anybody knows the reason or please be free to post your ideas.

Regards!

Thanks,

0

精彩评论

暂无评论...
验证码 换一张
取 消