⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 image2.php

📁 乐于奉献 乐于奉献 乐于奉献 乐于奉献 乐于奉献 乐于奉献
💻 PHP
字号:
<?
  Header("Content-type: image/png");
  $im = ImageCreate (200, 100);
  $col_blk = ImageColorAllocate($im, 0,0,0);
  $col_orn = ImageColorAllocate($im, 255,192,0);
  $col_red = ImageColorAllocate($im, 255,0,0);
  $col_grn = ImageColorAllocate($im, 0,255,0);
  $col_blu = ImageColorAllocate($im, 0,0,255);
  
  ImageSetPixel($im,20,10,$col_orn);
  // 小小一个点,不知道能否看得见?
  ImageRectangle($im,25,20,95,55,$col_blu);
  // 蓝色的矩形。
  ImageArc($im,20,85,50,40,225,360,$col_grn);
  // 绿色的椭圆弧,中心在(20,85),横轴50,纵轴40,225度至360度。
  // 由此可见,这里的圆弧始、终点是以角度计量,
  // 是以水平向右的方向为0度,顺时针计算的。
  ImageArc($im,160,60,40,40,0,360,$col_orn);
  // 橙色的整圆。只要横轴长与纵轴长相等,就是正圆。
  // 上高中我们就学过:圆是椭圆的特例嘛!
  // 最后再画一段圆弧。圆心能否在图象以外?
  ImageArc($im,160,140,240,240,0,360,$col_red);
  // 可以!
  
  ImagePNG($im);
  ImageDestroy($im);
?>

⌨️ 快捷键说明

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