从 DcRenderTarget 创建 CompatibleRenderTarget 时出现异常
我在“Windows API Code Pack for .NET”中使用.Net Direct2D API来提高绘图性能,当从DcRenderTarget创建CompatibleRenderTarget时,它总是抛出“Exception from HRESULT: 0x88982F80”,我不知道为什么,这已经困扰我两天了。这是我的代码:
var renderTarget = dcRenderTarget.CreateCompatibleRenderTarget(CompatibleRenderTargetOptions.None, new PixelFormat(Format.R8G8B8A8UNorm, AlphaMode.Straight), new size);
如果我将“AlphaMode”更改为其他(例如“忽略”),它可以正常工作,但它无法使 renderTarget 透明,或者提供较差的绘图质量。
希望有人知道原因,或者请随意发表您的想法。
问候!
谢谢,
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,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论