|
|
|
การใส่ watermark ด้วยโค้ดภาษา php หรือ javascript ครับ |
|
|
|
|
|
|
|
Code (PHP)
<?php
echo "<img src=MyResize/image.png>";
$myImage = imagecreatefromjpeg('mygirl.jpg');
$myCopyright = imagecreatefromjpeg('thaicreate.jpg');
$destWidth = imagesx($myImage);
$destHeight = imagesy($myImage);
$srcWidth = imagesx($myCopyright);
$srcHeight = imagesy($myCopyright);
$destX = ($destWidth - $srcWidth) / 2;
$destY = ($destHeight - $srcHeight) / 1;
$white = imagecolorexact($myCopyright, 255, 255, 255);
imagecolortransparent($myCopyright, $white);
imagecopymerge($myImage, $myCopyright, $destX, $destY, 0, 0, $srcWidth, $srcHeight, 50);
imagejpeg($myImage,"MyResize/image.png");
imagedestroy($myImage);
imagedestroy($myCopyright);
?>
Go to : PHP Add Logo/CopyRight to Image (Watermark)
|
|
|
|
|
Date :
2010-08-06 11:45:03 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณครับ
|
|
|
|
|
Date :
2010-08-07 16:05:24 |
By :
สายฟ้า |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|