(PHP 4, PHP 5, PHP 7, PHP 8)
imageinterlace — 啟用或禁用隔行掃描
$image
, int $interlace
= 0): intimageinterlace() 打開(kāi)或關(guān)閉隔行掃描位(bit)。
如果設置了隔行掃描位(interlace bit),對于 JPEG 圖像,會(huì )被創(chuàng )建為漸進(jìn)式 JPEG 圖像。
image
由圖象創(chuàng )建函數(例如imagecreatetruecolor())返回的 GdImage 對象。
interlace
如果為 0 ,則關(guān)閉隔行掃描,否則將打開(kāi)隔行掃描。
如果為圖像設置了隔行掃描,則返回 1 ,否則返回 0 。
示例 #1 使用 imageinterlace() 打開(kāi)隔行掃描
<?php
// 創(chuàng )建一個(gè)圖像實(shí)例
$im = imagecreatefromgif('php.gif');
// 打開(kāi)隔行掃描
imageinterlace($im, true);
// 保存圖像
imagegif($im, './php_interlaced.gif');
imagedestroy($im);
?>