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);
    ?>
  • 相关阅读:
    第三次作业
    第二实验
    第一次作业
    yii2 Modal的使用
    yii2 显示列表字段 的技巧
    YII2在使用activeForm设置默认值
    html基础1
    tomcat+redis实现session共享缓存
    linux部署mongodb及基本操作
    hadoop 常用命令
  • 原文地址:https://www.cnblogs.com/hengyi123/p/3765237.html
Copyright © 2011-2022 走看看