>  기사  >  백엔드 개발  >  PHP의 imagefilled직사각형() 함수

PHP의 imagefilled직사각형() 함수

PHPz
PHPz앞으로
2023-08-30 09:05:061071검색

imagefilled직사각형() 함수는 채워진 직사각형을 그립니다.

Syntax

imagefilledrectangle( $img, $x1, $y1, $x2, $y2, $color )

Parameters

  • image

    빈 이미지를 만들려면 imagecreatetruecolor()를 사용하세요.

  • x1

    x 점 1의 좌표.

  • y1

    점 1의 y 좌표입니다.

  • x2

    점 2의 x 좌표입니다.

  • y2

    점 2의 y 좌표입니다.

  • color

    채우기 색상.

반환 값

imagefilled직사각형() 함수는 성공하면 TRUE를 반환하고, 실패하면 FALSE를 반환합니다.

Example

예는 다음과 같습니다.

<?php
   // Create an image
   $img = imagecreatetruecolor(500, 300);
   $color = imagecolorallocate($img, 0, 128, 128);
   imagefilledrectangle($img, 30, 30, 470, 270, $color);
   header("Content-type: image/png");
   imagepng($img);
   imagedestroy($img);
?>

Output

출력은 다음과 같습니다.

PHP의 imagefilled직사각형() 함수

위 내용은 PHP의 imagefilled직사각형() 함수의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
이 기사는 tutorialspoint.com에서 복제됩니다. 침해가 있는 경우 admin@php.cn으로 문의하시기 바랍니다. 삭제