c# - How can i display each new image in pictureBox1? -
c# - How can i display each new image in pictureBox1? -
in form1 have timer tick event save screenshots hard disk:
private void timer1_tick(object sender, eventargs e) { count++; sc.capturescreentofile(maindirectory + count.tostring("d6") + ".jpg", system.drawing.imaging.imageformat.jpeg); sc.capturescreen(); label2.text = count.tostring(); if (count == 1) { label4.text = string.format("{0:n2} kb", getfilesizeondisk(maindirectory + "000001.jpg").tostring()); label4.visible = true; } } displayimages();
each time after new screenshot saved hard disk want display image in picturebox1. , next after it...the timer interval set 1000ms. screenshots in picturebox1 should alter each second.
private void displayimages() { }
how can each sec file on hard disk , display in picturebox ? , create sure file not in utilize if it's important.
for illustration first file on hard disk is: 000001.jpg 000002.jpg , on.
private void timer1_tick(object sender, eventargs e) { count++; string filename = maindirectory + count.tostring("d6") + ".jpg"; sc.capturescreentofile(filename , system.drawing.imaging.imageformat.jpeg); sc.capturescreen(); label2.text = count.tostring(); if (count == 1) { label4.text = string.format("{0:n2} kb", getfilesizeondisk(filename).tostring()); label4.visible = true; } picturebox1.imagelocation = filename; }
c# .net winforms
Comments
Post a Comment