PHP/Graphics Image/imagefilltoborder
Версия от 13:37, 26 мая 2010; (обсуждение)
Using imagefill() and imagefilltoborder()
<source lang="html4strict">
<?php
define("WIDTH", 200); define("HEIGHT", 200); $img = imagecreate(WIDTH, HEIGHT); $background = $white = imagecolorallocate($img, 0xFF, 0xFF, 0xFF); $black = imagecolorallocate($img, 0, 0, 0); $red = imagecolorallocate($img, 0xFF, 0, 0); $blue = imagecolorallocate($img, 0, 0, 0xFF); $center_x = (int)WIDTH/2; $center_y = (int)HEIGHT/2; imagerectangle($img, 0, 0, WIDTH-1, HEIGHT-1, $black); imageline($img, 0, 0, WIDTH-1, HEIGHT-1, $red); imagefill($img, 2, 20, $black); imagefilltoborder($img, WIDTH-2, 20, $red, $blue); header("Content-Type: image/png"); imagepng($img);
?>
</source>