Original Post
I'm struggling to understand what I'm missing, and perhaps someone here knows something high-level that I'm not thinking of. In short, my live video that I'm capturing through directshow displays for about 10 seconds in a picture control and then goes black. To boil down the problem, I'm passing a valid direct3D surface that contains a frame of live video from a camera to a rendering function. I "convert" the surface into a texture when passing to the rendering function first. Just to make sure the surface and texture contains valid image data I tried periodically saving the surfaces to disk and they do indeed contain correct video frames. So the problem I'm having is that I'm setting my rendertarget to an image control inside a form, and my basic test rendering loop code looks like this: .. the correct image stops displaying inside the image (picture) control after about 10 seconds and instead the only thing that seems to work is the d3dDev.Clear call, which does clear the surface. The odd thing is that it works perfectly fine on my home computer, but not on my work computer. Any ideas? Thanks in advance. - Michael Tanczos
// spr is just a D3DX sprite
d3dDev.SetRenderTarget(0, renderTarget); // renderTarget is a surface that references the original render target when the device was created
Vector3 ctr = new Vector3(0, 0, 0);
d3dDev.Clear(ClearFlags.Target, 0x00000000, 1.0f, 0);
d3dDev.BeginScene();
spr.Begin(SpriteFlags.AlphaBlend | SpriteFlags.SortDepthFrontToBack);
spr.Draw(texture, System.Drawing.Rectangle.Empty, ctr, ctr, System.Drawing.Color.White);
spr.Draw(img, System.Drawing.Rectangle.Empty, ctr, ctr, System.Drawing.Color.White);
spr.End();
d3dDev.EndScene();
d3dDev.Display();