Graphics.DrawArcとは? わかりやすく解説

Graphics.DrawArc メソッド (Pen, Rectangle, Single, Single)

Rectangle 構造体で指定された楕円の一部を表す円弧を描画します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub DrawArc ( _
    pen As Pen, _
    rect As Rectangle, _
    startAngle As Single, _
    sweepAngle As Single _
)
Dim instance As Graphics
Dim pen As Pen
Dim rect As Rectangle
Dim startAngle As Single
Dim sweepAngle As Single

instance.DrawArc(pen, rect, startAngle, sweepAngle)
public void DrawArc (
    Pen pen,
    Rectangle rect,
    float startAngle,
    float sweepAngle
)
public:
void DrawArc (
    Pen^ pen, 
    Rectangle rect, 
    float startAngle, 
    float sweepAngle
)
public void DrawArc (
    Pen pen, 
    Rectangle rect, 
    float startAngle, 
    float sweepAngle
)
public function DrawArc (
    pen : Pen, 
    rect : Rectangle, 
    startAngle : float, 
    sweepAngle : float
)

パラメータ

pen

円弧の色、幅、およびスタイルを決定する Pen。

rect

楕円の境界を定義する RectangleF 構造体。

startAngle

x 軸から円弧の開始点まで、時計回りに測定した角度 (度単位)。

sweepAngle

startAngle パラメータから円弧の終了点まで、時計回りに測定した角度 (度単位)。

例外例外
例外の種類条件

ArgumentNullException

pen が null 参照 (Visual Basic では Nothing) です。

解説解説

このメソッドは、楕円の周囲の一部である円弧を描画します。楕円は、四角形の境界によって定義されます。円弧は、楕円の周囲のうち、startAngle パラメータと startAngle+ sweepAngle パラメータの間の部分です。

使用例使用例

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。

x 軸に対して +45 ~ -45 度の間のセグメントがない不完全な楕円が生成されます。

Public Sub DrawArcRectangle(ByVal
 e As PaintEventArgs)

    ' Create pen.
    Dim blackPen As New
 Pen(Color.Black, 3)

    ' Create rectangle to bound ellipse.
    Dim rect As New Rectangle(0,
 0, 100, 200)

    ' Create start and sweep angles on ellipse.
    Dim startAngle As Single
 = 45.0F
    Dim sweepAngle As Single
 = 270.0F

    ' Draw arc to screen.
    e.Graphics.DrawArc(blackPen, rect, startAngle, sweepAngle)
End Sub
public void DrawArcRectangle(PaintEventArgs
 e)
{
   // Create pen.
    Pen blackPen= new Pen(Color.Black, 3);
             
    // Create rectangle to bound ellipse.
    Rectangle rect = new Rectangle(0, 0, 100, 200);
             
    // Create start and sweep angles on ellipse.
    float startAngle =  45.0F;
    float sweepAngle = 270.0F;
             
    // Draw arc to screen.
    e.Graphics.DrawArc(blackPen, rect, startAngle, sweepAngle);
}
public:
   void DrawArcRectangle( PaintEventArgs^ e )
   {
      // Create pen.
      Pen^ blackPen = gcnew Pen( Color::Black,3.0f );

      // Create rectangle to bound ellipse.
      Rectangle rect = Rectangle(0,0,100,200);

      // Create start and sweep angles on ellipse.
      float startAngle = 45.0F;
      float sweepAngle = 270.0F;

      // Draw arc to screen.
      e->Graphics->DrawArc( blackPen, rect, startAngle, sweepAngle );
   }
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.DrawArc メソッド

座標ペア、幅、および高さで指定された楕円の一部を表す円弧を描画します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
Graphics.DrawArc (Pen, Rectangle, Single, Single) Rectangle 構造体で指定された楕円の一部を表す円弧を描画します。
Graphics.DrawArc (Pen, RectangleF, Single, Single) RectangleF 構造体で指定された楕円の一部を表す円弧を描画します。
Graphics.DrawArc (Pen, Int32, Int32, Int32, Int32, Int32, Int32) 座標ペア、幅、および高さで指定された楕円の一部を表す円弧を描画します。
Graphics.DrawArc (Pen, Single, Single, Single, Single, Single, Single) 座標ペア、幅、および高さで指定された楕円の一部を表す円弧を描画します。
参照参照

Graphics.DrawArc メソッド (Pen, RectangleF, Single, Single)

RectangleF 構造体で指定された楕円の一部を表す円弧を描画します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub DrawArc ( _
    pen As Pen, _
    rect As RectangleF, _
    startAngle As Single, _
    sweepAngle As Single _
)
Dim instance As Graphics
Dim pen As Pen
Dim rect As RectangleF
Dim startAngle As Single
Dim sweepAngle As Single

instance.DrawArc(pen, rect, startAngle, sweepAngle)
public void DrawArc (
    Pen pen,
    RectangleF rect,
    float startAngle,
    float sweepAngle
)
public:
void DrawArc (
    Pen^ pen, 
    RectangleF rect, 
    float startAngle, 
    float sweepAngle
)
public void DrawArc (
    Pen pen, 
    RectangleF rect, 
    float startAngle, 
    float sweepAngle
)
public function DrawArc (
    pen : Pen, 
    rect : RectangleF, 
    startAngle : float, 
    sweepAngle : float
)

パラメータ

pen

円弧の色、幅、およびスタイルを決定する Pen。

rect

楕円の境界を定義する RectangleF 構造体。

startAngle

x 軸から円弧の開始点まで、時計回りに測定した角度 (度単位)。

sweepAngle

startAngle パラメータから円弧の終了点まで、時計回りに測定した角度 (度単位)。

例外例外
例外の種類条件

ArgumentNullException

pen is null 参照 (Visual Basic では Nothing)

解説解説

このメソッドは、楕円の周囲の一部である円弧を描画します。楕円は、四角形の境界によって定義されます。円弧は、楕円の周囲のうち、startAngle パラメータと startAngle+ sweepAngle パラメータの間の部分です。

使用例使用例

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。

x 軸に対して +45 ~ -45 度の間のセグメントがない不完全な楕円が生成されます。

Public Sub DrawArcRectangleF(ByVal
 e As PaintEventArgs)

    ' Create pen.
    Dim blackPen As New
 Pen(Color.Black, 3)

    ' Create rectangle to bound ellipse.
    Dim rect As New RectangleF(0.0F,
 0.0F, 100.0F, 200.0F)

    ' Create start and sweep angles on ellipse.
    Dim startAngle As Single
 = 45.0F
    Dim sweepAngle As Single
 = 270.0F

    ' Draw arc to screen.
    e.Graphics.DrawArc(blackPen, rect, startAngle, sweepAngle)
End Sub
public void DrawArcRectangleF(PaintEventArgs
 e)
{
    // Create pen.
    Pen blackPen= new Pen(Color.Black, 3);
             
    // Create rectangle to bound ellipse.
    RectangleF rect = new RectangleF(0.0F, 0.0F, 100.0F, 200.0F);
             
    // Create start and sweep angles on ellipse.
    float startAngle =  45.0F;
    float sweepAngle = 270.0F;
             
    // Draw arc to screen.
    e.Graphics.DrawArc(blackPen, rect, startAngle, sweepAngle);
}
public:
   void DrawArcRectangleF( PaintEventArgs^ e )
   {
      // Create pen.
      Pen^ blackPen = gcnew Pen( Color::Black,3.0f );

      // Create rectangle to bound ellipse.
      RectangleF rect = RectangleF(0.0F,0.0F,100.0F,200.0F);

      // Create start and sweep angles on ellipse.
      float startAngle = 45.0F;
      float sweepAngle = 270.0F;

      // Draw arc to screen.
      e->Graphics->DrawArc( blackPen, rect, startAngle, sweepAngle );
   }
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.DrawArc メソッド (Pen, Single, Single, Single, Single, Single, Single)

座標ペア、幅、および高さで指定された楕円の一部を表す円弧を描画します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub DrawArc ( _
    pen As Pen, _
    x As Single, _
    y As Single, _
    width As Single, _
    height As Single, _
    startAngle As Single, _
    sweepAngle As Single _
)
Dim instance As Graphics
Dim pen As Pen
Dim x As Single
Dim y As Single
Dim width As Single
Dim height As Single
Dim startAngle As Single
Dim sweepAngle As Single

instance.DrawArc(pen, x, y, width, height, startAngle, sweepAngle)
public void DrawArc (
    Pen pen,
    float x,
    float y,
    float width,
    float height,
    float startAngle,
    float sweepAngle
)
public:
void DrawArc (
    Pen^ pen, 
    float x, 
    float y, 
    float width, 
    float height, 
    float startAngle, 
    float sweepAngle
)
public void DrawArc (
    Pen pen, 
    float x, 
    float y, 
    float width, 
    float height, 
    float startAngle, 
    float sweepAngle
)
public function DrawArc (
    pen : Pen, 
    x : float, 
    y : float, 
    width : float, 
    height : float, 
    startAngle : float, 
    sweepAngle : float
)

パラメータ

pen

円弧の色、幅、およびスタイルを決定する Pen。

x

楕円を定義する四角形の左上隅の x 座標。

y

楕円を定義する四角形の左上隅の y 座標。

width

楕円を定義する四角形の幅。

height

楕円を定義する四角形の高さ。

startAngle

x 軸から円弧の開始点まで、時計回りに測定した角度 (度単位)。

sweepAngle

startAngle パラメータから円弧の終了点まで、時計回りに測定した角度 (度単位)。

例外例外
例外の種類条件

ArgumentNullException

pen が null 参照 (Visual Basic では Nothing) です。

解説解説

このメソッドは、楕円の周囲の一部である円弧を描画します。楕円は、四角形の境界によって定義されます。円弧は、楕円の周囲のうち、startAngle パラメータと startAngle+ sweepAngle パラメータの間の部分です。

使用例使用例

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。

x 軸に対して +45 ~ -45 度の間のセグメントがない不完全な楕円が生成されます。

Public Sub DrawArcFloat(ByVal
 e As PaintEventArgs)

    ' Create pen.
    Dim blackPen As New
 Pen(Color.Black, 3)

    ' Create coordinates of rectangle to bound ellipse.
    Dim x As Single = 0.0F
    Dim y As Single = 0.0F
    Dim width As Single
 = 100.0F
    Dim height As Single
 = 200.0F

    ' Create start and sweep angles on ellipse.
    Dim startAngle As Single
 = 45.0F
    Dim sweepAngle As Single
 = 270.0F

    ' Draw arc to screen.
    e.Graphics.DrawArc(blackPen, x, y, width, height, startAngle, _
    sweepAngle)
End Sub
public void DrawArcFloat(PaintEventArgs e)
{
    // Create pen.
    Pen blackPen= new Pen(Color.Black, 3);
             
    // Create coordinates of rectangle to bound ellipse.
    float x = 0.0F;
    float y = 0.0F;
    float width = 100.0F;
    float height = 200.0F;
             
    // Create start and sweep angles on ellipse.
    float startAngle =  45.0F;
    float sweepAngle = 270.0F;
             
    // Draw arc to screen.
    e.Graphics.DrawArc(blackPen, x, y, width, height, startAngle, sweepAngle);
}
public:
   void DrawArcFloat( PaintEventArgs^ e )
   {
      // Create pen.
      Pen^ blackPen = gcnew Pen( Color::Black,3.0f );

      // Create coordinates of rectangle to bound ellipse.
      float x = 0.0F;
      float y = 0.0F;
      float width = 100.0F;
      float height = 200.0F;

      // Create start and sweep angles on ellipse.
      float startAngle = 45.0F;
      float sweepAngle = 270.0F;

      // Draw arc to screen.
      e->Graphics->DrawArc( blackPen, x, y, width, height, startAngle, sweepAngle
 );
   }
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.DrawArc メソッド (Pen, Int32, Int32, Int32, Int32, Int32, Int32)

座標ペア、幅、および高さで指定された楕円の一部を表す円弧を描画します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub DrawArc ( _
    pen As Pen, _
    x As Integer, _
    y As Integer, _
    width As Integer, _
    height As Integer, _
    startAngle As Integer, _
    sweepAngle As Integer _
)
Dim instance As Graphics
Dim pen As Pen
Dim x As Integer
Dim y As Integer
Dim width As Integer
Dim height As Integer
Dim startAngle As Integer
Dim sweepAngle As Integer

instance.DrawArc(pen, x, y, width, height, startAngle, sweepAngle)
public void DrawArc (
    Pen pen,
    int x,
    int y,
    int width,
    int height,
    int startAngle,
    int sweepAngle
)
public:
void DrawArc (
    Pen^ pen, 
    int x, 
    int y, 
    int width, 
    int height, 
    int startAngle, 
    int sweepAngle
)
public void DrawArc (
    Pen pen, 
    int x, 
    int y, 
    int width, 
    int height, 
    int startAngle, 
    int sweepAngle
)
public function DrawArc (
    pen : Pen, 
    x : int, 
    y : int, 
    width : int, 
    height : int, 
    startAngle : int, 
    sweepAngle : int
)

パラメータ

pen

円弧の色、幅、およびスタイルを決定する Pen。

x

楕円を定義する四角形の左上隅の x 座標。

y

楕円を定義する四角形の左上隅の y 座標。

width

楕円を定義する四角形の幅。

height

楕円を定義する四角形の高さ。

startAngle

x 軸から円弧の開始点まで、時計回りに測定した角度 (度単位)。

sweepAngle

startAngle パラメータから円弧の終了点まで、時計回りに測定した角度 (度単位)。

例外例外
例外の種類条件

ArgumentNullException

pen が null 参照 (Visual Basic では Nothing) です。

解説解説

このメソッドは、楕円の周囲の一部である円弧を描画します。楕円は、四角形の境界によって定義されます。円弧は、楕円の周囲のうち、startAngle パラメータと startAngle+ sweepAngle パラメータの間の部分です。

使用例使用例

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。

x 軸に対して +45 ~ -45 度の間のセグメントがない不完全な楕円が生成されます。

Public Sub DrawArcInt(ByVal
 e As PaintEventArgs)

    ' Create pen.
    Dim blackPen As New
 Pen(Color.Black, 3)

    ' Create coordinates of rectangle to bound ellipse.
    Dim x As Integer = 0
    Dim y As Integer = 0
    Dim width As Integer
 = 100
    Dim height As Integer
 = 200

    ' Create start and sweep angles on ellipse.
    Dim startAngle As Integer
 = 45
    Dim sweepAngle As Integer
 = 270

    ' Draw arc to screen.
    e.Graphics.DrawArc(blackPen, x, y, width, height, startAngle, _
    sweepAngle)
End Sub
public void DrawArcInt(PaintEventArgs e)
{
    // Create pen.
    Pen blackPen= new Pen(Color.Black, 3);
             
    // Create coordinates of rectangle to bound ellipse.
    int x = 0;
    int y = 0;
    int width = 100;
    int height = 200;
             
    // Create start and sweep angles on ellipse.
    int startAngle =  45;
    int sweepAngle = 270;
             
    // Draw arc to screen.
    e.Graphics.DrawArc(blackPen, x, y, width, height, startAngle, sweepAngle);
}
public:
   void DrawArcInt( PaintEventArgs^ e )
   {
      // Create pen.
      Pen^ blackPen = gcnew Pen( Color::Black,3.0f );
      // Create coordinates of rectangle to bound ellipse.
      int x = 0;
      int y = 0;
      int width = 100;
      int height = 200;

      // Create start and sweep angles on ellipse.
      int startAngle = 45;
      int sweepAngle = 270;

      // Draw arc to screen.
      e->Graphics->DrawArc( blackPen, x, y, width, height, startAngle, sweepAngle
 );
   }
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「Graphics.DrawArc」の関連用語

Graphics.DrawArcのお隣キーワード

   

英語⇒日本語
日本語⇒英語
   



Graphics.DrawArcのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS