bool imageline ( resource image, int x1, int y1, int x2, int y2, int color )
imageline() 用 color 颜色在图像 image 中从坐标 x1,y1 到 x2,y2(图像左上角为 0, 0)画一条线段。

解决方案 »

  1.   

    <?php
    $img = imagecreatetruecolor(200, 200);
    $white = imagecolorallocate($img, 255, 255, 255);
    $black = imagecolorallocate($img, 0, 0, 0);
    //横线
    imageline($img, 10, 50, 100, 50, $white);
    //竖线
    imageline($img, 10, 80, 10, 180, $white);
    header("Content-type: image/png");
    imagepng($img);
    imagedestroy($img);
    ?> 主要是看x1 x2 y1 y2
      

  2.   

    嘿嘿,你是要在html页面上加线吧,上面的方法输出的是一个图片,自然不能加按钮了.加横线可以用<hr>
    竖线....用div或table或其它结合css的border即可,横线也可以这样.