Sign in to follow this  
Hot_Tamalle

Linking Picture Box to directx Output

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this