开发者

XNA rendering on GDI HDC

开发者 https://www.devze.com 2022-12-17 20:18 出处:网络
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#

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.开发者_JAVA技巧 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


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

0

精彩评论

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

关注公众号