function

gd_get_pixel . gd . sncode

VERSIONlatest Get a pixel from image.

GD_GET_PIXEL(1e)

NAME

gd_get_pixel - Gets a pixel from an image.

SYNOPSIS

gd_get_pixel (gd:variable, x:integer, y:integer);

DESCRIPTION

This function is used to get a pixel form Image.

PARAMETERS

gd
Variable must hold a returned value from gd_new.
x,y
Point in image.

RETURN

Returns a context with reg, green and blue value.

MODULES

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"
}

EXAMPLES

res=<{
        %include "/includes/gd.sn";
        remove("/html/images/bg.gif");
        im=gd_new(width:100,height:110,bgcolor:Yellow,truecolor:true);
        gd_write(gd:im, format:"gif", filename:"/html/images/bg.gif");
        gd_get_size(im);
        gd_get_pixel(gd:im,x:0,y:0);
        gd_free(gd:im);}>. return

res={"width":100,"height":110}{"green":255,"blue":0,"red":255,"color":16776960}.));

AUTHOR

Written by Pierre Laplante and Caroline Laplante, <laplante@sednove.com>