I did something similar to what you are trying to do. All you have to do is show the graphic device where you can present the “material” that you have provided. You do this by passing it a pointer to the canvas.
Here is an example form:
public class DisplayForm : Form { IntPtr canvas; Panel displaypanel; public Panel DisplayPanel { get { return displaypanel; } set { displaypanel = value; } } public IntPtr Canvas { get { return canvas; } set { canvas = value; } } public DisplayForm() { displaypanel = new Panel(); displaypanel.Dock = DockStyle.Fill; this.canvas = displaypanel.Handle; this.Controls.Add(displaypanel); } }
Then just add this to the game class drawing call:
graphics.GraphicsDevice.Present(displayform.Canvas);
After you finish drawing on this DisplayForm instance, you can clear, display something else and call Present again, pointing to another canvas.
zfedoran
source share