gd_get_pixel

Get a pixel from image.

GD_GET_PIXEL

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}.));

SEE ALSO

AUTHOR

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

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.