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 9197343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:03:15+00:00 2026-06-17T22:03:15+00:00

This is the code: if (Form1.sf != null) { radarDI = new DirectoryInfo(Form1.sf); radarFiles

  • 0

This is the code:

if (Form1.sf != null)
            {
                radarDI = new DirectoryInfo(Form1.sf);
                radarFiles = radarDI.GetFiles("*.png");
                for (int i = radarFiles.Length - 1; i >= 0; i--)
                {
                    radarImage = Image.FromFile(radarFiles[i].Name);
                    radarImage.Save(FileName, System.Drawing.Imaging.ImageFormat.Gif);
                    myGifListRadar.Add(radarFiles[i].Name);
                    if (myGifListRadar.Count == 5)
                    {
                        break;
                    }
                }
                radar_animation.MakeGIF(myGifListRadar, @"d:\RadarGifAnimatoion.gif", 8, true);
            }

I want to convert all the png files to gif.
Since I need to create animated gif and it’s getting only gif files.
So now im saving the png files to the hard disk make the convertion and then reading back the gif files from the hard disk:

radarImage.Save(FileName, System.Drawing.Imaging.ImageFormat.Gif);

FileName should be later on the files im saving and then reading back to use it.
The question is if there is any way to convert the files to gif without saving it to the hard disk first ? Some quicker way then saving the files to the hard disk convert then read them again as gif’s with FileInfo again ?

Just updated:

using (var ms = new MemoryStream())
            {
                if (Form1.sf != null)
                {
                    radarDI = new DirectoryInfo(Form1.sf);
                    radarFiles = radarDI.GetFiles("*.png");
                    for (int i = radarFiles.Length - 1; i >= 0; i--)
                    {
                        radarImage = Image.FromFile(radarFiles[i].FullName);
                        radarImage.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
                        myGifListRadar.Add(radarFiles[i].Name);
                        if (myGifListRadar.Count == 5)
                        {
                            break;
                        }
                    }
                }
                radar_animation.MakeGIF(myGifListRadar, @"d:\RadarGifAnimatoion.gif", 8, true);
            }

But now this part:

radarImage.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
                            myGifListRadar.Add(radarFiles[i].Name);

myGifListRadar is List how can I add now the radarImage to the List as string file name ?

  • 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-17T22:03:16+00:00Added an answer on June 17, 2026 at 10:03 pm

    Use Image.Save(Stream, ImageFormat):

    using (var ms = new MemoryStream)
    {
        radarImage.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
        // do something with ms
    }
    

    Depending on how you are making a GIF with multiple frames, this might be unnecessary – can you just take the separate Images and make the multi-frame GIF directly instead of making separate GIFs and then merging them?

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

Sidebar

Related Questions

With this code: public partial class Form1 : Form { private static readonly int
if you run this snippet of code(put it in form1) in a fresh new
This is my Form1 code for rotating and its working the image i can
I'm trying to append text lines with this code SendMessage(Form1.log.Handle, WM_SETTEXT, 0, Integer(PChar(textLog))); //
I have this code: public partial class Form1 : Form { public Form1() {
I have this code: namespace TuyenTk { public partial class Form1 : Form {
I have this code: private void removeDuplicates(List<string> currentSites, List<string> visitedSites) { for (int i
This is the code: private void Lightnings_Mode_Load(object sender, EventArgs e) { this.Size = new
i have this code in my default aspx file : <body> <form id=form1 runat=server>
Here is the code in question: MagickNet.InitializeMagick(); ImageMagickNET.Image image = new ImageMagickNET.Image(@C:\temp.pdf); image.Quality =

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.