Query: imagesetpixel
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
IMAGESETPIXEL(3) 1 IMAGESETPIXEL(3) imagesetpixel - Set a single pixelSYNOPSISbool imagesetpixel (resource $image, int $x, int $y, int $color)DESCRIPTIONimagesetpixel(3) draws a pixel at the specified coordinate.PARAMETERSo $ 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 VALUESReturns TRUE on success or FALSE on failure.EXAMPLESExample #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 ALSOimagecreatetruecolor(3), imagecolorallocate(3), imagecolorat(3). PHP Documentation Group IMAGESETPIXEL(3)
Related Man Pages |
---|
imagecolortransparent(3) - php |
imagechar(3) - php |
imagecharup(3) - php |
imagefilledellipse(3) - php |
imagerectangle(3) - php |
Similar Topics in the Unix Linux Community |
---|
watches : ALL LUXURY BRANDS WATCHES JUST $200 |
Sorting numerically considering both negative and positve numbers |