imagesetstyle

(PHP 4 >= 4.0.6, PHP 5, PHP 7)

imagesetstyle锟借定锟斤拷锟竭的凤拷锟�

说锟斤拷

imagesetstyle ( resource $image , array $style ) : bool

imagesetstyle() 锟借定锟斤拷锟叫伙拷锟竭的猴拷锟斤拷锟斤拷锟斤拷锟斤拷 imageline() 锟斤拷 imagepolygon()锟斤拷锟斤拷使锟斤拷锟斤拷锟斤拷锟斤拷色 IMG_COLOR_STYLED 锟斤拷锟斤拷锟斤拷 IMG_COLOR_STYLEDBRUSHED 锟斤拷一锟斤拷图锟斤拷时锟斤拷使锟矫的凤拷锟�

锟斤拷锟斤拷

image

锟斤拷图锟襟创斤拷锟斤拷锟斤拷(锟斤拷锟斤拷imagecreatetruecolor())锟斤拷锟截碉拷图锟斤拷锟斤拷源锟斤拷

style

锟斤拷锟斤拷锟斤拷傻锟斤拷锟斤拷椤o拷锟斤拷锟斤拷通锟斤拷锟斤拷锟斤拷 IMG_COLOR_TRANSPARENT 锟斤拷锟斤拷锟揭伙拷锟酵革拷锟斤拷锟斤拷亍锟�

锟斤拷锟斤拷值

锟缴癸拷时锟斤拷锟斤拷 TRUE锟斤拷 锟斤拷锟斤拷锟斤拷失锟斤拷时锟斤拷锟斤拷 FALSE锟斤拷

锟斤拷锟斤拷

锟斤拷锟斤拷锟绞撅拷锟斤拷疟锟斤拷诨锟斤拷锟斤拷洗锟斤拷锟斤拷辖堑锟斤拷锟斤拷陆腔锟揭伙拷锟斤拷锟斤拷撸锟�

Example #1 imagesetstyle() 锟斤拷锟斤拷

<?php
header
("Content-type: image/jpeg");
$im  imagecreatetruecolor(100100);
$w   imagecolorallocate($im255255255);
$red imagecolorallocate($im25500);

/* 锟斤拷一锟斤拷锟斤拷锟竭o拷5 锟斤拷锟斤拷色锟斤拷锟截o拷5 锟斤拷锟斤拷色锟斤拷锟斤拷 */
$style = array($red$red$red$red$red$w$w$w$w$w);
imagesetstyle($im$style);
imageline($im00100100IMG_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");
$w2 imagecolorallocate($brush255255255);
imagecolortransparent($brush$w2);
imagesetbrush($im$brush);
imageline($im10000100IMG_COLOR_STYLEDBRUSHED);

imagejpeg($im);
imagedestroy($im);
?>

锟斤拷锟斤拷锟斤拷锟教碉拷锟斤拷锟斤拷锟斤拷锟斤拷冢锟�

Output of example : imagesetstyle()

锟轿硷拷

  • imagesetbrush() - 锟借定锟斤拷锟斤拷锟矫的伙拷锟斤拷图锟斤拷
  • imageline() - 锟斤拷一锟斤拷锟竭讹拷