Computer >> 컴퓨터 >  >> 프로그램 작성 >> PHP

PHP의 imagecharup() 함수

<시간/>

imagecharup() 함수는 문자를 세로로 그리는 데 사용됩니다.

구문

imagecharup( img, font, x, y, c, color )

매개변수

  • 이미지 : imagecreatetruecolor()를 사용하여 이미지 만들기

  • 글꼴: 글꼴 크기를 설정합니다. latin2 인코딩의 내장 글꼴의 경우 1, 2, 3, 4, 5일 수 있습니다.

  • x: x 좌표

  • :y좌표

  • ㄷ: 그릴 캐릭터

  • 색상: 색상 식별자

돌아가기

imagecharup() 함수는 성공하면 TRUE를, 실패하면 FALSE를 반환합니다.

다음은 예입니다.

<?php
   $img = imagecreate(300, 300);
   $str = 'Demo';
   $bg = imagecolorallocate($img, 190, 255, 255);
   $color = imagecolorallocate($img, 120, 60, 100);
   imagecharup($img, 5, 30, 50, $str, $color);
   header('Content-type: image/png');
   imagepng($img);
?>

출력

다음은 출력입니다.

PHP의 imagecharup() 함수

예시

다른 예를 살펴보겠습니다.

<?php
   $img = imagecreate(270, 270);
   $str = 'Example';
   $bg = imagecolorallocate($img, 160, 185, 175);
   $color = imagecolorallocate($img, 100, 120, 100);
   imagecharup($img, 10, 80, 100, $str, $color);
   header('Content-type: image/png');
   imagepng($img);
?>

출력

다음은 다른 차원의 문자 E를 그리는 출력입니다.

PHP의 imagecharup() 함수