Copy and merge part of an image with 75% transparency in PHP

Description

The following code shows how to copy and merge part of an image with 75% transparency.

Example


<?php// ww w .ja  v  a  2 s  .  c  o m
// Create image instances
$dest = imagecreatefromgif('php.gif');
$src = imagecreatefromgif('php.gif');

// Copy and merge
imagecopymerge($dest, $src, 10, 10, 0, 0, 100, 47, 75);

// Output and free from memory
header('Content-Type: image/gif');
imagegif($dest);

imagedestroy($dest);
imagedestroy($src);
?>

The code above generates the following result.

Copy and merge part of an image with 75% transparency in PHP




















Home »
  PHP Tutorial »
    Image »




Color
Create
Font
Operation
Shape
Text