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);

  • 相关阅读:
    Jsp补充
    Jsp和Servlet关系
    ServletContext简介
    利用Session实现三天免登陆
    Cookie简介
    JSP简介
    线程基础--同步机制
    深思——工作面试
    response.setcontenttype的參数
    Codeforces 96D Volleyball spfa
  • 原文地址:https://www.cnblogs.com/syqlwyx/p/11861806.html
Copyright © 2011-2022 走看看