zoukankan      html  css  js  c++  java
  • PHP imagearc

    imagearc — 用于画椭圆弧。高佣联盟 www.cgewang.com

    语法

    bool imagearc ( resource $image , int $cx , int $cy , int $w , int $h , int $s , int $e , int $color )

    imagearc() 以 cx,cy(图像左上角为 0, 0)为中心在 image 所代表的图像中画一个椭圆弧。

    w 和 h 分别指定了椭圆的宽度和高度,起始和结束点以 s 和 e 参数以角度指定。0°位于三点钟位置,以顺时针方向绘画。

    实例

    <?php
    $img = imagecreatetruecolor(200, 200);// 创建一个 200*200 图片
    $white  = imagecolorallocate($img,   255,   255, 255); // 颜色
    
    // 画椭圆弧
    imagearc($img, 140,  75,  50,  50,  0, 360, $white);
    
    // 浏览器输出图片
    header("Content-type: image/png");
    imagepng($img);
    
    imagedestroy($img);
    ?>

    以上实例输出结果的图片如下:

  • 相关阅读:
    近期目标
    HDU
    BZOJ
    UVALive
    UVA
    HNOI2004 宠物收养所 (平衡二叉树)
    UVA
    HDU
    POJ
    康托展开与逆康托展开模板(O(n^2)/O(nlogn))
  • 原文地址:https://www.cnblogs.com/yc10086/p/13155927.html
Copyright © 2011-2022 走看看