(PHP 4 >= 4.0.6, PHP 5, PHP 7)
imagecreatetruecolor — Create a new true color image
$width
, int $height
)imagecreatetruecolor() returns an image identifier representing a black image of the specified size.
width
Image width.
height
Image height.
성공 시에 이미지 자원 지시자를, 오류 시에 FALSE
를 반환합니다.
Example #1 Creating a new GD image stream and outputting an image.
<?php
header ('Content-Type: image/png');
$im = @imagecreatetruecolor(120, 20)
or die('Cannot Initialize new GD image stream');
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color);
imagepng($im);
imagedestroy($im);
?>
위 예제의 출력 예시: