array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.imageinterlace.php', 1 => 'imageinterlace', ), 'up' => array ( 0 => 'ref.image.php', 1 => 'GD 和图像处理 函数', ), 'prev' => array ( 0 => 'function.imagegrabwindow.php', 1 => 'imagegrabwindow', ), 'next' => array ( 0 => 'function.imageistruecolor.php', 1 => 'imageistruecolor', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/image/functions/imageinterlace.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
imageinterlace — 启用或禁用隔行扫描
imageinterlace() 打开或关闭隔行扫描位(bit)。
如果设置了隔行扫描位(interlace bit)并且图像被用作 JPEG,将会创建为渐进式 JPEG 图像。
image
由图象创建函数(例如imagecreatetruecolor())返回的 GdImage 对象。
interlace
如果为 true
,则图像开启隔行扫描,如果为 false
,否则将关闭隔行扫描。传递 null
不会让隔行扫描行为发生改变。
版本 | 说明 |
---|---|
8.0.5 | imageinterlace() 现在返回 bool;之前返回 int(非零为隔行扫描图像,否则为 0) |
8.0.0 |
image 现在需要 GdImage 实例;之前需要有效的 gd resource。
|
8.0.0 |
enable 现在接受 bool;之前接受 int。
|
示例 #1 使用 imageinterlace() 打开隔行扫描
<?php
// 创建图像实例
$im = imagecreatefromgif('php.gif');
// 打开隔行扫描
imageinterlace($im, true);
// 保存隔行扫描图像
imagegif($im, './php_interlaced.gif');
imagedestroy($im);
?>