How do I draw video frames onto the screen permanently using XNA?
- by izb
I have an app that plays back a video and draws the video onto the screen at a moving position. When I run the app, the video moves around the screen as it plays. Here is my Draw method...
protected override void Draw(GameTime gameTime)
{
Texture2D videoTexture = null;
if (player.State != MediaState.Stopped)
videoTexture = player.GetTexture();
if (videoTexture != null)
{
spriteBatch.Begin();
spriteBatch.Draw(
videoTexture,
new Rectangle(x++, 0, 400, 300), /* Where X is a class member */
Color.White);
spriteBatch.End();
}
base.Draw(gameTime);
}
The video moves horizontally acros the screen. This is not exactly as I expected since I have no lines of code that clear the screen. My question is why does it not leave a trail behind?
Also, how would I make it leave a trail behind?