imagefilledarc()部分楕円を描画し、塗りつぶす
created: 2008-05-30 18:13 | modified: 2008-06-03 13:37 | reply: 5
[4171] imagefilledarc()部分楕円を描画し、塗りつぶす - ほうじ茶 - 2008-05-30 18:13- [4172] GDで円グラフ出力 - ゆうじ - 2008-05-30 18:45
- [4173] imagefilledellipseはつかえました・・ - ほうじ茶 - 2008-05-30 19:06
- [4174] 画像は表示されるの? - ゆうじ - 2008-05-30 19:16
- [4175] Re - ほうじ茶 - 2008-05-30 19:26
- [4180] ほうじ茶 - ほうじ茶 - 2008-06-03 13:37
[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の設定不足でしょうか・・
どうかご教授お願い致します。
今回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の設定不足でしょうか・・
どうかご教授お願い致します。
