מדריך PHP
קודם
הבא
דוגמה 1. imagesetstyle
?php header ("Content-type: image / png"); $im = imagecreate (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"); imagecolortransparent ($brush, $w); imagesetbrush ($im, $brush); imageline ($im, 100, 0, 0, 100, IMG_COLOR_STYLEDBRUSHED); imagepng ($im); imagedestroy ($im);?
הערה:
קודם
ראשי
הבא
למעלה