Common/Gif/AnimatedGifEncoder.cs
(开头部分) 10KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/************************************************************************************
*源码来自(C#源码世界) www.HelloCsharp.com
*如果对该源码有问题可以直接点击下方的提问按钮进行提问哦
*站长将亲自帮你解决问题
*C#源码世界-找到你需要的C#源码,交流和学习
************************************************************************************/
using System;
using System.Drawing;
using System.IO;
namespace ValidyCode
{
public class AnimatedGifEncoder
{
protected int colorDepth;
protected byte[] colorTab;
protected int delay = 0;
protected int dispose = -1;
protected bool firstFrame = true;
protected int height;
protected Image image;
protected byte[] indexedPixels;
protected MemoryStream Memory;
protected int palSize = 7;
protected byte[] pixels;
protected int repeat = -1;
protected int sample = 10;
protected bool sizeSet = false;
protected bool started = false;
protected int transIndex;
protected Color transparent = Color.Empty;
protected bool[] usedEntry = new bool[0x100];
protected int width;
public bool AddFrame(Image im)
{
if (!((im != null) && this.started))
{
return false;
}
bool flag3 = true;
try
{
if (!this.sizeSet)
{
this.SetSize(im.Width, im.Height);
}
this.image = im;
this.GetImagePixels();
this.AnalyzePixels();
if (this.firstFrame)
{
this.WriteLSD();
this.WritePalette();
if (this.repeat >= 0)
{
this.WriteNetscapeExt();
}
}
this.WriteGraphicCtrlExt();
后面还有 279 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
