(PHP 4 >= 4.3.2, PHP 5, PHP 7)
imageantialias — 锟角凤拷使锟矫匡拷锟斤拷荩锟絘ntialias锟斤拷锟斤拷锟斤拷
$image
, bool $enabled
) : bool锟斤拷锟竭段和讹拷锟斤拷锟斤拷锟斤拷每锟斤拷倩锟酵硷拷锟斤拷锟捷凤拷锟斤拷锟斤拷锟斤拷支锟斤拷 alpha 锟斤拷锟街★拷使锟斤拷直锟接伙拷色锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟缴硷拷锟�
锟斤拷支锟斤拷锟竭匡拷头锟斤拷
使锟矫匡拷锟斤拷莺锟酵革拷锟斤拷锟斤拷锟缴拷锟斤拷艹锟斤拷锟轿丛わ拷诘慕锟斤拷锟斤拷锟斤拷色锟斤拷锟斤拷锟窖憋拷锟斤拷色锟斤拷锟斤拷锟轿猴拷锟斤拷锟斤拷锟斤拷色使锟矫★拷缺锟斤拷 alpha 锟斤拷锟街碉拷支锟街碉拷锟铰诧拷锟斤拷锟斤拷锟斤拷锟� alpha 锟斤拷锟斤拷莘锟斤拷锟斤拷锟�
image
锟斤拷图锟襟创斤拷锟斤拷锟斤拷(锟斤拷锟斤拷imagecreatetruecolor())锟斤拷锟截碉拷图锟斤拷锟斤拷源锟斤拷
enabled
锟角凤拷锟斤拷锟矫匡拷锟斤拷荨锟�
锟缴癸拷时锟斤拷锟斤拷 TRUE
锟斤拷 锟斤拷锟斤拷锟斤拷失锟斤拷时锟斤拷锟斤拷 FALSE
锟斤拷
Example #1 A comparison of two lines, one with anti-aliasing switched on
<?php
// Setup an anti-aliased image and a normal image
$aa = imagecreatetruecolor(400, 100);
$normal = imagecreatetruecolor(200, 100);
// Switch antialiasing on for one image
imageantialias($aa, true);
// Allocate colors
$red = imagecolorallocate($normal, 255, 0, 0);
$red_aa = imagecolorallocate($aa, 255, 0, 0);
// Draw two lines, one with AA enabled
imageline($normal, 0, 0, 200, 100, $red);
imageline($aa, 0, 0, 200, 100, $red_aa);
// Merge the two images side by side for output (AA: left, Normal: Right)
imagecopymerge($aa, $normal, 200, 0, 0, 0, 200, 100, 100);
// Output image
header('Content-type: image/png');
imagepng($aa);
imagedestroy($aa);
imagedestroy($normal);
?>
锟斤拷锟斤拷锟斤拷锟教碉拷锟斤拷锟斤拷锟斤拷锟斤拷冢锟�
Note: 锟剿猴拷锟斤拷锟斤拷锟斤拷锟斤拷 GD 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 PHP 锟芥本锟叫匡拷锟矫★拷