2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
22 /// The Polygon is a widget that used to draw a polygon (filled).
24 /// <since_tizen> preview </since_tizen>
25 public class Polygon : EvasObject
28 /// Creates and initializes a new instance of the Polygon class.
29 /// <param name="parent">The EvasObject to which the new Polygon will be attached as a child.</param>
31 /// <since_tizen> preview </since_tizen>
32 public Polygon(EvasObject parent) : base(parent)
37 /// Adds a new vertex to the Polygon.
38 /// <param name="x">The X coordinate of the new vertex.</param>
39 /// <param name="y">The Y coordinate of the new vertex.</param>
41 /// <since_tizen> preview </since_tizen>
42 public void AddPoint(int x, int y)
44 Interop.Evas.evas_object_polygon_point_add(Handle, x, y);
48 /// Adds a new vertex to the Polygon.
49 /// <param name="p">The coordinates of the new vertex.</param>
51 /// <since_tizen> preview </since_tizen>
52 public void AddPoint(Point p)
58 /// Removes all the vertices of the Polygon, making it empty.
60 /// <since_tizen> preview </since_tizen>
61 public void ClearPoints()
63 Interop.Evas.evas_object_polygon_points_clear(Handle);
67 /// Creates a widget handle.
69 /// <param name="parent">Parent EvasObject</param>
70 /// <returns>Handle IntPtr</returns>
71 /// <since_tizen> preview </since_tizen>
72 protected override IntPtr CreateHandle(EvasObject parent)
74 IntPtr evas = Interop.Evas.evas_object_evas_get(parent.Handle);
75 return Interop.Evas.evas_object_polygon_add(evas);