zoukankan      html  css  js  c++  java
  • 3-1图形绘制的基础

     1 <?php
     2 /**
     3  * 图形绘制
     4  * 绘画复杂图形
     5  *
     6  */
     7 
     8 //$im = imagecreatetruecolor(400, 200);
     9 //$back = imagecolorallocate($im, mt_rand(200, 255), mt_rand(200, 255), mt_rand(200, 255));
    10 
    11 //imagefill($im, 0, 0, $back);
    12 
    13 //画点
    14 //$black = imagecolorallocate($im,10,10,10);
    15 //for($i=0;$i<150;$i++)
    16 //{
    17 //    imagesetpixel($im,mt_rand(10,390),mt_rand(10,190),$black);
    18 //}
    19 
    20 //画线
    21 //$red = imagecolorallocate($im, 10, 0, 0);
    22 //for($j = 0; $j < 3; $j++)
    23 //{
    24 //    imageline($im, mt_rand(10, 400), mt_rand(10, 200), mt_rand(10, 400), mt_rand(10, 200), $red);
    25 
    26 //}
    27 
    28 //设置线条粗细
    29 //imagesetthickness($im,5);
    30 //imageline($im, mt_rand(10, 400), mt_rand(10, 200), mt_rand(10, 400), mt_rand(10, 200), $red);
    31 
    32 //$style = array($red,$red,$red,$red,$red,$back,$back,$back,$back,$back);
    33 
    34 //设置划线的风格
    35 //imagesetstyle($im,$style);
    36 
    37 //设置划线的风格
    38 //imageline($im,10,50,250,200,IMG_COLOR_STYLED);
    39 
    40 //画矩形
    41 //imagerectangle($im,50,50,150,150,$red);
    42 
    43 //画圆
    44 //imageellipse($im,200,100,100,100,$red);
    45 
    46 //header('Content-Type:image/jpeg');
    47 //imagejpeg($im, null, 70);
  • 相关阅读:
    sublime there are no packages for installation
    linux 安装php扩展mbstring
    生成器表达式和列表推导式
    send()和next()
    迭代器生成器
    装饰器
    函数随笔
    Django进阶
    数据结构与算法入门
    MySQL必会
  • 原文地址:https://www.cnblogs.com/kay-learning/p/8973156.html
Copyright © 2011-2022 走看看