Class

# ArcShape

<div class="rst-class">

forsearch

</div>

Shape

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

Used for drawing arcs in a vector graphics environment.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                    | Type                               | Read-Only | Shared |
|-----------------------------------------|------------------------------------|-----------|--------|
| `ArcAngle<arcshape.arcangle>`           | `Double</api/data_types/double>`   |           |        |
| `BorderColor<arcshape.bordercolor>`     | `Color</api/data_types/color>`     |           |        |
| `BorderOpacity<arcshape.borderopacity>` | `Double</api/data_types/double>`   |           |        |
| `BorderWidth<arcshape.borderwidth>`     | `Double</api/data_types/double>`   |           |        |
| `FillColor<arcshape.fillcolor>`         | `Color</api/data_types/color>`     |           |        |
| `FillOpacity<arcshape.fillopacity>`     | `Double</api/data_types/double>`   |           |        |
| `Height<arcshape.height>`               | `Double</api/data_types/double>`   |           |        |
| `Rotation<arcshape.rotation>`           | `Double</api/data_types/double>`   |           |        |
| `Scale<arcshape.scale>`                 | `Double</api/data_types/double>`   |           |        |
| `Segments<arcshape.segments>`           | `Integer</api/data_types/integer>` |           |        |
| `StartAngle<arcshape.startangle>`       | `Double</api/data_types/double>`   |           |        |
| `Width<arcshape.width>`                 | `Double</api/data_types/double>`   |           |        |
| `X<arcshape.x>`                         | `Double</api/data_types/double>`   |           |        |
| `Y<arcshape.y>`                         | `Double</api/data_types/double>`   |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                          | Parameters                                                                   | Returns                            | Shared |
|-------------------------------|------------------------------------------------------------------------------|------------------------------------|--------|
| `Contains<arcshape.contains>` | X As `Double</api/data_types/double>`, Y As `Double</api/data_types/double>` | `Boolean</api/data_types/boolean>` |        |

## Property descriptions

<div id="arcshape.arcangle">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

ArcShape.ArcAngle

**ArcAngle** As `Double</api/data_types/double>`

> The angle of the arc, in radians.
>
> The following method, when called from the `Paint<window.paint>` event of a `Window</api/user_interface/desktop/desktopwindow>`, creates an arc.
>
> ``` xojo
> Var a As New ArcShape
> a.ArcAngle = 1.57
> a.FillColor = Color.Red
> g.DrawObject(a)
> ```

<div id="arcshape.bordercolor">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

ArcShape.BorderColor

**BorderColor** As `Color</api/data_types/color>`

> The color of the object's border.

<div id="arcshape.borderopacity">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

ArcShape.BorderOpacity

**BorderOpacity** As `Double</api/data_types/double>`

> Indicates the level of opacity.
>
> Degrees of transparency is currently supported only on macOS and Windows. On other platforms, the border is either visible (100%) or invisible.
>
> The following code adds a border to an \`ArcShape\`:
>
> ``` xojo
> Var a As New ArcShape
> a.ArcAngle = 1.57
> a.BorderOpacity = 100
> a.FillColor = Color.Red
> g.DrawObject(a)
> ```

<div id="arcshape.borderwidth">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

ArcShape.BorderWidth

**BorderWidth** As `Double</api/data_types/double>`

> The width of the border, in points. The default is 1.
>
> The width a `Double</api/data_types/double>` value with a default of 1.0.

<div id="arcshape.fillcolor">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

ArcShape.FillColor

**FillColor** As `Color</api/data_types/color>`

> The color of the interior of the shape.

<div id="arcshape.fillopacity">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

ArcShape.FillOpacity

**FillOpacity** As `Double</api/data_types/double>`

> The opacity of the interior, from 0 (completely transparent) to 100 (opaque).
>
> This example sets the Fill to 50% opacity.
>
> ``` xojo
> Var a As New ArcShape
> a.ArcAngle = 1.57
> a.BorderOpacity = 100
> a.BorderColor = &c0000ff
> a.BorderWidth = 2.75
> a.FillOpacity = 50
> a.FillColor = Color.Red
> g.DrawObject(a)
> ```

<div id="arcshape.height">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

ArcShape.Height

**Height** As `Double</api/data_types/double>`

> The height of the arc.
>
> This example sets the height and width of the shape to 150 pixels.
>
> ``` xojo
> Var a As New ArcShape
> a.Width = 150
> a.Height = 150
> a.BorderOpacity = 100
> a.BorderColor = Color.Black
> a.FillColor = Color.Teal
> a.BorderWidth = 2.5
> a.Rotation = -0.78
> g.DrawObject(a)
> ```

<div id="arcshape.rotation">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

ArcShape.Rotation

**Rotation** As `Double</api/data_types/double>`

> Clockwise rotation, in radians, around the X, Y point. Only set the rotation after you have drawn all your objects.
>
> This code rotates the arc 0.9 radians.
>
> ``` xojo
> Var a As New ArcShape
> a.Height = 150
> a.Width = 150
> a.Rotation = 0.90
> a.arcAngle = 1.57
> a.BorderOpacity = 100
> a.BorderColor = &c0000ff
> a.BorderWidth = 2.75
> a.FillOpacity = 50
> a.FillColor = Color.Red
> g.DrawObject(a)
> ```

<div id="arcshape.scale">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

ArcShape.Scale

**Scale** As `Double</api/data_types/double>`

> The scaling factor relative to the object's original size.
>
> The following code rescales the arc by a factor of 1.5.
>
> ``` xojo
> Var a As New ArcShape
> a.Scale = 1.5
> a.Rotation = .90
> a.ArcAngle = 1.57
> a.BorderOpacity = 100
> a.BorderColor = &c0000ff
> a.BorderWidth = 2.75
> a.FillOpacity = 50
> a.FillColor = Color.Red
> g.DrawObject(a)
> ```

<div id="arcshape.segments">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

ArcShape.Segments

**Segments** As `Integer</api/data_types/integer>`

> The number of polygon sides to use when approximation is needed. Zero means it's up to the renderer.
>
> This example specifies the number of segments to use.
>
> ``` xojo
> Var a As New ArcShape
> a.Width = 60
> a.Height = 120
> a.Segments = 5
> a.FillColor = Color.Red
> g.DrawObject(a, a.Width, a.Height)
> ```

<div id="arcshape.startangle">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

ArcShape.StartAngle

**StartAngle** As `Double</api/data_types/double>`

> The starting angle, in radians.
>
> This code sets the starting angle to -1.57 radians:
>
> ``` xojo
> Var a As New ArcShape
> a.Height = 150
> a.Width = 150
> a.Rotation = 0.90
> a.ArcAngle = 1.57
> a.StartAngle = -1.57
> a.BorderOpacity = 100
> a.BorderColor = Color.Black
> a.BorderWidth = 2.75
> a.FillOpacity = 50
> a.FillColor = Color.Red
> g.DrawObject(a)
> ```

<div id="arcshape.width">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

ArcShape.Width

**Width** As `Double</api/data_types/double>`

> The width of the arc.
>
> This example sets the Width to 150 pixels.
>
> ``` xojo
> Var a As New ArchShape
> a.Width = 150
> a.Height = 150
> a.BorderOpacity = 100
> a.BorderColor = Color.Black
> a.FillColor = Color.Teal
> a.BorderWidth = 2.5
> a.Rotation = -0.78
> g.DrawObject(a)
> ```

<div id="arcshape.x">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

ArcShape.X

**X** As `Double</api/data_types/double>`

> The horizontal position of the center or main anchor point.
>
> This example sets the horizontal position to 100 pixels from the left of the containing `Canvas</api/user_interface/desktop/desktopcanvas>`.
>
> ``` xojo
> Var a As New ArcShape
> a.Height = 150
> a.Width = 150
> a.ArcAngle = 1.57
> a.StartAngle = -1.57
> a.X = 100
> a.BorderOpacity = 100
> a.BorderColor = Color.Black
> a.FillOpacity = 50
> a.FillColor = Color.Red
> g.DrawObject(a)
> ```

<div id="arcshape.y">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

ArcShape.Y

**Y** As `Double</api/data_types/double>`

> The vertical position (down from top) position of the center or anchor point.
>
> This example moves the position of the arc down 100 pixels from the top of the containing `Canvas</api/user_interface/desktop/desktopcanvas>`.
>
> ``` xojo
> Var a As New ArcShape
> a.Height = 150
> a.Width = 150
> a.ArcAngle = 1.57
> a.StartAngle = -1.57
> a.Y = 100
> a.BorderOpacity = 100
> a.BorderColor = Color.Black
> a.FillOpacity = 50
> a.FillColor = Color.Red
> g.DrawObject(a)
> ```

## Method descriptions

<div id="arcshape.contains">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

ArcShape.Contains

**Contains**(X As `Double</api/data_types/double>`, Y As `Double</api/data_types/double>`) As `Boolean</api/data_types/boolean>`

> Tests whether the object contains the point *X*, *Y*. Returns `True</api/language/true>` if the arc contains the point specified by *X*, *Y*.
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> If you want to use Contains, make sure to set the *X* and *Y* properties and **do not** pass the these to the `Graphics.DrawObject<graphics.drawobject>` method. `Graphics.DrawObject<graphics.drawobject>` parameters are the offset where the object will be drawn.
>
> </div>
>
> This code tests whether the <span class="title-ref">ArcShape</span> contains the passed point:
>
> ``` xojo
> Var a As New ArcShape
> a.Width = 75
> a.Height = 75
> a.BorderOpacity = 100
> a.Bordercolor = Color.Black
> a.FillColor = Color.Teal
> a.BorderWidth = 2.5
> a.Rotation = -0.78
> If a.Contains(50, 50) Then
> ' draw something here..
> End If
> g.DrawObject(a)
> ```

## Notes

A StartAngle of 0 means due east, i.e., a positive X value with Y = 0. Positive angles are clockwise, just as with `Object2D</api/graphics/object2d>` rotation. The value of ArcAngle can be positive or negative, extending from the starting angle. If the angle is filled, it produces a wedge; this may be useful for making pie charts, for example.

The radius of the arc is determined by its Width and Height properties. These are inherited from `RectShape</api/graphics/rectshape>`. The default values of Width and Height are 100 pixels. This means that the default value of the radius is 100/2 = 50 pixels.

For <span class="title-ref">ArcShape</span>, `BorderOpacity<object2d.borderopacity>` defaults to 0.

## Sample code

The following method, when called from the `Paint<window.paint>` event of a `Window</api/user_interface/desktop/desktopwindow>`, creates an arc.

``` xojo
Var a As New ArcShape
a.ArcAngle = 1.57
a.StartAngle = -1.57
a.FillColor = Color.Red
g.DrawObject(a)
```

## Compatibility

|                       |                       |
|-----------------------|-----------------------|
| **Project Types**     | Console, Desktop, Web |
| **Operating Systems** | All                   |

<div class="seealso">

`OvalShape</api/graphics/ovalshape>` parent class; `CurveShape</api/graphics/curveshape>`, `FigureShape</api/graphics/figureshape>`, `FolderItem</api/files/folderitem>`, `Graphics</api/graphics/graphics>`, `Group2D</api/graphics/group2d>`, `Object2D</api/graphics/object2d>`, `OvalShape</api/graphics/ovalshape>`, `Picture</api/graphics/picture>`, `PixmapShape</api/graphics/pixmapshape>`, `RectShape</api/graphics/rectshape>`, `RoundRectShape</api/graphics/roundrectshape>`, `TextShape</api/graphics/textshape>` classes.

</div>
