gd_line - Draws a line.
gd_line (gd:variable, x1:integer, y1:integer, x2:integer, y2:integer, color:"string", style: array, thickness:integer, coloridx:integer);
This function is used to draw a line between (x1,y1) and (x2,y2).
To use this module, you must specify the following in /usr/local/website/site.conf:
Module gd { Library : "/usr/local/lib/libsngd.so" Init : "sngd_init" }
res=<{ %include "/includes/gd.sn"; remove("/html/images/print.jpg"); im=gd_new(width:1000,height:1000,bgcolor:Blue,truecolor:true); coral = gd_get_color(gd:im, color:Coral); cyan = gd_get_color(gd:im, color:Cyan); gd_line(gd:im, x1:500, y1:500, x2:500,y2:300, thickness:20, style:[coral,cyan,null,color,null,white]); color = gd_get_color(gd:im, color:Yellow); color; gd_line(gd:im, x1:-100, y1:-100, x2:200,y2:900, color:White); gd_write(gd:im,format:"jpg",filename:"/html/images/print.jpg",quality:100); gd_free(im);
Written by Pierre Laplante and Caroline Laplante, <laplante@sednove.com>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
1.0 2014-09-09 21:24:14 laplante@sednove.com