note 113957 added to function.imagesetstyle
| From: | programeriss at gmail dot com | Date: | Sun, 22 Dec 2013 15:18:14 +0000 |
| Subject: | note 113957 added to function.imagesetstyle | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-198000@lists.php.net to get a copy of this message | ||
Good code:
<?php
header("Content-Type: image/png");
$im = imagecreatetruecolor(100, 100);
$w = imagecolorallocate($im, 255, 255, 255);
$red = imagecolorallocate($im, 255, 0, 0);
/* Draw a dashed line, 5 red pixels, 5 white pixels */
$style = array($red, $red, $red, $red, $red, $w, $w, $w, $w, $w);
imagesetstyle($im, $style);
imageline($im, 0, 0, 100, 100, IMG_COLOR_STYLED);
/* Draw a line of happy faces using imagesetbrush() with imagesetstyle */
$style = array($w, $w, $w, $w, $w, $w, $w, $w, $w, $w, $w, $w, $red);
imagesetstyle($im, $style);
$brush = imagecreatefrompng("http://www.libpng.org/pub/png/images/smile.happy.png");
$w2 = imagecolorallocate($brush, 255, 255, 255);
imagecolortransparent($brush, $w2);
imagesetbrush($im, $brush);
imageline($im, 100, 0, 0, 100, IMG_COLOR_STYLEDBRUSHED);
imagejpeg($im);
imagedestroy($im);
?>
----
Server IP: 72.52.91.14
Probable Submitter: 72.52.91.14
----
Manual Page -- http://php.net/manual/en/function.imagesetstyle.php
Edit -- https://master.php.net/note/edit/113957
Del: integrated -- https://master.php.net/note/delete/113957/integrated
Del: useless -- https://master.php.net/note/delete/113957/useless
Del: bad code -- https://master.php.net/note/delete/113957/bad+code
Del: spam -- https://master.php.net/note/delete/113957/spam
Del: non-english -- https://master.php.net/note/delete/113957/non-english
Del: in docs -- https://master.php.net/note/delete/113957/in+docs
Del: other reasons-- https://master.php.net/note/delete/113957
Reject -- https://master.php.net/note/reject/113957
Search -- https://master.php.net/manage/user-notes.php