Im trying to create a video background using frames from a video, and using a timer to run the frames 30FPS , can someone help me out? its for a school project.
im here so far, i can make this work with a trackbar, but using a timer to automatically refresh the background 30FPS would be a lot more cool =).
im here so far, i can make this work with a trackbar, but using a timer to automatically refresh the background 30FPS would be a lot more cool =).
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Threading;
namespace MyClock
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
Text = "My Clock";
}
private void timer1_Tick(object sender, EventArgs e)
{
//timer1.Interval = 1000;
//FPS set up
double FPS = 30.0;
timer1.Interval = Convert.ToInt32(FPS);
Image[] images = new Image[2003];
for (int i = 1; i < 10; i++)
{
images[i] = Image.FromFile(@"C:\Users\Sword Master\Desktop\New folder (6)\PS3 Background Waves Attempt HD (08-07-2010 23-45-07)\PS3 Background Waves Attempt HD 000" + i + ".jpg");
this.BackgroundImage = images[i];
}
//test if the timer works
label2.Text = DateTime.Now.ToLongTimeString();
}
}
}
Comment