Class Shape
Definition
- Namespace:
- Tizen.NUI.BaseComponents.VectorGraphics
- Assembly:
- Tizen.NUI.dll
Shape is a command list for drawing one shape groups It has own path data and properties for sync/asynchronous drawing
C#Copypublic class Shape : Drawable, INotifyPropertyChanged, IDisposable
- Inheritance
- Implements
-
System.ComponentModel.INotifyPropertyChangedSystem.IDisposable
Constructors
Shape()
Creates an initialized Shape. This constructor initializes a new instance of the Shape class.
Declaration
C#Copypublic Shape()
Properties
Declaration
C#Copypublic Color FillColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
FillGradient
The gradient to use for filling the path. Even if FillColor is set, Gradient setting takes precedence.
Declaration
C#Copypublic Gradient FillGradient { get; set; }
Property Value
| Type | Description |
|---|---|
| Gradient |
FillRule
Gets or sets the fill rule type for the shape. The fill rule type which determines how the interior of a shape is determined.
Declaration
C#Copypublic FillRuleType FillRule { get; set; }
Property Value
| Type | Description |
|---|---|
| FillRuleType |
StrokeCap
The cap style to use for stroking the path. The cap will be used for capping the end point of a open subpath.
Declaration
C#Copypublic StrokeCapType StrokeCap { get; set; }
Property Value
| Type | Description |
|---|---|
| StrokeCapType |
Declaration
C#Copypublic Color StrokeColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
Declaration
C#Copypublic ReadOnlyCollection<float> StrokeDash { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.ObjectModel.ReadOnlyCollection<T><float> |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when value is null. |
StrokeGradient
The gradient to use for stroking the path. Even if StrokeColor is set, Gradient setting takes precedence.
Declaration
C#Copypublic Gradient StrokeGradient { get; set; }
Property Value
| Type | Description |
|---|---|
| Gradient |
StrokeJoin
The join style to use for stroking the path. The join style will be used for joining the two line segment while stroking the path.
Declaration
C#Copypublic StrokeJoinType StrokeJoin { get; set; }
Property Value
| Type | Description |
|---|---|
| StrokeJoinType |
Declaration
C#Copypublic float StrokeWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
Declaration
C#Copypublic bool AddArc(float x, float y, float radius, float startAngle, float sweep, bool pie)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | X co-ordinate of end point of the arc. |
| float | y | Y co-ordinate of end point of the arc. |
| float | radius | Radius of arc |
| float | startAngle | Start angle (in degrees) where the arc begins. |
| float | sweep | The Angle measures how long the arc will be drawn. |
| bool | pie | If True, the area is created by connecting start angle point and sweep angle point of the drawn arc. If false, it doesn't. |
Returns
| Type | Description |
|---|---|
| bool | True when it's successful. False otherwise. |
AddCircle(float, float, float, float)
Append a circle with given center and x,y-axis radius
Declaration
C#Copypublic bool AddCircle(float x, float y, float radiusX, float radiusY)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | X co-ordinate of the center of the circle. |
| float | y | Y co-ordinate of the center of the circle. |
| float | radiusX | X axis radius. |
| float | radiusY | Y axis radius. |
Returns
| Type | Description |
|---|---|
| bool | True when it's successful. False otherwise. |
AddCubicTo(float, float, float, float, float, float)
Adds a cubic Bezier curve between the current position and the given end point (lineEndPoint) using the control points specified by (controlPoint1), and (controlPoint2). After the path is drawn, the current position is updated to be at the end point of the path.
Declaration
C#Copypublic bool AddCubicTo(float controlPoint1X, float controlPoint1Y, float controlPoint2X, float controlPoint2Y, float endPointX, float endPointY)
Parameters
| Type | Name | Description |
|---|---|---|
| float | controlPoint1X | X co-ordinate of 1st control point. |
| float | controlPoint1Y | Y co-ordinate of 1st control point. |
| float | controlPoint2X | X co-ordinate of 2nd control point. |
| float | controlPoint2Y | Y co-ordinate of 2nd control point. |
| float | endPointX | X co-ordinate of end point of the line. |
| float | endPointY | Y co-ordinate of end point of the line. |
Returns
| Type | Description |
|---|---|
| bool | True when it's successful. False otherwise. |
AddLineTo(float, float)
Adds a straight line from the current position to the given end point. After the line is drawn, the current position is updated to be at the end point of the line. If no current position present, it draws a line to itself, basically * a point.
Declaration
C#Copypublic bool AddLineTo(float x, float y)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | X co-ordinate of end point of the line. |
| float | y | Y co-ordinate of end point of the line. |
Returns
| Type | Description |
|---|---|
| bool | True when it's successful. False otherwise. |
AddMoveTo(float, float)
Add a point that sets the given point as the current point, implicitly starting a new subpath and closing the previous one.
Declaration
C#Copypublic bool AddMoveTo(float x, float y)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | X co-ordinate of the current point. |
| float | y | Y co-ordinate of the current point. |
Returns
| Type | Description |
|---|---|
| bool | True when it's successful. False otherwise. |
AddPath(PathCommands)
Appends a given sub-path to the path. The current point value is set to the last point from the sub-path. @note The interface is designed for optimal path setting if the caller has a completed path commands already.
Declaration
C#Copypublic void AddPath(PathCommands pathCommands)
Parameters
| Type | Name | Description |
|---|---|---|
| PathCommands | pathCommands | The command object that contain sub-path information. (This command information is copied internally.) |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when pathCommands is null. |
AddRect(float, float, float, float, float, float)
Append the given rectangle with rounded corner to the path. The roundedCorner arguments specify the radii of the ellipses defining the corners of the rounded rectangle.
roundedCorner are specified in terms of width and height respectively.
If roundedCorner's values are 0, then it will draw a rectangle without rounded corner.
Declaration
C#Copypublic bool AddRect(float x, float y, float width, float height, float roundedCornerX, float roundedCornerY)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | X co-ordinate of the rectangle. |
| float | y | Y co-ordinate of the rectangle. |
| float | width | Width of the rectangle. |
| float | height | Height of the rectangle. |
| float | roundedCornerX | The x radius of the rounded corner and should be in range [ 0 to w/2 ]. |
| float | roundedCornerY | The y radius of the rounded corner and should be in range [ 0 to w/2 ]. |
Returns
| Type | Description |
|---|---|
| bool | True when it's successful. False otherwise. |
Close()
Closes the current subpath by drawing a line to the beginning of the subpath, automatically starting a new path. The current point of the new path is (0, 0). If the subpath does not contain any points, this function does nothing.
Declaration
C#Copypublic bool Close()
Returns
| Type | Description |
|---|---|
| bool | True when it's successful. False otherwise. |
ResetPath()
Reset the added path(rect, circle, path, etc...) information. Color and Stroke information are keeped.
Declaration
C#Copypublic bool ResetPath()
Returns
| Type | Description |
|---|---|
| bool | True when it's successful. False otherwise. |