PHP let the text generate a picture code

xiaoxiao2021-03-06  115

Header ("Content-Type: Image / PNG");

$ IM = ImageCreate (400, 50);

$ bkg = imagecoloralloccate ($ IM, 128, 64, 225);

$ CLR = ImageColoralLocate ($ IM, 255, 255, 255);

$ fnt = "c: /winnt/fonts/simsun.ttc"; // linux is changed to the font base path under Linux

$ Str = iconv ("GB2312", "UTF-8", "Welcome");

ImageTfText ($ IM, 20, 0, 230, 40, $ CLR, $ FNT, $ STR);

$ black = imagecolorallocate ($ IM, 0, 0, 0);

$ white = imagecoloralloccate ($ IM, 255, 255, 255);

ImageLine ($ IM, 1, 1, 350, 25, $ black);

Imagearc ($ IM, 200, 15, 20, 20, 35, 190, $ WHITE);

ImageString ($ IM, 5, 4, 10, "Graph Test !!", $ White);

ImagePNG ($ IM);

ImageDestroy ($ IM);

?>

转载请注明原文地址:https://www.9cbs.com/read-103738.html

New Post(0)