PHP字符串函數ltrim()的用法
769
2023-12-12
(PHP 4, PHP 5)
imagestring — 水平地畫一行字符串
$image
, int $font
, int $x
, int $y
, string $s
, int $col
)
imagestring() 用 col
顏色將字符串 s
畫到 image
所代表的圖像的 x
,y
坐標處(這是字符串左上角坐標,整幅圖像的左上角為 0,0)。如果
font
是 1,2,3,4 或 5,則使用內置字體。
Example #1 imagestring() 例子
<?php
// 建立一幅 100X30 的圖像
$im = imagecreate(100, 30);
// 白色背景和藍色文本
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 255);
// 把字符串寫在圖像左上角
imagestring($im, 5, 0, 0, "Hello world!", $textcolor);
// 輸出圖像
header("Content-type: image/png");
imagepng($im);
?>
參見 imageloadfont() 和 imagettftext()。
#免責聲明#
本站[綠夏技術導航]提供的一切軟件、教程和內容信息僅限用于學習和研究目的;不得將上述內容用于商業或者非法用途,否則,一切后果請用戶自負。本站信息來自網絡收集整理,版權爭議與本站無關。您必須在下載后的24個小時之內,從您的電腦或手機中徹底刪除上述內容。如果您喜歡該程序或內容,請支持正版,購買注冊,得到更好的正版服務。我們非常重視版權問題,如有侵權請郵件[admin@lxwl520.com]與我們聯系進行刪除處理。敬請諒解!