Add a php watermark to your image at any time. Add text to your picture at any time? Header (Content-type: imagejpeg); functionmakethumb ($ srcFile, $ text, $ size12, $ R0, $ G0, $ B0) {if (! $ Text) {$ textwelcomexs.net. ruxayle; $ size add text to your image at any time
Header ("Content-type: image/jpeg ");
Function makethumb ($ srcFile, $ text, $ size = 12, $ R = 0, $ G = 0, $ B = 0 ){
If (! $ Text ){
$ Text = 'Welcome xs.net.ru xayle ';
$ Size = 20;
$ R = 255;
}
$ Data = GetImageSize ($ srcFile, & $ info );
Switch ($ data [2]) {
Case 1: // image type. 1 is a GIF image.
$ Im = @ ImageCreateFromGIF ($ srcFile );
Break;
Case 2: // image type; 2: JPG
$ Im = @ imagecreatefromjpeg ($ srcFile );
Break;
Case 3: // the image type. 3 is a PNG image.
$ Im = @ ImageCreateFromPNG ($ srcFile );
Break;
}
$ SrcW = ImageSX ($ im );
$ SrcH = ImageSY ($ im );
$ Ni = imagecreatetruecolor ($ srcW, $ srcH );
Imagecopyresampled ($ ni, $ im, 0, 0, 0, $ srcW, $ srcH, $ srcW, $ srcH );
$ Font = "2.ttf ";
$ Textcolor = imagecolorallocate ($ ni, $ R, $ G, $ B); // Set text color
$ I = 0;
$ Txt = '';
$ Len = ceil (12*22)/$ size );
$ Lgg = ceil ($ size * 16)/12)-1;
While (strlen ($ txt)> 0 |! $ I ){
$ Start = $ len * $ I;
$ Kk = ceil ($ size * 13/12 );
// $ Kk = 13;
$ Txt = substr ($ text, $ start, $ len );
$ Hei = $ I * $ lgg + $ kk;
Imagettftext ($ ni, $ size, 0, 8, $ hei, $ textcolor, $ font, $ txt); // Write the text with a font
$ I ++;
}
ImageJpeg ($ ni );
}
If (! $ Size | $ size <1) $ size = 12;
Makethumb ("face.jpg", $ text, $ size, $ R, $ G, $ B );
?>
Why? Header ("Content-type: image/jpeg"); functionmakethumb ($ srcFile, $ text, $ size = 12, $ R = 0, $ G = 0, $ B = 0) {if (! $ Text) {$ text = 'welcomexs. net. ruxayle'; $ size...