你生成的gif是正确的吗?在acdsee里动吗?
解决方案 »
- 求助!frame 的问题
- 织梦cmsV5.7首页内容更新了没反应!
- 在dreamweaver中的插入记录表单向导,date的类型和默认值
- 初学PHP,想把如下一小段ASP代码转成PHP,还望指教!
- 请推荐虚拟空间提供商(深圳)php+mysql 谢谢
- 访问数据库问题
- 请问这段上传代码为什么在服务器通过,在本地不行??解决后立即结帖
- 在线等待:在iis中配置php时,出现这样的错误
- 表单提交时Submit按钮可不可以赋变量?
- windows10系统下哪个php集成开发环境比较好
- cookie问题-如何不刷新就能显示值,为何无法删除?
- Smarty-Light 2.2.9中如何做到每行显示6个?解决就加100分结贴
我看了文件结构了。
这是gif文件头的类
class GIFhead
{
protected $ver; //GIF文件标识,GIF文件版本号,占6个字节
protected $width; //像素数,定义GIF图象的宽度,占2个字节
protected $height; //像素数,定义GIF图象的高度,占2个字节
protected $screen; //该字字为标志字节,具体如下,占1个字节
protected $m; //全局颜色列表标志(Global Color Table Flag),
//当置位时表示有全局颜色列表,pixel值有意义.占一位,可以用<<左移出来
//具体见screen_bit()函数
protected $cr; //颜色深度(Color ResoluTion),cr+1确定图象的颜色深度.占3位
protected $s; //分类标志(Sort Flag),如果置位表示全局颜色列表分类排列占1位.
protected $pixel; //全局颜色列表大小,pixel+1确定颜色列表的索引数(2的pixel+1次方)占3位
protected $background;
protected $aspect;
public function __construct(&$content)
{
$this->ver=substr($content,0,5);
$this->width=ord($content{6}.$content{7});
$this->height=ord($content{8}.$content{9});
$this->screen=ord($content{10});
$this->screen_bit();
$this->background=ord($content{11});
$this->aspect=ord($content{12});
}
public function screen_bit()
{
$this->m=$this->screen<<1?1:0; //取出一位
$this->screen=$this->screen&0x7f; //保留剩下的
$this->cr=($this->screen&0x70)>>4; //取出3位色深
$this->s=($this->screen&0x08)?1:0; //取出分类标志
$this->pixel=$this->screen&0x07; //取出最后三位
}
public function getVer()
{
return $this->ver;
}
public function getWidth()
{
return $this->width;
}
public function getHeight()
{
return $this->height;
}
public function getScreen($var='')
{
if($var!='')
{
return $this->$var;
}else
{
return $this->screen;
}
}
public function getBackground()
{
return $this->background;
}
}
再后就是数据。因为gif用了lzw算法。
我现在还弄得怎么明白。在网上查下又没有其它程现成的算法可看。
正在研究这段文字
http://www.whsdn.net/bbs/default.aspx?p=thread&ForumID=30&ThreadID=36&View=New&Page=1