imageantialias() 안티 앨리어스 기능의 사용 여부를 확인하는 데 사용되는 PHP의 내장 기능입니다. 선과 연결된 다각형에 대한 빠른 그리기 앤티앨리어싱 방법을 활성화합니다. 트루 컬러 이미지에서만 작동하며 알파 구성 요소는 지원하지 않습니다.
구문
bool imageantialias($image, $enabled)
매개변수
imageantialias() $image 및 $enabled의 두 매개변수를 사용합니다.
-
$이미지 − $image 매개변수는 GdImage 객체이며 이미지 생성 함수 imagecreatetruecolor에서 반환되는 이미지 리소스입니다. .
-
$활성화 − $enabled 매개변수는 앤티앨리어싱이 활성화되었는지 여부를 확인하는 데 사용됩니다.
반환 값
imageantialias() 성공하면 True, 실패하면 False를 반환합니다.
예시 1
<?php
// Setup an anti-aliased image and a normal image
$img = imagecreatetruecolor(700, 300);
$normal = imagecreatetruecolor(700, 300);
// Switch antialiasing on for one image
imageantialias($img, true);
// Allocate colors
$blue = imagecolorallocate($normal, 0, 0, 255);
$blue_aa = imagecolorallocate($img, 0, 0, 255);
// Draw two lines, one with AA enabled
imageline($normal, 0, 0, 400, 200, $blue);
imageline($img, 0, 0, 400, 200, $blue_aa);
// Merge the two images side by side for output (AA: left, Normal: Right)
imagecopymerge($img, $normal, 400, 0, 0, 0, 400, 200, 200);
// Output image
header('Content-type: image/png');
imagepng($img);
imagedestroy($img);
imagedestroy($normal);
?> 출력
