Warning: include(../lntop.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/imagesetstyle.html on line 19

Warning: include() [function.include]: Failed opening '../lntop.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/imagesetstyle.html on line 19

Warning: include(../levoe_menu.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/imagesetstyle.html on line 46

Warning: include() [function.include]: Failed opening '../levoe_menu.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/imagesetstyle.html on line 46



Учебник РНР
НазадВперёд

imagesetstyle

(PHP 4 >= 4.0.6)

imagesetstyle - устанавливает стиль рисования линии.

Описание

int imagesetstyle (resource image, array style)

imagesetstyle() устанавливает стиль, используемый всеми функциями рисования линий (такими как imageline() и imagepolygon()), при рисовании специальным цветом IMG_COLOR_STYLED или линий изображения цветом IMG_COLOR_STYLEDBRUSHED.

Параметр style это массив пикселов. Следующий пример скрипта рисует пунктирную линию из верхнего левого в правый нижний угол канвы:
Пример 1. imagesetstyle
<?php
header ("Content-type: image/png");
$im  = imagecreate (100, 100);
$w   = imagecolorallocate ($im, 255, 255, 255);
$red = imagecolorallocate ($im, 255, 0, 0);

/* Рисует пунктирную линию: 5 красных пикселов, 5 белых */
$style = array ($red,$red,$red,$red,$red,$w,$w,$w,$w,$w);
imagesetstyle ($im, $style);
imageline ($im, 0, 0, 100, 100, IMG_COLOR_STYLED);

/* Рисует линию счастливого детства с использованием imagesetbrush() и 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);
?>

См. также imagesetbrush(), imageline().

Примечание: эта функция была введена в PHP 4.0.6.


Назад Оглавление Вперёд
imagesetpixel Вверхimagesetthickness


Warning: include(../pravoe_menu.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/imagesetstyle.html on line 165

Warning: include() [function.include]: Failed opening '../pravoe_menu.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/imagesetstyle.html on line 165

Rambler's Top100
© 2009 Тест скорости интернета |  Boont.Ru

Warning: include(../lnbottom.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/imagesetstyle.html on line 291

Warning: include() [function.include]: Failed opening '../lnbottom.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/imagesetstyle.html on line 291