• Advertisement
Sign in to follow this  

Linking Picture Box to directx Output

This topic is 4371 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I am having trouble linking a pictureBox to the output of directx. I want the output to show in the pictureBox and not on the entire form. Please advice. Thankyou Some of the code is given below: private bool InitializeGraphics() { PresentParameters presp = new PresentParameters(); presp.SwapEffect = SwapEffect.Discard; presp.Windowed = true; try { m_device = new Device( 0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, presp ); return true; } catch ( DirectXException ) { return false; } } private void RenderFrame() { m_device.Clear( ClearFlags.Target, Color.Navy, 1.0f, 0 ); m_device.BeginScene(); m_device.EndScene(); m_device.Present(); }

Share this post


Link to post
Share on other sites
Advertisement

m_device = new Device( 0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, presp );



Instead of this (ie, the form) pass the pictureBox.

Alan

Share this post


Link to post
Share on other sites
I have seen a couple incidents where just passing the control gave some problems. Try and pass the Handle explicityl if you run into any problems with the device's constructor.

I hope this helps.
Take care.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement