コード例 #1
0
        protected override void OnRender(IDrawingContext context, Rect bounds, double opacity)
        {
            base.OnRender(context, bounds, opacity);

            Polygon polygon = WpfElement as Polygon;

            if (polygon.Points != null)
            {
                DrawingStyle style = DrawingStyle.FromElement(this);
                style.Fill            = polygon.Fill;
                style.Stroke          = polygon.Stroke;
                style.StrokeThickness = new Thickness(polygon.StrokeThickness);
                style.Opacity         = opacity;

                context.DrawPolygon(bounds, polygon.Points.ToArray(), style);
            }
        }