Jump to content
php.lv forumi

bilde iekš bildē


p4F

Recommended Posts

Man liekas ka to sauc par udenszimi "Watermark" - angliski.

 

<?php
header('Content-Type: image/jpeg');

function watermark($image, $mark, $opacity=10){

list($i_width, $i_height) = getimagesize($image);
list($m_width, $m_height) = getimagesize($mark);

$src_x = $i_width  - $m_width;
$src_y = $i_height - $m_height;

$image = imagecreatefromjpeg($image);
$mark  = imagecreatefromgif($mark);

imagecopymergegray($image, $mark, $src_x, $src_y, 0, 0, $m_width, $m_height, $opacity);

return imagejpeg($image);
}

watermark('hamster.jpg', 'mark.gif', 50);

?>

Link to comment
Share on other sites

×
×
  • Create New...