Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I take a sample still image from two pictureBoxes in fullscreen every X seconds?
    primarykey
    data
    text
    <p>The code:</p> <pre><code>this.TopMost = true; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.splitContainer1.SplitterDistance = (this.ClientSize.Width - this.splitContainer1.SplitterWidth) / 2; pictureBox1.Image = Image.FromFile(@"d:\gifs\RadarGifAnimatoion.gif");//pb1.Image; pictureBox2.Image = Image.FromFile(@"d:\gifs\SatelliteGifAnimatoion.gif");//pb2.Image; timer1.Interval = animationSpeed; timer1.Enabled = true; </code></pre> <p>And I have a timer tick event:</p> <pre><code>private void timer1_Tick(object sender, EventArgs e) { } </code></pre> <p>In this example the timer interval is 80ms. So inside the timer1 tick event I want each 80ms to take a snapshot or a screenshot of both pictureBoxes and save this shot to the hard disk.</p> <p>So in the end I will have on the hard disk for example 5 images of the two pictureBoxes . So if I edit each image of the 5 on the hard disk I will see the two pictureBoxes images.</p> <p>How can I do it in the timer1 tick event ?</p> <p><img src="https://i.stack.imgur.com/wrFHC.jpg" alt="enter image description here"></p> <p>The update code in the timer1 tick event:</p> <pre><code>private void timer1_Tick(object sender, EventArgs e) { using (var still = new Bitmap(this.Width, this.Height)) { this.DrawToBitmap(still, new Rectangle(new Point(0, 0), still.Size)); still.Save(String.Format(@"d:\GifForAnimation\still_{0}.gif", sequence++), System.Drawing.Imaging.ImageFormat.Gif); if (sequence == 5) { timer1.Stop(); } } } </code></pre> <p>I set the timer1 interval in the constructor to the same speed of the animation when created it. The animation speed is 80ms so the timer1 is set to 80ms too.</p> <p>And still instead of taking each 80ms an image of the pictureBoxes it's taking or saving the same image. 5 images that are the same.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload