Class Shape

Definition

Namespace:
Tizen.NUI.BaseComponents.VectorGraphics
Assembly:
Tizen.NUI.dll
API Level:
9

Shape is a command list for drawing one shape groups It has own path data and properties for sync/asynchronous drawing

C#
Copy
public class Shape : Drawable, INotifyPropertyChanged, IDynamicResourceHandler, IElement, INameScope, IElementController, IDisposable
Inheritance
System.Object
Tizen.NUI.Binding.Element
Shape
Implements
System.ComponentModel.INotifyPropertyChanged
System.IDisposable

Constructors

View Source

Shape()

Creates an initialized Shape.

Declaration
C#
Copy
public Shape()
API Level: 9

Properties

View Source

FillColor

The color to use for filling the path.

Declaration
C#
Copy
public Color FillColor { get; set; }
Property Value
Type Description
Color
API Level: 9
View Source

FillGradient

The gradient to use for filling the path. Even if FillColor is set, Gradient setting takes precedence.

Declaration
C#
Copy
public Gradient FillGradient { get; set; }
Property Value
Type Description
Gradient
API Level: 9
View Source

FillRule

The current fill rule of the shape.

Declaration
C#
Copy
public FillRuleType FillRule { get; set; }
Property Value
Type Description
FillRuleType
API Level: 9
View Source

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#
Copy
public StrokeCapType StrokeCap { get; set; }
Property Value
Type Description
StrokeCapType
API Level: 9
View Source

StrokeColor

The color to use for stroking the path.

Declaration
C#
Copy
public Color StrokeColor { get; set; }
Property Value
Type Description
Color
API Level: 9
View Source

StrokeDash

The stroke dash pattern. The dash pattern is specified dash pattern.

Declaration
C#
Copy
public ReadOnlyCollection<float> StrokeDash { get; set; }
Property Value
Type Description
System.Collections.ObjectModel.ReadOnlyCollection<System.Single>
Exceptions
Type Condition
System.ArgumentNullException

Thrown when value is null.

API Level: 9
View Source

StrokeGradient

The gradient to use for stroking the path. Even if StrokeColor is set, Gradient setting takes precedence.

Declaration
C#
Copy
public Gradient StrokeGradient { get; set; }
Property Value
Type Description
Gradient
API Level: 9
View Source

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#
Copy
public StrokeJoinType StrokeJoin { get; set; }
Property Value
Type Description
StrokeJoinType
API Level: 9
View Source

StrokeWidth

The stroke width to use for stroking the path.

Declaration
C#
Copy
public float StrokeWidth { get; set; }
Property Value
Type Description
System.Single
API Level: 9

Methods

View Source

AddArc(Single, Single, Single, Single, Single, Boolean)

Append the arcs.

Declaration
C#
Copy
public bool AddArc(float x, float y, float radius, float startAngle, float sweep, bool pie)
Parameters
Type Name Description
System.Single x

X co-ordinate of end point of the arc.

System.Single y

Y co-ordinate of end point of the arc.

System.Single radius

Radius of arc

System.Single startAngle

Start angle (in degrees) where the arc begins.

System.Single sweep

The Angle measures how long the arc will be drawn.

Boolean 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
Boolean

True when it's successful. False otherwise.

API Level: 9
View Source

AddCircle(Single, Single, Single, Single)

Append a circle with given center and x,y-axis radius

Declaration
C#
Copy
public bool AddCircle(float x, float y, float radiusX, float radiusY)
Parameters
Type Name Description
System.Single x

X co-ordinate of the center of the circle.

System.Single y

Y co-ordinate of the center of the circle.

System.Single radiusX

X axis radius.

System.Single radiusY

Y axis radius.

Returns
Type Description
Boolean

True when it's successful. False otherwise.

API Level: 9
View Source

AddCubicTo(Single, Single, Single, Single, Single, Single)

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#
Copy
public bool AddCubicTo(float controlPoint1X, float controlPoint1Y, float controlPoint2X, float controlPoint2Y, float endPointX, float endPointY)
Parameters
Type Name Description
System.Single controlPoint1X

X co-ordinate of 1st control point.

System.Single controlPoint1Y

Y co-ordinate of 1st control point.

System.Single controlPoint2X

X co-ordinate of 2nd control point.

System.Single controlPoint2Y

Y co-ordinate of 2nd control point.

System.Single endPointX

X co-ordinate of end point of the line.

System.Single endPointY

Y co-ordinate of end point of the line.

Returns
Type Description
Boolean

True when it's successful. False otherwise.

API Level: 9
View Source

AddLineTo(Single, Single)

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#
Copy
public bool AddLineTo(float x, float y)
Parameters
Type Name Description
System.Single x

X co-ordinate of end point of the line.

System.Single y

Y co-ordinate of end point of the line.

Returns
Type Description
Boolean

True when it's successful. False otherwise.

API Level: 9
View Source

AddMoveTo(Single, Single)

Add a point that sets the given point as the current point, implicitly starting a new subpath and closing the previous one.

Declaration
C#
Copy
public bool AddMoveTo(float x, float y)
Parameters
Type Name Description
System.Single x

X co-ordinate of the current point.

System.Single y

Y co-ordinate of the current point.

Returns
Type Description
Boolean

True when it's successful. False otherwise.

API Level: 9
View Source

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#
Copy
public 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.

API Level: 9
View Source

AddRect(Single, Single, Single, Single, Single, Single)

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#
Copy
public bool AddRect(float x, float y, float width, float height, float roundedCornerX, float roundedCornerY)
Parameters
Type Name Description
System.Single x

X co-ordinate of the rectangle.

System.Single y

Y co-ordinate of the rectangle.

System.Single width

Width of the rectangle.

System.Single height

Height of the rectangle.

System.Single roundedCornerX

The x radius of the rounded corner and should be in range [ 0 to w/2 ].

System.Single roundedCornerY

The y radius of the rounded corner and should be in range [ 0 to w/2 ].

Returns
Type Description
Boolean

True when it's successful. False otherwise.

API Level: 9
View Source

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#
Copy
public bool Close()
Returns
Type Description
Boolean

True when it's successful. False otherwise.

API Level: 9
View Source

ResetPath()

Reset the added path(rect, circle, path, etc...) information. Color and Stroke information are keeped.

Declaration
C#
Copy
public bool ResetPath()
Returns
Type Description
Boolean

True when it's successful. False otherwise.

API Level: 9

Implements

System.ComponentModel.INotifyPropertyChanged
System.IDisposable