hi there.
i need help in making my code work.
i will briefly discuss the output that is needed.
currently, i have 5picboxes that s'pose to relate to the frame that has been grab from the frame grabber. when i click, btnTrack5frames, the program suppose to capture image by image into the picboxes in a 2sec interval.
unfortunately, the code that i've used do not give me the right output. instead, the first image grabbed was shown on all the picboxes and it continue to change the image for every few sec.
here is the code that i have written:
private void grab5frames_Click(object sender, EventArgs e)
{
timer2.Enabled = true;
}
private void timer2_Tick(object sender, EventArgs e)
{
v = 1;
if (v <= 5)
{
if (v == 1 && time == true)
{
time = false;
if (fg.GrabImage() == true)
{
picbox1.Image = fg.bmp;
}
time = true;
v++;
}
if (v == 2 && time == true)
{
time = false;
if (fg.GrabImage() == true)
{
picbox2.Image = fg.bmp;
}
time = true;
v++;
}
if (v == 3 && time == true)
{
time = false;
if (fg.GrabImage() == true)
{
picbox3.Image = fg.bmp;
}
time = true;
v++;
}
if (v == 4 && time == true)
{
time = false;
if (fg.GrabImage() == true)
{
picbox4.Image = fg.bmp;
}
time = true;
v++;
}
if (v == 5 && time == true)
{
time = false;
if (fg.GrabImage() == true)
{
picbox5.Image = fg.bmp;
}
time = true;
}
else if (v >= 6)
{
timer2.Enabled = false;
}
}
}
do pls help.
thank you.