文档归类:编程开发
文本水印我们使用函数watermark_text()来生成文本水印,你必须先指定字体源文件、字体大小和字体文本,具体代码如下:1$font_path = "GILSANUB.TTF"; // Font file2$font_size = 30; // in pixcels3$water_mark_text_2 = "phpfuns"; // Watermark Text45function watermark_text($oldimage_name, $new_image_name)6{7global $font_path, $font_size, $water_mark_text_2;8list($owidth,$oheight) = getimagesize($oldimage_name);9$width = $height = 300;10$image = imagecreatetruecolor($width, $height);11$image_src = imagecreatefromjpeg($oldimage_name);12imagecopyresampled($image, $image_src, 0, 0, 0, 0, $width, $height, $owidth, $oheight);13$blue = imagecolorallocate($image, 79, 166, 185);14imagettftext($image, $font_size, 0, 68, 19...
抓住机会,赶紧看完»