Beispiel #1
0
        private void DrawForwardRightBackwardLeft()
        {
            //get graphics context
            using (CGContext g = UIGraphics.GetCurrentContext()) {
                //set up drawing attributes
                g.SetLineWidth(STROKE_WIDTH);
                //g.SetFillColor (0, 0, 178, 255);
                FILL.SetFill();
                STROKE.SetStroke();

                var outline = new CGPath();
                var body    = new CGPath();

                var x0 = 0;
                var x1 = this.Frame.Width * GUTTER;
                var x2 = this.Frame.Width - x1;
                var x3 = this.Frame.Width;
                var y0 = 0;
                var y1 = this.Frame.Height * GUTTER;
                var y2 = this.Frame.Height - y1;
                var y3 = this.Frame.Height;

                var trPoints = new CGPoint[] {
                    new CGPoint(x2, y0),
                    new CGPoint(x2, y1),
                    new CGPoint(x3, y1)
                };
                var brPoints = new CGPoint[] {
                    new CGPoint(x3, y2),
                    new CGPoint(x2, y2),
                    new CGPoint(x2, y3)
                };
                var blPoints = new CGPoint[] {
                    new CGPoint(x1, y3),
                    new CGPoint(x1, y2),
                    new CGPoint(x0, y2)
                };
                var tlPoints = new CGPoint[] {
                    new CGPoint(x0, y1),
                    new CGPoint(x1, y1),
                    new CGPoint(x1, y0)
                };

                body.AddLines(trPoints.Union(brPoints).Union(blPoints).Union(tlPoints).ToArray());
                body.CloseSubpath();

                outline.AddLines(trPoints);
                outline.AddLines(brPoints);
                outline.AddLines(blPoints);
                outline.AddLines(tlPoints);

                g.AddPath(body);
                g.DrawPath(CGPathDrawingMode.Fill);

                g.AddPath(outline);
                g.DrawPath(CGPathDrawingMode.Stroke);
            }
        }
Beispiel #2
0
        private void DrawRightForwardBackward()
        {
            //get graphics context
            using (CGContext g = UIGraphics.GetCurrentContext ()) {

                //set up drawing attributes
                g.SetLineWidth (STROKE_WIDTH);
                //g.SetFillColor (0, 0, 178, 255);
                FILL.SetFill ();
                STROKE.SetStroke ();

                var outline = new CGPath();
                var body = new CGPath ();

                var x0 = 0;
                var x1 = this.Frame.Width * GUTTER;
                var x2 = this.Frame.Width - x1;
                var x3 = this.Frame.Width;
                var y0 = 0;
                var y1 = this.Frame.Height * GUTTER;
                var y2 = this.Frame.Height - y1;
                var y3 = this.Frame.Height;

                var trPoints = new CGPoint[] {
                    new CGPoint (x2, y0),
                    new CGPoint (x2, y1),
                    new CGPoint (x3, y1)
                };
                var bPoints = new CGPoint[] {
                    new CGPoint (x3, y2),
                    new CGPoint (x2, y2),
                    new CGPoint (x2, y3)
                };
                var tlPoints = new CGPoint[] {
                    new CGPoint (x1, y3),
                    new CGPoint (x1, y0),
                };

                body.AddLines (trPoints.Union(bPoints).Union(tlPoints).ToArray());
                body.CloseSubpath ();

                outline.AddLines (trPoints);
                outline.AddLines (bPoints);
                outline.AddLines (tlPoints);

                g.AddPath(body);
                g.DrawPath(CGPathDrawingMode.Fill);

                g.AddPath(outline);
                g.DrawPath(CGPathDrawingMode.Stroke);
            }
        }