Color and Image Fills : imagecreatefrompng « Graphics Image « PHP






Color and Image Fills

 
<?php
    $red = imagecolorallocate($image, 255, 0, 0);
    imagefill($image, 0, 0, $red);
    imagefilltoborder($image, 0, 0, $white, $red);


    $_GET['size'] = 44;
    $_GET['text'] = "Hello, world!";
    $size = imagettfbbox($_GET['size'], 0, "ARIAL", $_GET['text']);
    $xsize = 50;
    $ysize = 60;

    $image = imagecreate($xsize, $ysize);
    $blue = imagecolorallocate($image, 0, 0, 255);
    $white = ImageColorAllocate($image, 255,255,255);
    imagettftext($image, $_GET['size'], 0, abs($size[0]), $ysize, $white, "ARIAL",'asdfasdf');

    $bg = imagecreatefrompng("button_mini.png");
    imagesettile($image, $bg);
    imagefill($image, 0, 0, IMG_COLOR_TILED);
    header("content-type: image/png");

    imagepng($image);
    imagedestroy($image);
    imagedestroy($bg);
?>
  
  








Related examples in the same category

1.Create image object from PNG
2.Loading Existing Images