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 public class Polygon : EvasObject
27 /// Creates and initializes a new instance of the Polygon class.
28 /// <param name="parent">The EvasObject to which the new Polygon will be attached as a child.</param>
30 public Polygon(EvasObject parent) : base(parent)
35 /// Adds a new vertex to the Polygon.
36 /// <param name="x">The X coordinate of the new vertex.</param>
37 /// <param name="y">The Y coordinate of the new vertex.</param>
39 public void AddPoint(int x, int y)
41 Interop.Evas.evas_object_polygon_point_add(Handle, x, y);
45 /// Adds a new vertex to the Polygon.
46 /// <param name="p">The coordinates of the new vertex.</param>
48 public void AddPoint(Point p)
54 /// Removes all the vertices of the Polygon, making it empty.
56 public void ClearPoints()
58 Interop.Evas.evas_object_polygon_points_clear(Handle);
61 protected override IntPtr CreateHandle(EvasObject parent)
63 IntPtr evas = Interop.Evas.evas_object_evas_get(parent.Handle);
64 return Interop.Evas.evas_object_polygon_add(evas);