update : 2015.11.03
php.shukuma.com

검색:
 
 
Draw a filled rectangle

imagefilledrectangle

(PHP 4, PHP 5, PHP 7)

imagefilledrectangleDraw a filled rectangle

설명

bool imagefilledrectangle ( resource $image , int $x1 , int $y1 , int $x2 , int $y2 , int $color )

Creates a rectangle filled with color in the given image starting at point 1 and ending at point 2. 0, 0 is the top left corner of the image.

인수

image

imagecreatetruecolor() 등의 이미지 생성 함수에서 반환한 이미지 자원.

x1

x-coordinate for point 1.

y1

y-coordinate for point 1.

x2

x-coordinate for point 2.

y2

y-coordinate for point 2.

color

The fill color. A color identifier created with imagecolorallocate().

반환값

성공 시 TRUE를, 실패 시 FALSE를 반환합니다.

예제

Example #1 imagefilledrectangle() usage

<?php
// Create a 55x30 image
$im imagecreatetruecolor(5530);
$white imagecolorallocate($im255255255);

// Draw a white rectangle
imagefilledrectangle($im445025$white);

// Save the image
imagepng($im'./imagefilledrectangle.png');
imagedestroy($im);
?>

위 예제의 출력 예시:

Output of example : imagefilledrectangle()