An exception when creating CompatibleRenderTarget from DcRenderTarget

1

I’m using the .Net Direct2D API in “Windows 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,

c#
.net
directx
rendertargetbitmap
windows-api-code-pack
asked on Stack Overflow Sep 2, 2011 by Howard • edited Sep 7, 2011 by Howard

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0