欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 文旅 > 文化 > C#操作GIF图片(下)将一帧一帧的图片合并成gif

C#操作GIF图片(下)将一帧一帧的图片合并成gif

2025/3/16 3:45:31 来源:https://blog.csdn.net/forever8341/article/details/145366964  浏览:    关键词:C#操作GIF图片(下)将一帧一帧的图片合并成gif

见过不少人、经过不少事、也吃过不少苦,感悟世事无常、人心多变,靠着回忆将往事串珠成链,聊聊感情、谈谈发展,我慢慢写、你一点一点看......

string newPath = Application.StartupPath + "\\new.gif";

List<string> imgs = Directory.GetFiles(Application.StartupPath + "\\images\\", "*.jpg").ToList();            
imgs.Sort((a, b) =>            {                string reg = "[0-9]+";                int a_index = int.Parse(Regex.Match(a, reg).Value);                int b_index = int.Parse(Regex.Match(b, reg).Value);                return a_index > b_index ? 1 : a_index < b_index ? -1 : 0;            });            AnimatedGifEncoder ae = new AnimatedGifEncoder();            ae.Start(newPath);            ae.SetDelay(120);   // 延迟间隔            ae.SetRepeat(0);  //-1:不循环,0:循环播放            for (int i = 0; i < imgs.Count; i++)            {                ae.AddFrame(Image.FromFile(imgs[i]));            }            ae.Finish();

关注我,不失联。有啥问题请留言。

感情恋爱合集https://blog.csdn.net/forever8341/category_12863789.html

职业发展故事https://blog.csdn.net/forever8341/category_12863790.html

常用代码片段https://blog.csdn.net/forever8341/category_12863793.html

程序开发教程https://blog.csdn.net/forever8341/category_12863792.html

自我备考经验 https://blog.csdn.net/forever8341/category_12863791.html

高阶高效代码https://blog.csdn.net/forever8341/category_12873345.html

金融语言解析https://blog.csdn.net/forever8341/category_12877262.html

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词