Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

imagesetpixel(3) [php man page]

IMAGESETPIXEL(3)							 1							  IMAGESETPIXEL(3)

imagesetpixel - Set a single pixel

SYNOPSIS
bool imagesetpixel (resource $image, int $x, int $y, int $color) DESCRIPTION
imagesetpixel(3) draws a pixel at the specified coordinate. PARAMETERS
o $ image -An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(3). o $x - x-coordinate. o $y - y-coordinate. o $color - A color identifier created with imagecolorallocate(3). RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 imagesetpixel(3) example A random drawing that ends with a regular picture. <?php $x = 200; $y = 200; $gd = imagecreatetruecolor($x, $y); $corners[0] = array('x' => 100, 'y' => 10); $corners[1] = array('x' => 0, 'y' => 190); $corners[2] = array('x' => 200, 'y' => 190); $red = imagecolorallocate($gd, 255, 0, 0); for ($i = 0; $i < 100000; $i++) { imagesetpixel($gd, round($x),round($y), $red); $a = rand(0, 2); $x = ($x + $corners[$a]['x']) / 2; $y = ($y + $corners[$a]['y']) / 2; } header('Content-Type: image/png'); imagepng($gd); ?> The above example will output something similar to:[NOT DISPLAYABLE MEDIA]Output of example : imagesetpixel() SEE ALSO
imagecreatetruecolor(3), imagecolorallocate(3), imagecolorat(3). PHP Documentation Group IMAGESETPIXEL(3)

Check Out this Related Man Page

IMAGEFILLEDELLIPSE(3)							 1						     IMAGEFILLEDELLIPSE(3)

imagefilledellipse - Draw a filled ellipse

SYNOPSIS
bool imagefilledellipse (resource $image, int $cx, int $cy, int $width, int $height, int $color) DESCRIPTION
Draws an ellipse centered at the specified coordinate on the given $image. PARAMETERS
o $ image -An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(3). o $cx - x-coordinate of the center. o $cy - y-coordinate of the center. o $width - The ellipse width. o $height - The ellipse height. o $color - The fill color. A color identifier created with imagecolorallocate(3). RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 imagefilledellipse(3) example <?php // create a blank image $image = imagecreatetruecolor(400, 300); // fill the background color $bg = imagecolorallocate($image, 0, 0, 0); // choose a color for the ellipse $col_ellipse = imagecolorallocate($image, 255, 255, 255); // draw the white ellipse imagefilledellipse($image, 200, 150, 300, 200, $col_ellipse); // output the picture header("Content-type: image/png"); imagepng($image); ?> The above example will output something similar to:[NOT DISPLAYABLE MEDIA]Output of example : imagefilledellipse() NOTES
Note This function requires GD 2.0.1 or later (2.0.28 or later is recommended). SEE ALSO
imageellipse(3), imagefilledarc(3). PHP Documentation Group IMAGEFILLEDELLIPSE(3)
Man Page