views:

611

answers:

0

I am trying to modify the DirectShow.NET BitmapMixer sample app to use a surface that is rendered with Direct3D. Instead of creating a Surface based on a GDI rendered bitmap, I am creating my surface like this:

surface = new Surface(device, new Bitmap(1024, 768, PixelFormat.Format32bppArgb), Pool.SystemMemory); 
sprite = new Sprite(device); 
d3dFont = new Direct3D.Font(device, new System.Drawing.Font("Tahoma", 36)); 
unmanagedSurface = surface.GetObjectByValue(DxMagicNumber);

Then I am calling this function to create the surface:

public static void GenerateAlphaBitmap3(Device device, Sprite sprite, Direct3D.Font d3dFont) 
{ 
  device.Clear(ClearFlags.Target, Color.Transparent, 1.0f, 0); 
  device.BeginScene(); 
  sprite.Begin(SpriteFlags.AlphaBlend); 
  int height = 64; 
  d3dFont.DrawText(sprite, "This is a test", 10, height * 1, Color.White); 
  d3dFont.DrawText(sprite, "This is a test", 10, height * 2, Color.White); 
  d3dFont.DrawText(sprite, "This is a test", 10, height * 3, Color.White); 
  d3dFont.DrawText(sprite, "This is a test", 10, height * 4, Color.White); 
  d3dFont.DrawText(sprite, "This is a test", 10, height * 5, Color.White); 
  sprite.End(); 
  device.EndScene(); 
}

When I open a clip, however, I do not see the output from this function mixed in to the video.

Any ideas what I may doing wrong?

--Bruce