PHP Conference Japan 2024

Gmagick::newimage

(PECL gmagick >= 未知)

Gmagick::newimage建立新的影像

描述

public Gmagick::newimage(
    int $width,
    int $height,
    string $background,
    string $format = ?
): Gmagick

使用指定的背景顏色建立新的影像。

參數

width

新影像的寬度。

height

新影像的高度。

background

用於此影像的背景顏色(為浮點數)。

format

影像格式。

回傳值

Gmagick 物件。

錯誤/例外

發生錯誤時拋出 GmagickException

新增註解

使用者貢獻註解 1 則註解

4
evitceted
5 年前
建立具有透明背景的 png
newimage(width, height, "transparent", "png")
To Top