I have this code for watermarking text onto an image
if($type==".jpg" or $type==".jpeg"){
$im = imagecreatefromjpeg($uploaddir.$randnum);
}elseif($type==".gif"){
$im = imagecreatefromgif($uploaddir.$randnum);
}else{
$im = imagecreatefrompng($uploaddir.$randnum);
}
$imagesize = getimagesize($uploaddir.$randnum);
$x_offset = 7;
$y_offset = 8;
$textcolor = imagecolorallocate($im, 0xCC, 0xCC, 0xCC);
$textcolor2 = imagecolorallocate($im, 0x00, 0x00, 0x00);
imagestring($im, 5, $x_offset, $y_offset, strtoupper($_POST['code']), $textcolor2);
if($type==".jpg" or $type==".jpeg"){
imagejpeg($im,$uploaddir.$randnum,100);
}elseif($type==".gif"){
imagegif($im,$uploaddir.$randnum,100);
}else{
imagepng($im,$uploaddir.$randnum,8);
}
The code above is printing the watermark in the top left… But I want it to be written on the bottom in the right.
any help guys
regards
Try using this where you’re currently using
imagestring().Change
$marginand$font_sizeto meet your needs.