manipulate_text.php
来自「《PHP专业项目实例开发》源代码」· PHP 代码 · 共 35 行
PHP
35 行
<html>
<head>
</head>
<body>
<?php
$img=ImageCreate(300,300);
$bgcolor=ImageColorAllocate($img,200,200,200);
$red=ImagecolorAllocate($img,255,0,0);
$green=ImagecolorAllocate($img,0,255,0);
$blue=ImagecolorAllocate($img,0,0,255);
$grey=ImagecolorAllocate($img,50,50,50);
$black=ImagecolorAllocate($img,0,0,0);
for ($i=0;$i<6;$i++)
{
ImageChar($img,$i,20,20+($i*20),"S",$red);
$height[]=Imagefontheight($i);
$width[]=Imagefontwidth($i);
}
/*
RGB Red = 0..255 , Green = 0..255 , Blue = 0..255.
*/
ImageSetPixel($img,50,50,$pixelcolor);
ImagePNG($img,"pic.png");
ImageDestroy($img);
for ($i=0;$i<6;$i++)
{
echo "font ".$i." height=".$height[$i]."<br>";
}
?>
<img src="pic.png" border=0>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?