Home > Article > Backend Development > PHP simply supports Chinese watermark program code_PHP tutorial
The article introduces a simple watermark program that can add Chinese characters to pictures. Friends who need to know more can refer to it.
The code is as follows
|
Copy code | ||||
// **************************************** //
// Function: Add text to pictures
// Parameter: $img image file name
// $new_img Save the image file name. If it is empty, it means not to save the image
// $text string content
// text_size string size
// text_angle font string output angle
// text_x string output x coordinate
// text_y string output y coordinate
// $text_font font file name
// $r,$g,$b string color RGB value
// **************************************** //
function img_text($img, $new_img, $text, $text_size, $text_angle, $text_x, $text_y, $text_font, $r, $g, $b){