(PHP 4 >= 4.0.7, PHP 5, PHP 7, PHP 8)
imagecreatefromgd — 從 GD 檔案或 URL 建立新影像
從 GD 檔案或 URL 建立新影像。
filename
GD 檔案的路徑。
成功時傳回影像物件,錯誤時傳回 false
。
範例 #1 imagecreatefromgd() 範例
<?php
// 載入 gd 影像
$im = @imagecreatefromgd('./test.gd');
// 測試影像是否已載入
if(!$im)
{
die('無法載入 gd 影像!');
}
// 在此處進行影像操作
// 儲存影像
imagegd($im, './test_updated.gd');
imagedestroy($im);
?>
GD 和 GD2 影像格式是 libgd 的專有影像格式。它們已被視為*過時*,並且僅應用於開發和測試目的。