Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9208079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:32:17+00:00 2026-06-18T00:32:17+00:00

The code: this.TopMost = true; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.splitContainer1.SplitterDistance = (this.ClientSize.Width – this.splitContainer1.SplitterWidth) /

  • 0

The 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;

And I have a timer tick event:

private void timer1_Tick(object sender, EventArgs e)
{

}

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.

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.

How can I do it in the timer1 tick event ?

enter image description here

The update code in the timer1 tick event:

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();
                }
            }

        }

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.

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T00:32:19+00:00Added an answer on June 18, 2026 at 12:32 am

    To create a screenshot you could try this code:

    int sequence = 0;
    
    private void timer1_Tick(object sender, EventArgs e)
    {
        using(var still = new Bitmap(form.Width, form.Height))
        {
            form.DrawToBitmap(still, new Rectangle(new Point(0, 0), still.Size));
            still.Save(String.Format(@"c:\still_{0}.gif", sequence++), ImageFormat.Gif);
        }
    }
    

    Instead of the form you could refer to any container that contains both images.

    EDIT

    This screenshot does not include the start menu, just the container of the two image controls.

    EDIT2

    Rendering the UI to a bitmap like this might not animate the GIF’s because the bitmap has no awareness of the animations. You will also get into a race condition: updating the GIF’s and making the screenshots within a specific time period in the right order.

    I’d use videos capturing software to record a video and select the frames I needed. That is much easier than trying to solve this issue and potential race condition

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm struggling here. Take this sample code: [void] [System.Reflection.Assembly]::LoadWithPartialName(System.Drawing) [void] [System.Reflection.Assembly]::LoadWithPartialName(System.Windows.Forms) $objForm = New-Object
would someone please write this code: this.Loaded += (s, e) => this.loaded = true;
I have this Windows Forms application where it sits in the notification area. Clicking
Is this piece of code correct: using (MyForm form = new MyForm { TopMost
I tried the code in my system. This is what I got...... 1) #include
I am making an overlay. I have this code here using System; using System.Collections.Generic;
Code This is my little game of pig. I only got it coded for
I want to code this part of a VB6 application in c#. How can
I'm trying to code this site (keyword trying) and I'm trying to figure out
Modified the code this time the objective to count the line of code was

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.