<?php
bool imagefilltoborder ( GdImage $image,
int $x, int $y,
int $border_color,
int $color )
where,
$image = The image identifier
$x = The x-coordinate of the start point
$y = The y-coordinate of the start point
$border_color = The border color identifier
created by imagecolorallocate
$color = The fill color identifier
created by imagecolorallocate
?>
<?php
echo 'PHP VERSION: ' . PHP_VERSION . '<br><br>';
$base_img = 'png/PNG 071 01.png';
$dest_img = 'png/PNG 071 01 imagefilltoborder.png';
$id_base_img = imagecreate(640, 332);
$white = imagecolorallocate($id_base_img, 255, 255, 255);
imagepng($id_base_img, $base_img);
echo $base_img; ?><br><br>
<img src="<?php echo $base_img; ?>"
alt="<?php echo $base_img; ?>"
title="<?php echo $base_img; ?>" width="400"><br><br><br>
<?php
$id_base = imagecreatefrompng($base_img);
$internal_x = 97;
$internal_y = 87;
$external_x = 8;
$external_y = 10;
$fill_e = imagecolorallocate($id_base, 90, 90, 0);
$fill_i = imagecolorallocate($id_base, 90, 0, 0);
$bord_c = imagecolorallocate($id_base, 0, 255, 0);
imagerectangle($id_base, 68, 61, 554, 190, $bord_c);
imagerectangle($id_base, 72, 65, 550, 186, $bord_c);
imagefilltoborder($id_base,
$internal_x,
$internal_y,
$bord_c, $fill_i);
imagefilltoborder($id_base,
$external_x,
$external_y,
$bord_c,
$fill_e);
imagepng($id_base, $dest_img, 9);
echo $dest_img; ?><br><br>
<img src="<?php echo $dest_img; ?>"
alt="<?php echo $dest_img; ?>"
title="<?php echo $dest_img; ?>" width="400"><br>
<?php
echo 'PHP VERSION: ' . PHP_VERSION . '<br><br>';
$base_img = 'png/PNG 071 02.png';
$dest_img = 'png/PNG 071 02 imagefilltoborder.png';
echo $base_img; ?><br><br>
<img src="<?php echo $base_img; ?>"
alt="<?php echo $base_img; ?>"
title="<?php echo $base_img; ?>" width="400"><br><br><br>
<?php
$id_base = imagecreatefrompng($base_img);
$internal_x = 378;
$internal_y = 264;
$fill_c = imagecolorallocate($id_base, 255, 255, 255);
$bord_c = imagecolorallocate($id_base, 0, 255, 0);
imagerectangle($id_base, 68, 61, 554, 190, $bord_c);
imagerectangle($id_base, 72, 65, 550, 186, $bord_c);
imagefilltoborder($id_base,
$internal_x,
$internal_y,
$bord_c,
$fill_c);
imagepng($id_base, $dest_img, 9);
echo $dest_img; ?><br><br>
<img src="<?php echo $dest_img; ?>"
alt="<?php echo $dest_img; ?>"
title="<?php echo $dest_img; ?>" width="400"><br>
<?php
echo 'PHP VERSION: ' . PHP_VERSION . '<br><br>';
$base_img = 'png/PNG 071 02.png';
$dest_img = 'png/PNG 071 03 imagefilltoborder.png';
echo $base_img; ?><br><br>
<img src="<?php echo $base_img; ?>"
alt="<?php echo $base_img; ?>"
title="<?php echo $base_img; ?>" width="400"><br><br><br>
<?php
$id_base = imagecreatefrompng($base_img);
$internal_x = 336;
$internal_y = 144;
$fill_c = imagecolorallocate($id_base, 255, 255, 255);
$bord_c = imagecolorallocate($id_base, 0, 255, 0);
imagerectangle($id_base, 68, 61, 554, 190, $bord_c);
imagerectangle($id_base, 72, 65, 550, 186, $bord_c);
imagefilltoborder($id_base,
$internal_x,
$internal_y,
$bord_c,
$fill_c);
imagepng($id_base, $dest_img, 9);
echo $dest_img; ?><br><br>
<img src="<?php echo $dest_img; ?>"
alt="<?php echo $dest_img; ?>"
title="<?php echo $dest_img; ?>" width="400">