合成GIF
- /* create Gif */
- //you should replace filepath
- String [] imageFilePaths = new String[]{"c:\\01.png","c:\\02.png","c:\\03.png"};
- String outputFilePath = "c:\\test.gif";
- AnimatedGifEncoder e = new AnimatedGifEncoder();
- e.Start( outputFilePath );
- e.SetDelay(500);
- //-1:no repeat,0:always repeat
- e.SetRepeat(0);
- for (int i = 0, count = imageFilePaths.Length; i < count; i++ )
- {
- e.AddFrame( Image.FromFile( imageFilePaths[i] ) );
- }
- e.Finish();
- /* extract Gif */
- string outputPath = "c:\\";
- GifDecoder gifDecoder = new GifDecoder();
- gifDecoder.Read( "c:\\test.gif" );
- for ( int i = 0, count = gifDecoder.GetFrameCount(); i < count; i++ )
- {
- Image frame = gifDecoder.GetFrame( i ); // frame i
- frame.Save( outputPath + Guid.NewGuid().ToString() + ".png", ImageFormat.Png );
- }
以上是小编为您精心准备的的内容,在的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索string
, gif
, new
, png
repeat
易语言分解gif图像、gif分解、经典gif动态图分解、gif在线分解、在线分解gif动态图片,以便于您获取更多的相关知识。
时间: 2023-01-01