スレッド表示 | フラット表示〕 全トピック 920 件中 50 番目 次≫ ≪前

imagefilledarc()部分楕円を描画し、塗りつぶす

created: 2008-05-30 18:13 | modified: 2008-06-03 13:37 | reply: 5

[4171] imagefilledarc()部分楕円を描画し、塗りつぶす

user: ほうじ茶 | created: 2008-05-30 18:13
お世話になっております。
今回GDライブラリーを使い3D風円グラフが作成できるとPHPマニュアルに書いてあったので試してみたところ、
他のイメージ関数を使った画像出力はできたのですがなぜかimagefilledarc()関数(というかimagefilled@@()関数全般)を使うスクリプトがブラウザに表示されず赤い×印が出てしまいます・・・

以下はGDに関する情報の配列情報です。
Array ( [GD Version] => bundled (2.0.28 compatible)
    [FreeType Support] => 1
[FreeType Linkage] => with freetype
[T1Lib Support] => 1
[GIF Read Support] => 1
[GIF Create Support] => 1
[JPG Support] => 1
[PNG Support] => 1
[WBMP Support] => 1
[XPM Support] =>
[XBM Support] => 1
[JIS-mapped Japanese Font Support] => )

以下は公式PHPマニュアルよりimagefilledarc関数のサンプルです。
<?php

// 画像を作成します
$image = imagecreatetruecolor(100, 100);

// 色を割り当てます
$white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
$gray = imagecolorallocate($image, 0xC0, 0xC0, 0xC0);
$darkgray = imagecolorallocate($image, 0x90, 0x90, 0x90);
$navy = imagecolorallocate($image, 0x00, 0x00, 0x80);
$darknavy = imagecolorallocate($image, 0x00, 0x00, 0x50);
$red = imagecolorallocate($image, 0xFF, 0x00, 0x00);
$darkred = imagecolorallocate($image, 0x90, 0x00, 0x00);

// 3D 効果を作成します
for ($i = 60; $i > 50; $i--) {
imagefilledarc($image, 50, $i, 100, 50, 0, 45, $darknavy, IMG_ARC_PIE);
imagefilledarc($image, 50, $i, 100, 50, 45, 75 , $darkgray, IMG_ARC_PIE);
imagefilledarc($image, 50, $i, 100, 50, 75, 360 , $darkred, IMG_ARC_PIE);
}

imagefilledarc($image, 50, 50, 100, 50, 0, 45, $navy, IMG_ARC_PIE);
imagefilledarc($image, 50, 50, 100, 50, 45, 75 , $gray, IMG_ARC_PIE);
imagefilledarc($image, 50, 50, 100, 50, 75, 360 , $red, IMG_ARC_PIE);


// 画像を出力します
header('Content-type: image/png');
imagepng($image);
imagedestroy($image);
?>

皆さんは正しく表示されますでしょうか??
ちなみにjpegやgifにしても駄目でした・・・
php.iniの設定不足でしょうか・・
どうかご教授お願い致します。
reply: 4172 返信 編集 削除
スレッド表示 | フラット表示〕 全トピック 920 件中 50 番目 次≫ ≪前
ページの一番上へ
Googleグックマークに登録 Yahooグックマークに登録 livedoorクリップに登録 @niftyクリップに登録 はてなブックマークに登録 deliciousに登録 Buzzurlに登録 FC2ブックマークに登録
最近更新された掲示板トピックス
管理人Blog
Yahoo Search

最近更新したNote
PHPマニュアル
今日のブックマーク
PHPマニュアル関数検索
関数名を入力し検索ボタンをクリック↑