zoukankan      html  css  js  c++  java
  • 20191114PHP图像绘制

    <?php
    ob_clean();
    $img=imagecreate(400,400);
    $back=imagecolorallocate($img,200,200,100);

    $blue=imagecolorallocate($img,100,0,200);
    $red=imagecolorallocate($img,200,50,50);
    $r1=imagecolorallocate($img,100,200,120);
    imagesetpixel($img,200,200,$blue);

    imageline($img,0,0,400,400,$blue);
    imageline($img,0,400,400,00,$blue);
    imagerectangle($img,100,100,300,300,$blue);
    imageellipse($img,200,200,200,200,$blue);
    imagearc($img,200,200,300,300,225,315,$blue);

    imagefill($img,200,180,$red);
    imagefill($img,200,220,$blue);

    imagefilledrectangle($img,180,180,220,220,$r1);
    // for($i=0;$i<50;$i++){
    // $clr=imagecolorallocate($img,rand(0,200),rand(0,200),rand(0,200));
    // $n=5*$i;
    // imagerectangle($img,180-$n,180-$n,220+$n,220+$n,$blue);
    // }

    imagechar($img,5,195,195,"A",$red);
    imagestring($img,5,150,320,"Hello World",$red);
    // imagettftext($img,30,0,100,100,$red,"msyh.ttf","重庆");

    header("Content-type:image/jpeg");
    imagejpeg($img);
    imagedestroy($img);

  • 相关阅读:
    入门学习
    SQL语句
    Jmeter录制badboy
    post方式提交数据
    get向服务器提交数据
    手机端解析json
    生成JSON字符串
    新闻客户端
    从网络下载的图片加缓存功能
    消息队列机制messageQuene
  • 原文地址:https://www.cnblogs.com/syqlwyx/p/11861806.html
Copyright © 2011-2022 走看看