(PHP 4 >= 4.0.7, PHP 5, PHP 7, PHP 8)
imagecreatefromgd2 — 從 GD2 檔案或 URL 建立新影像
從 GD2 檔案或 URL 建立新圖像。
filename
GD2 圖像的路徑。
成功時返回圖像物件,錯誤時返回 false
。
範例 #1 imagecreatefromgd2() 範例
<?php
// 載入 gd2 圖像
$im = imagecreatefromgd2('./test.gd2');
// 對圖像應用效果,在此
// 範例中反轉圖像
if(function_exists('imagefilter'))
{
imagefilter($im, IMG_FILTER_NEGATE);
}
// 儲存圖像
imagegd2($im, './test_updated.gd2');
imagedestroy($im);
?>
GD 和 GD2 圖像格式是 libgd 的專有圖像格式。它們已被視為 *過時*,並且應該僅用於開發和測試目的。