contents   index   previous   next



GD getPixel()

syntax:

gd.getPixel(x, y)

gd.getPixel(point)

where:

x - horizontal position of pixel, measured from left

 

y - vertical position of pixel, measured from top

 

point - A point specification.

 

return:

number - a color index indicating the color at the selected pixel.

 

description:

This method accesses the pixel at position (x, y), and returns the color of that pixel. If the pixel coordinates are out of bounds, then zero is returned.

 

see:

#link <gd>, GD SetPixel()

 

example:

var gd = GD.fromGif("test.gif");

gd.getPixel(0,0);

gd.getPixel( [0,0] );

gd.getPixel( {x:0,y:0} );

 


GD getTransparent()