GDI HDC 上的 XNA 渲染
我正在与使用插件的应用程序集成。我有自己的插件,提供了 HDC 来绘制,使用 C# 可以正常工作,
Graphics gfx = Graphics.FromHdc(hdc);
然后我可以使用 GDI 进行绘制,没有问题。
我想开始尝试 XNA,我已经加载了一些示例项目并查看了代码。默认情况下,XNA 似乎会处理窗口的创建以及我何时应该重绘每个框架。
我需要做的是在引发插件的渲染事件时使用 XNA 渲染帧。然后直接渲染到插件 HDC 或将 XNA 图像复制到其中。
这可以做到吗?有人有例子吗?我对 XNA 很陌生。
谢谢
I am integrating with an application that uses plugins. I have my own plugin that is provided an HDC to draw on, this works fine using C#
Graphics gfx = Graphics.FromHdc(hdc);
I can then draw using GDI without issue.
I would like to start experimenting with XNA, I've loaded a few sample projects and had a look through the code. It appears that by default XNA handles the creation of the window and when I should be redrawing each frame.
What I need to be able to do is use XNA to render a frame when the plugin's render event is raised. Then either render directly to the plugin HDC or to copy the XNA image to it.
Can this be done? Does anyone have any examples? I'm very new to XNA.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有一个 winforms 示例,向您展示如何自定义创建 XNA 图形设备,然后将其渲染到 Windows 窗体控件上。
http://creators.xna.com/en-US/sample/winforms_series1
There is a winforms sample that shows you how to custom create the XNA graphics device and then render it onto a windows form control.
http://creators.xna.com/en-US/sample/winforms_series1