= 4.0.6, PHP 5, PHP 7, PHP 8)imagesetthickness — 設(shè)定畫線的寬度說明imagesetthickness(resource $image, int $thickness): boolimagesetthi">

imagesetthickness

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

imagesetthickness設(shè)定畫線的寬度

說明

imagesetthickness(resource $image, int $thickness): bool

imagesetthickness() 把畫矩形,多邊形,橢圓等等時(shí)所用的線寬設(shè)為 thickness 個(gè)像素。成功時(shí)返回 true, 或者在失敗時(shí)返回 false。

參數(shù)

image

由圖象創(chuàng)建函數(shù)(例如imagecreatetruecolor())返回的 GdImage 對(duì)象。

thickness

Thickness, in pixels.

返回值

成功時(shí)返回 true, 或者在失敗時(shí)返回 false。

范例

示例 #1 imagesetthickness() example

<?php
// Create a 200x100 image
$im imagecreatetruecolor(200100);
$white imagecolorallocate($im0xFF0xFF0xFF);
$black imagecolorallocate($im0x000x000x00);

// Set the background to be white
imagefilledrectangle($im0029999$white);

// Set the line thickness to 5
imagesetthickness($im5);

// Draw the rectangle
imagerectangle($im141418585$black);

// Output image to the browser
header('Content-Type: image/png');

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

以上例程的輸出類似于:

Output of example : imagesetthickness()

注釋