dimanche 15 mars 2015

Form flickers when changing image on 1 tick delay

I'm trying to create a title screen for a C# Game i'm making. I created a video to use as the background for the title screen, and extracted the frames to JPEG files. Using this:



int frame = 1;
private void timer1_Tick(object sender, EventArgs e)
{
if (frame == 901) { frame = 1; }
this.BackgroundImage = Image.FromFile("src\\titlescreen\\0 (" + frame + ").jpg");
frame++;
}


The form flickers when changing the image. The timer is on a 1 tick delay.


Is there any way to stop this?


Additional info: The form is maximised.


Thanks in advance,


DMP9


Aucun commentaire:

Enregistrer un commentaire