2013-10-10 141 views
0

我正在使用gd庫代碼創建矩形。我怎麼能在我的矩形在PHP中獲得邊框半徑。如何使用gd庫在矩形上獲取邊框半徑

這裏是我的代碼爲:

$bg_color="5465FF"; 
$text_color="61FF66"; 
$button_width = 150; 
$button_height =50; 
$textdisplay="text"; 

$r_bg = hexdec("0x".substr($bg_color,0,2)); 
$g_bg = hexdec("0x".substr($bg_color,2,2)); 
$b_bg = hexdec("0x".substr($bg_color,4,2)); 

$r_bgt = hexdec("0x".substr($text_color,0,2)); 
$g_bgt = hexdec("0x".substr($text_color,2,2)); 
$b_bgt = hexdec("0x".substr($text_color,4,2)); 
header('content-type: image/png');  
$image = imagecreate($button_width, $button_height); 
$blue = imagecolorallocate($image, $r_bg, $g_bg, $b_bg); 
$red = imagecolorallocate($image, $r_bgt, $g_bgt, $b_bgt); 
imagestring($image,18,0,0,$textdisplay,$red);  
imagepng($image); 
imagedestroy($image); 

我想我的矩形看起來像這樣:

+0

你可以使用此功能:http://php.net/manual/en/function.imagefilledarc.php – Manolo

回答

1

border-radius : 10px;(也許 - 試試這個)

+0

他要求在PHP而不是CSS的答案。 – Jake

+0

哎呀抱歉..那是我的錯誤...我沒有正確地閱讀完整的問題。 – Karuppiah

+0

無論如何,我+1你試圖回答。 – Jake