Linking Picture Box to directx Output
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();
}
m_device = new Device( 0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, presp );
Instead of this (ie, the form) pass the pictureBox.
Alan
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.
I hope this helps.
Take care.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement