简体   繁体   中英

XNA rendering on GDI HDC

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM