zoukankan      html  css  js  c++  java
  • php基础教程:图像函数举例(3)

    php基础教程:图像函数举例(3)

    例二: 阴阳图

     

    <?php
    $width=400;
    $height=400;
    $image=imagecreatetruecolor($width,$height);
    //提取颜色
    $color_black=imagecolorallocate($image,0,2,0);//
    $color_white=imagecolorallocate($image,255,255,255);//白色
    $color_blue=imagecolorallocate($image,0,0,108);//蓝色
    $color_red=imagecolorallocate($image,151,0,4);//红色
    $color_my=imagecolorallocate($image,192,192,255);//背景
    $color_temp=imagecolorallocate($image,199,199,199);//背景
    //作图
    imagefill($image,0,0,$color_white);
    //第一个是大圆
    imagefilledarc ($image,$width/2,$height/2,$height,$height,0,360,$color_blue,IMG_ARC_PIE);
    //两个小圆
    imagefilledellipse ($image,$width/2,$height/4 ,$height/2,$height/2,$color_red);
    imagefilledellipse ($image,$width/2,$height/4 * 3,$height/2,$height/2,$color_blue);
    /*imagefilledellipse -- 画一椭圆并填充*/(昆明男科医院)
    imagefilledarc ($image,$width/2,$height/2,$height,$height,-90,90,$color_red,IMG_ARC_PIE);
    imagefilledellipse ($image,$width/2,$height/4 * 3,$height/2,$height/2,$color_blue);
    //发送对象至头
    header('content-type:image/png');
    imagepng($image);
    /*
    //发送对象至文件
    $filename="ex1.png";
    imagepng($image,$filename);
    */
    //销毁对象
    imagedestroy($image);
    ?>
  • 相关阅读:
    IP路由选择过程
    Netstat命令详解
    路由器的硬件结构
    路由器发展编年史 完结篇
    制作自己博客园文章签名
    路由器发展编年史 发展篇
    距离矢量路由协议_(4)
    路由器的基本功能
    分组交换、报文交换、电路交换
    动态路由中的几种常见metric
  • 原文地址:https://www.cnblogs.com/hengyi123/p/3765237.html
Copyright © 2011-2022 走看看