PHP kullanarak bir tarih resim filigran nasıl uygulanır

2 Cevap php

Nasıl bir filigran PHP kullanarak bir tarih resme uygulayabilirsiniz?

Örnek LINK: http://www.kitebeaches.com/kitesurf/uploadPicture/NIRVANA%5FClub%5FVillage.html

2 Cevap

Bu deneyin (adapte sitepoint):

<?php  

header('content-type: image/jpeg');  
$yourimagefile = 'something.jpg' // the image you're wanting to watermark
$watermark = imagecreatefrompng('watermark.png');  // the watermark
$watermark_width = imagesx($watermark);  
$watermark_height = imagesy($watermark);  
$image = imagecreatetruecolor($watermark_width, $watermark_height);  
$image = imagecreatefromjpeg($yourimagefile);  
$size = getimagesize($yourimagefile);  
$dest_x = $size[0] - $watermark_width - 5;  
$dest_y = $size[1] - $watermark_height - 5;  
imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, 100);  
imagejpeg($image);  
imagedestroy($image);  
imagedestroy($watermark);