Linking Picture Box to directx Output

Started by
2 comments, last by Armadon 17 years, 11 months ago
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(); }
Advertisement
    m_device = new Device( 0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, presp );


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

Alan
"There will come a time when you believe everything is finished. That will be the beginning." -Louis L'Amour
Thankyou.
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.

This topic is closed to new replies.

Advertisement