gd_polygon - Draws a polygon.
gd_polygon (gd:variable, polygon:array, color:"string", closed:true|false,filled:true|false, thickness:integer, coloridx:integer);
This function is used to draw a polygon.
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:Gray,truecolor:true);
red = gd_get_color(gd:im, color:Red);
cyan = gd_get_color(gd:im, color:Cyan);
white = gd_get_color(gd:im, color:White);
gd_polygon(gd:im, polygon:[ [10,10], [10, 500], [500, 500], [500, 10]], color:Yellow, thickness:2,filled:true);
gd_polygon(gd:im, polygon:[ [40,40], [200,259], [332, 644], [500, 10], [700,700]], color:Red, thickness:1,closed:false);
gd_write(gd:im,format:"jpg",filename:"/html/images/print.jpg",quality:100);
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