views:

19

answers:

1

Hey everyone,

I am currently rendering an AVI stream as textures and displaying them out to the panel in C# using Visual Studio 2005 with the June 2010 version of the Direct X SDK. I would like to put some text onto the texture as a watermark or a logo on the bottom left. My question is how would I be able to save out the texture with the font watermark onto another texture. I've been looking into render targets, but have had no success with them, unless I am missing a step. Any help on this would be greatly appreciated.

Below is my current code on how I am rendering out the texture and the font.

device.Clear(ClearFlags.Target, System.Drawing.Color.FromArgb(255, 255, 255).ToArgb(), 1.0f, 0);

        device.BeginScene();
        {
            device.VertexFormat = CustomVertex.TransformedTextured.Format;
            device.SetTexture(0, tex);
            device.DrawUserPrimitives(PrimitiveType.TriangleList, 2, verticies);

            text.DrawText(null, "Test", new Point(10, 20), Color.White);
        }
        device.EndScene();

        device.Present();
+1  A: 

Look up SetRenderTarget then SetTexture the texture you want to render on to the render target and render (Remember to set the UVs on the vertices appropriately!).

Goz
Thanks Goz you've come to my aid yet again :)
Seb