Rendering DirectX to a picture box control

dellanooch

Member
Joined
Dec 31, 2002
Messages
10
Location
Fairfax, VA
Maybe not necessarily a picture box control, but some sort of way of rendering to a confined area (not just the entire face of the form). Anyone have a way of doing this? A link to a tutorial or some sort of reference would be WONDERFUL.

- Andrew
 
Which version of DirectX? I only tried DX9 briefly but I seem to remember it accepting a parameter of type Control as a place to render to, so instead of passing a form you could try passing a Panel or PictureBox instead.
 
DX9 (the only officially supported version of DirectX that works with .NET) has a project template that will create a Direct3D project that writes to a picturebox control. When you select new project, select the DirectX project type. A wizard will come up asking for some parameters. I think its the "Project Settings" page of the wizard that allows you to select a PictureBox.

-Ner
 
Ah yes, Nerseus. Thanks for pointing that out. But if you remember from other thread about the missing files I cant completely generate an error-free directx project. But regardless I think Ill be able to figure it out.

Thanks guys.
 
When you setup your PresentParameters, just set the DeviceWindow to the PictureBox control. Also, for obvious reasons, choose Windowed mode :)

-Nerseus
 
Back
Top