imagearc

(PHP 3, PHP 4, PHP 5)

imagearc -- 部分楕円の描画

説明

int imagearc ( int im, int cx, int cy, int w, int h, int s, int e, int color )

imagearc()は、imで示す画像上に cxcyを中心(左上が 0,0)とする部分楕円を描画します。whはそれぞれ楕円の幅と高さを指定します。一 方、始点と終点は引数seにより度(deg)で指定します。 0°は3時の方向で、度数はそこから反時計周りの角度です。

例 1. imagearc()で円を描く

<?php

// create a 200*200 image
$img = imagecreate(200, 200);

// allocate some colors
$white = imagecolorallocate($img, 255, 255, 255);
   
// draw a white circle
imagearc($img, 100, 100, 150, 150, 0, 360, $white);

// output image in the browser
header("Content-type: image/png");
imagepng($img);
   
// free memory
imagedestroy($img);

?>

imageellipse(), imagefilledellipse(), imagefilledarc()も参照ください。