imagexbm

(PHP 5, PHP 7)

imagexbm锟斤拷 XBM 图锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟侥硷拷

说锟斤拷

imagexbm ( resource $image , string $filename [, int $foreground ] ) : bool

锟斤拷 XBM 图锟斤拷 image 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟侥硷拷

锟斤拷锟斤拷

image

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

filename

锟侥硷拷锟斤拷锟斤拷锟铰凤拷锟斤拷锟斤拷锟斤拷未锟斤拷锟矫伙拷为 NULL锟斤拷锟斤拷锟斤拷直锟斤拷锟斤拷锟皆纪硷拷锟斤拷锟斤拷锟�

foreground

锟斤拷锟斤拷源锟� imagecolorallocate() 锟斤拷锟斤拷一锟斤拷锟斤拷色锟斤拷锟斤拷锟斤拷锟斤拷为锟斤拷前锟斤拷色锟斤拷锟斤拷锟斤拷 默锟斤拷锟斤拷色锟角猴拷色锟斤拷

锟斤拷锟斤拷值

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

锟斤拷锟斤拷

Example #1 锟斤拷锟斤拷一锟斤拷 XBM 锟侥硷拷

<?php
// 锟斤拷锟斤拷锟秸帮拷图锟斤拷锟斤拷锟斤拷锟斤拷锟�
$im imagecreatetruecolor(12020);
$text_color imagecolorallocate($im2331491);
imagestring($im155,  'A Simple Text String'$text_color);

// 锟斤拷锟斤拷图锟斤拷
imagexbm($im'simpletext.xbm');

// 锟酵凤拷锟节达拷
imagedestroy($im);
?>

Example #2 锟皆诧拷同前锟斤拷色锟斤拷锟斤拷一锟斤拷 XBM 锟侥硷拷

<?php
// 锟斤拷锟斤拷锟秸帮拷图锟斤拷锟斤拷锟斤拷锟斤拷锟�
$im imagecreatetruecolor(12020);
$text_color imagecolorallocate($im2331491);
imagestring($im155,  'A Simple Text String'$text_color);

// 锟斤拷锟斤拷锟芥换锟斤拷前锟斤拷色
$foreground_color imagecolorallocate($im25500);

// 锟斤拷锟斤拷图锟斤拷
imagexbm($imNULL$foreground_color);

// 锟酵凤拷锟节达拷
imagedestroy($im);
?>

注锟斤拷

Note: 锟剿猴拷锟斤拷锟斤拷锟斤拷锟斤拷 GD 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 PHP 锟芥本锟叫匡拷锟矫★拷