18c03-2.php

来自「介绍PHP5的给类型函数应用」· PHP 代码 · 共 24 行

PHP
24
字号
<?php// Create a blank image to test with.$gfx = imagecreatetruecolor(200, 200);// Declare a white background$white = imagecolorallocate($gfx, 255, 255, 255);// Make the entire background whiteimagefilledrectangle($gfx, 0, 0, 199, 199, $white);// Now make three alpha colors, each fairly transparent.$blue = imagecolorallocatealpha($gfx, 0, 0, 255, 100);$green = imagecolorallocatealpha($gfx, 0, 255, 0, 100);$red = imagecolorallocatealpha($gfx, 255, 0, 0, 100);// Draw the circles on the image overlapping:imagefilledellipse($gfx, 133, 67, 100, 100, $blue);imagefilledellipse($gfx, 67, 67, 100, 100, $green);imagefilledellipse($gfx, 100, 133, 100, 100, $red);// Output our sample as a PNGheader('Content-type: image/png');imagepng($gfx);?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?