public override void Draw(TimerTick tick) { UIBezierPath _bezier = new UIBezierPath(); Vector2 pointStart, pointA, pointB, pointEnd; if (IsAnimating) { pointStart = new Vector2(Distance, 0); pointA = new Vector2(BackgroundWidth, ScreenHeight / 4); pointB = new Vector2(BackgroundWidth, ScreenHeight * 3 / 4); pointEnd = new Vector2(Distance, ScreenHeight); _bezier.MoveToPoint(Vector2.Zero); _bezier.AddLineTo(pointStart); _bezier.AddCurveToPoint(pointEnd, pointA, pointB); _bezier.AddLineTo(new Vector2(0, ScreenHeight)); } else { pointStart = Vector2.Zero; pointA = new Vector2(Distance, ScreenHeight / 4); pointB = new Vector2(Distance, ScreenHeight * 3 / 4); pointEnd = new Vector2(0, ScreenHeight); _bezier.MoveToPoint(pointStart); _bezier.AddCurveToPoint(pointEnd, pointA, pointB); } _bezier.ClosePath(); Drawer.FillGeometry(_bezier.GetPath(), Brush); base.Draw(tick); }
private void DrawTakePhotoButton(CGRect frame) { var color = UIColor.White; var bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(frame.GetMinX() + 0.50000f * frame.Width, frame.GetMinY() + 0.08333f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.27302f * frame.Width, frame.GetMinY() + 0.15053f * frame.Height), new CGPoint(frame.GetMinX() + 0.41628f * frame.Width, frame.GetMinY() + 0.08333f * frame.Height), new CGPoint(frame.GetMinX() + 0.33832f * frame.Width, frame.GetMinY() + 0.10803f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.08333f * frame.Width, frame.GetMinY() + 0.50000f * frame.Height), new CGPoint(frame.GetMinX() + 0.15883f * frame.Width, frame.GetMinY() + 0.22484f * frame.Height), new CGPoint(frame.GetMinX() + 0.08333f * frame.Width, frame.GetMinY() + 0.35360f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.50000f * frame.Width, frame.GetMinY() + 0.91667f * frame.Height), new CGPoint(frame.GetMinX() + 0.08333f * frame.Width, frame.GetMinY() + 0.73012f * frame.Height), new CGPoint(frame.GetMinX() + 0.26988f * frame.Width, frame.GetMinY() + 0.91667f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.91667f * frame.Width, frame.GetMinY() + 0.50000f * frame.Height), new CGPoint(frame.GetMinX() + 0.73012f * frame.Width, frame.GetMinY() + 0.91667f * frame.Height), new CGPoint(frame.GetMinX() + 0.91667f * frame.Width, frame.GetMinY() + 0.73012f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.50000f * frame.Width, frame.GetMinY() + 0.08333f * frame.Height), new CGPoint(frame.GetMinX() + 0.91667f * frame.Width, frame.GetMinY() + 0.26988f * frame.Height), new CGPoint(frame.GetMinX() + 0.73012f * frame.Width, frame.GetMinY() + 0.08333f * frame.Height)); bezierPath.ClosePath(); bezierPath.MoveTo(new CGPoint(frame.GetMinX() + 1.00000f * frame.Width, frame.GetMinY() + 0.50000f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.50000f * frame.Width, frame.GetMinY() + 1.00000f * frame.Height), new CGPoint(frame.GetMinX() + 1.00000f * frame.Width, frame.GetMinY() + 0.77614f * frame.Height), new CGPoint(frame.GetMinX() + 0.77614f * frame.Width, frame.GetMinY() + 1.00000f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.00000f * frame.Width, frame.GetMinY() + 0.50000f * frame.Height), new CGPoint(frame.GetMinX() + 0.22386f * frame.Width, frame.GetMinY() + 1.00000f * frame.Height), new CGPoint(frame.GetMinX() + 0.00000f * frame.Width, frame.GetMinY() + 0.77614f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.19894f * frame.Width, frame.GetMinY() + 0.10076f * frame.Height), new CGPoint(frame.GetMinX() + 0.00000f * frame.Width, frame.GetMinY() + 0.33689f * frame.Height), new CGPoint(frame.GetMinX() + 0.07810f * frame.Width, frame.GetMinY() + 0.19203f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.50000f * frame.Width, frame.GetMinY() + 0.00000f * frame.Height), new CGPoint(frame.GetMinX() + 0.28269f * frame.Width, frame.GetMinY() + 0.03751f * frame.Height), new CGPoint(frame.GetMinX() + 0.38696f * frame.Width, frame.GetMinY() + 0.00000f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 1.00000f * frame.Width, frame.GetMinY() + 0.50000f * frame.Height), new CGPoint(frame.GetMinX() + 0.77614f * frame.Width, frame.GetMinY() + 0.00000f * frame.Height), new CGPoint(frame.GetMinX() + 1.00000f * frame.Width, frame.GetMinY() + 0.22386f * frame.Height)); bezierPath.ClosePath(); color.SetFill(); bezierPath.Fill(); UIColor.Black.SetStroke(); bezierPath.LineWidth = 1.0f; bezierPath.Stroke(); var ovalPath = UIBezierPath.FromOval(new CGRect(frame.GetMinX() + NMath.Floor(frame.Width * 0.12500f + 0.5f), frame.GetMinY() + NMath.Floor(frame.Height * 0.12500f + 0.5f), NMath.Floor(frame.Width * 0.87500f + 0.5f) - NMath.Floor(frame.Width * 0.12500f + 0.5f), NMath.Floor(frame.Height * 0.87500f + 0.5f) - NMath.Floor(frame.Height * 0.12500f + 0.5f))); color.SetFill(); ovalPath.Fill(); UIColor.Black.SetStroke(); ovalPath.LineWidth = 1.0f; ovalPath.Stroke(); }
public CGPath createPath() { nfloat height = (nfloat)37.0; var path = new UIBezierPath(); var centerWidth = this.Frame.Width / 2; path.MoveTo(new CGPoint(x: 0, y: 0)); // start top left path.AddLineTo(new CGPoint((centerWidth - height * 2), 0)); // the beginning of the trough // first curve down path.AddCurveToPoint(new CGPoint(x: centerWidth, y: height), controlPoint1: new CGPoint(x: (centerWidth - 30), y: 0), controlPoint2: new CGPoint(x: centerWidth - 35, y: height)); // second curve up path.AddCurveToPoint(new CGPoint(x: (centerWidth + height * 2), y: 0), controlPoint1: new CGPoint(x: centerWidth + 35, y: height), controlPoint2: new CGPoint(x: (centerWidth + 30), y: 0)); // complete the rect path.AddLineTo(new CGPoint(x: this.Frame.Width, y: 0)); path.AddLineTo(new CGPoint(x: this.Frame.Width, y: this.Frame.Height)); path.AddLineTo(new CGPoint(x: 0, y: this.Frame.Height)); path.ClosePath(); return(path.CGPath); }
private void DrawNotImplemented(CGRect frame) { UIBezierPath textPath = new UIBezierPath(); textPath.MoveTo(new CGPoint(frame.GetMinX() + 0.40164f * frame.Width, frame.GetMinY() + 0.39663f * frame.Height)); textPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.40164f * frame.Width, frame.GetMinY() + 0.31069f * frame.Height)); textPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.31411f * frame.Width, frame.GetMinY() + 0.31069f * frame.Height)); textPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.31411f * frame.Width, frame.GetMinY() + 0.39663f * frame.Height)); textPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.40164f * frame.Width, frame.GetMinY() + 0.39663f * frame.Height)); textPath.ClosePath(); textPath.MoveTo(new CGPoint(frame.GetMinX() + 0.31411f * frame.Width, frame.GetMinY() + 0.62503f * frame.Height)); textPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.31411f * frame.Width, frame.GetMinY() + 0.71097f * frame.Height)); textPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.40164f * frame.Width, frame.GetMinY() + 0.71097f * frame.Height)); textPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.40164f * frame.Width, frame.GetMinY() + 0.62503f * frame.Height)); textPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.31411f * frame.Width, frame.GetMinY() + 0.62503f * frame.Height)); textPath.ClosePath(); textPath.MoveTo(new CGPoint(frame.GetMinX() + 0.62874f * frame.Width, frame.GetMinY() + 0.86349f * frame.Height)); textPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.68000f * frame.Width, frame.GetMinY() + 0.86349f * frame.Height)); textPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.59996f * frame.Width, frame.GetMinY() + 0.68696f * frame.Height), new CGPoint(frame.GetMinX() + 0.64267f * frame.Width, frame.GetMinY() + 0.80413f * frame.Height), new CGPoint(frame.GetMinX() + 0.61600f * frame.Width, frame.GetMinY() + 0.74529f * frame.Height)); textPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.57591f * frame.Width, frame.GetMinY() + 0.50192f * frame.Height), new CGPoint(frame.GetMinX() + 0.58393f * frame.Width, frame.GetMinY() + 0.62864f * frame.Height), new CGPoint(frame.GetMinX() + 0.57591f * frame.Width, frame.GetMinY() + 0.56696f * frame.Height)); textPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.59957f * frame.Width, frame.GetMinY() + 0.31998f * frame.Height), new CGPoint(frame.GetMinX() + 0.57591f * frame.Width, frame.GetMinY() + 0.43843f * frame.Height), new CGPoint(frame.GetMinX() + 0.58380f * frame.Width, frame.GetMinY() + 0.37779f * frame.Height)); textPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.68000f * frame.Width, frame.GetMinY() + 0.14500f * frame.Height), new CGPoint(frame.GetMinX() + 0.61534f * frame.Width, frame.GetMinY() + 0.26217f * frame.Height), new CGPoint(frame.GetMinX() + 0.64215f * frame.Width, frame.GetMinY() + 0.20384f * frame.Height)); textPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.62874f * frame.Width, frame.GetMinY() + 0.14500f * frame.Height)); textPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.53609f * frame.Width, frame.GetMinY() + 0.31765f * frame.Height), new CGPoint(frame.GetMinX() + 0.58774f * frame.Width, frame.GetMinY() + 0.19816f * frame.Height), new CGPoint(frame.GetMinX() + 0.55685f * frame.Width, frame.GetMinY() + 0.25572f * frame.Height)); textPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.50494f * frame.Width, frame.GetMinY() + 0.50192f * frame.Height), new CGPoint(frame.GetMinX() + 0.51532f * frame.Width, frame.GetMinY() + 0.37959f * frame.Height), new CGPoint(frame.GetMinX() + 0.50494f * frame.Width, frame.GetMinY() + 0.44102f * frame.Height)); textPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.51361f * frame.Width, frame.GetMinY() + 0.59948f * frame.Height), new CGPoint(frame.GetMinX() + 0.50494f * frame.Width, frame.GetMinY() + 0.53599f * frame.Height), new CGPoint(frame.GetMinX() + 0.50783f * frame.Width, frame.GetMinY() + 0.56851f * frame.Height)); textPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.53845f * frame.Width, frame.GetMinY() + 0.69006f * frame.Height), new CGPoint(frame.GetMinX() + 0.51940f * frame.Width, frame.GetMinY() + 0.63045f * frame.Height), new CGPoint(frame.GetMinX() + 0.52768f * frame.Width, frame.GetMinY() + 0.66064f * frame.Height)); textPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.57749f * frame.Width, frame.GetMinY() + 0.77716f * frame.Height), new CGPoint(frame.GetMinX() + 0.54923f * frame.Width, frame.GetMinY() + 0.71948f * frame.Height), new CGPoint(frame.GetMinX() + 0.56224f * frame.Width, frame.GetMinY() + 0.74852f * frame.Height)); textPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.62874f * frame.Width, frame.GetMinY() + 0.86349f * frame.Height), new CGPoint(frame.GetMinX() + 0.59273f * frame.Width, frame.GetMinY() + 0.80581f * frame.Height), new CGPoint(frame.GetMinX() + 0.60982f * frame.Width, frame.GetMinY() + 0.83459f * frame.Height)); textPath.ClosePath(); UIColor.Black.SetFill(); textPath.Fill(); }
private void DrawInsectoid(CGRect rect) { //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(rect.GetMinX() + 0.15500f * rect.Width, rect.GetMinY() + 0.47746f * rect.Height)); bezierPath.AddLineTo(new CGPoint(rect.GetMinX() + 0.19384f * rect.Width, rect.GetMinY() + 0.54225f * rect.Height)); bezierPath.AddLineTo(new CGPoint(rect.GetMinX() + 0.84116f * rect.Width, rect.GetMinY() + 0.62000f * rect.Height)); bezierPath.AddLineTo(new CGPoint(rect.GetMinX() + 0.88000f * rect.Width, rect.GetMinY() + 0.54225f * rect.Height)); bezierPath.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.54339f * rect.Width, rect.GetMinY() + 0.29605f * rect.Height), new CGPoint(rect.GetMinX() + 0.88000f * rect.Width, rect.GetMinY() + 0.54225f * rect.Height), new CGPoint(rect.GetMinX() + 0.77643f * rect.Width, rect.GetMinY() + 0.33492f * rect.Height)); bezierPath.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.15500f * rect.Width, rect.GetMinY() + 0.47746f * rect.Height), new CGPoint(rect.GetMinX() + 0.31036f * rect.Width, rect.GetMinY() + 0.25718f * rect.Height), new CGPoint(rect.GetMinX() + 0.15500f * rect.Width, rect.GetMinY() + 0.47746f * rect.Height)); bezierPath.ClosePath(); UIColor.Gray.SetFill(); bezierPath.Fill(); //// Oval Drawing var ovalPath = UIBezierPath.FromOval(new CGRect(rect.GetMinX() + NMath.Floor(rect.Width * 0.13000f + 0.5f), rect.GetMinY() + NMath.Floor(rect.Height * 0.32000f + 0.5f), NMath.Floor(rect.Width * 0.36000f + 0.5f) - NMath.Floor(rect.Width * 0.13000f + 0.5f), NMath.Floor(rect.Height * 0.56000f + 0.5f) - NMath.Floor(rect.Height * 0.32000f + 0.5f))); UIColor.Gray.SetFill(); ovalPath.Fill(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new CGPoint(rect.GetMinX() + 0.66000f * rect.Width, rect.GetMinY() + 0.53000f * rect.Height)); bezier2Path.AddLineTo(new CGPoint(rect.GetMinX() + 0.77000f * rect.Width, rect.GetMinY() + 0.53000f * rect.Height)); bezier2Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.73000f * rect.Width, rect.GetMinY() + 0.71000f * rect.Height), new CGPoint(rect.GetMinX() + 0.77000f * rect.Width, rect.GetMinY() + 0.53000f * rect.Height), new CGPoint(rect.GetMinX() + 0.83000f * rect.Width, rect.GetMinY() + 0.71000f * rect.Height)); bezier2Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.66000f * rect.Width, rect.GetMinY() + 0.53000f * rect.Height), new CGPoint(rect.GetMinX() + 0.71500f * rect.Width, rect.GetMinY() + 0.60000f * rect.Height), new CGPoint(rect.GetMinX() + 0.66000f * rect.Width, rect.GetMinY() + 0.53000f * rect.Height)); bezier2Path.ClosePath(); UIColor.Gray.SetFill(); bezier2Path.Fill(); //// Bezier 3 Drawing UIBezierPath bezier3Path = new UIBezierPath(); bezier3Path.MoveTo(new CGPoint(rect.GetMinX() + 0.54338f * rect.Width, rect.GetMinY() + 0.48500f * rect.Height)); bezier3Path.AddLineTo(new CGPoint(rect.GetMinX() + 0.66500f * rect.Width, rect.GetMinY() + 0.52500f * rect.Height)); bezier3Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.54338f * rect.Width, rect.GetMinY() + 0.70500f * rect.Height), new CGPoint(rect.GetMinX() + 0.66500f * rect.Width, rect.GetMinY() + 0.52500f * rect.Height), new CGPoint(rect.GetMinX() + 0.63459f * rect.Width, rect.GetMinY() + 0.70500f * rect.Height)); bezier3Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.54338f * rect.Width, rect.GetMinY() + 0.48500f * rect.Height), new CGPoint(rect.GetMinX() + 0.53578f * rect.Width, rect.GetMinY() + 0.66000f * rect.Height), new CGPoint(rect.GetMinX() + 0.54338f * rect.Width, rect.GetMinY() + 0.48500f * rect.Height)); bezier3Path.ClosePath(); UIColor.Gray.SetFill(); bezier3Path.Fill(); //// Bezier 4 Drawing UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new CGPoint(rect.GetMinX() + 0.44500f * rect.Width, rect.GetMinY() + 0.49500f * rect.Height)); bezier4Path.AddLineTo(new CGPoint(rect.GetMinX() + 0.32805f * rect.Width, rect.GetMinY() + 0.52500f * rect.Height)); bezier4Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.40115f * rect.Width, rect.GetMinY() + 0.69500f * rect.Height), new CGPoint(rect.GetMinX() + 0.32805f * rect.Width, rect.GetMinY() + 0.52500f * rect.Height), new CGPoint(rect.GetMinX() + 0.28420f * rect.Width, rect.GetMinY() + 0.69500f * rect.Height)); bezier4Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.44500f * rect.Width, rect.GetMinY() + 0.49500f * rect.Height), new CGPoint(rect.GetMinX() + 0.40845f * rect.Width, rect.GetMinY() + 0.59000f * rect.Height), new CGPoint(rect.GetMinX() + 0.44500f * rect.Width, rect.GetMinY() + 0.49500f * rect.Height)); bezier4Path.ClosePath(); UIColor.Gray.SetFill(); bezier4Path.Fill(); }
public override void Draw(RectangleF frame) { return; //// General Declarations var colorSpace = CGColorSpace.CreateDeviceRGB(); var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor gradientColor = UIColor.FromRGBA(0.462f, 0.838f, 1.000f, 1.000f); UIColor blueBorder = UIColor.FromRGBA(0.000f, 0.590f, 1.000f, 1.000f); //// Gradient Declarations var gradientColors = new CGColor [] { UIColor.White.CGColor, UIColor.FromRGBA(0.748f, 0.920f, 1.000f, 1.000f).CGColor, gradientColor.CGColor }; var gradientLocations = new float [] { 0, 0.71f, 1 }; var gradient = new CGGradient(colorSpace, gradientColors, gradientLocations); //// Frames //// Abstracted Attributes var textContent = _controller.Title; //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(frame.GetMinX() + 0.99530f * frame.Width, frame.GetMinY() + 0.27632f * frame.Height)); bezierPath.AddLineTo(new PointF(frame.GetMinX() + 0.99530f * frame.Width, frame.GetMinY() + 0.32895f * frame.Height)); bezierPath.AddLineTo(new PointF(frame.GetMinX() + 0.99530f * frame.Width, frame.GetMinY() + 0.96053f * frame.Height)); bezierPath.AddLineTo(new PointF(frame.GetMinX() + 0.00352f * frame.Width, frame.GetMinY() + 0.96053f * frame.Height)); bezierPath.AddLineTo(new PointF(frame.GetMinX() + 0.00352f * frame.Width, frame.GetMinY() + 0.38158f * frame.Height)); bezierPath.AddLineTo(new PointF(frame.GetMinX() + 0.00352f * frame.Width, frame.GetMinY() + 0.27632f * frame.Height)); bezierPath.AddCurveToPoint(new PointF(frame.GetMinX() + 0.07487f * frame.Width, frame.GetMinY() + 0.01316f * frame.Height), new PointF(frame.GetMinX() + 0.00352f * frame.Width, frame.GetMinY() + 0.13098f * frame.Height), new PointF(frame.GetMinX() + 0.03547f * frame.Width, frame.GetMinY() + 0.01316f * frame.Height)); bezierPath.AddLineTo(new PointF(frame.GetMinX() + 0.92395f * frame.Width, frame.GetMinY() + 0.01316f * frame.Height)); bezierPath.AddCurveToPoint(new PointF(frame.GetMinX() + 0.99530f * frame.Width, frame.GetMinY() + 0.27632f * frame.Height), new PointF(frame.GetMinX() + 0.96335f * frame.Width, frame.GetMinY() + 0.01316f * frame.Height), new PointF(frame.GetMinX() + 0.99530f * frame.Width, frame.GetMinY() + 0.13098f * frame.Height)); bezierPath.ClosePath(); context.SaveState(); bezierPath.AddClip(); var bezierBounds = bezierPath.Bounds; context.DrawLinearGradient(gradient, new PointF(bezierBounds.GetMidX(), bezierBounds.GetMinY()), new PointF(bezierBounds.GetMidX(), bezierBounds.GetMaxY()), 0); context.RestoreState(); blueBorder.SetStroke(); bezierPath.LineWidth = 1; bezierPath.Stroke(); //// Text Drawing var textRect = new RectangleF(frame.GetMinX() + (float)Math.Floor(frame.Width * 0.02410f + 0.5f), frame.GetMinY() + (float)Math.Floor(frame.Height * 0.25000f + 0.5f), (float)Math.Floor(frame.Width * 0.94578f + 0.5f) - (float)Math.Floor(frame.Width * 0.02410f + 0.5f), (float)Math.Floor(frame.Height * 0.91667f + 0.5f) - (float)Math.Floor(frame.Height * 0.25000f + 0.5f)); UIColor.Black.SetFill(); new NSString(textContent).DrawString(textRect, UIFont.FromName("Helvetica", 12), UILineBreakMode.WordWrap, UITextAlignment.Center); }
//// Drawing Methods public static void DrawRefreshIcon(UIColor strokeColor) { //// Group 2 { //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(22.65f, 2.0f)); bezierPath.AddCurveToPoint(new CGPoint(36.33f, 7.67f), new CGPoint(27.6f, 2.0f), new CGPoint(32.55f, 3.89f)); bezierPath.AddCurveToPoint(new CGPoint(38.13f, 32.97f), new CGPoint(43.23f, 14.57f), new CGPoint(43.83f, 25.39f)); bezierPath.AddLineTo(new CGPoint(34.26f, 36.84f)); strokeColor.SetStroke(); bezierPath.LineWidth = 1.0f; bezierPath.Stroke(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new CGPoint(21.35f, 42.0f)); bezier2Path.AddCurveToPoint(new CGPoint(7.67f, 36.33f), new CGPoint(16.4f, 42.0f), new CGPoint(11.45f, 40.11f)); bezier2Path.AddCurveToPoint(new CGPoint(5.87f, 11.03f), new CGPoint(0.77f, 29.43f), new CGPoint(0.17f, 18.61f)); bezier2Path.AddLineTo(new CGPoint(9.74f, 7.16f)); strokeColor.SetStroke(); bezier2Path.LineWidth = 1.0f; bezier2Path.Stroke(); //// Bezier 3 Drawing UIBezierPath bezier3Path = new UIBezierPath(); bezier3Path.MoveTo(new CGPoint(34.26f, 29.74f)); bezier3Path.AddLineTo(new CGPoint(34.26f, 36.84f)); bezier3Path.AddLineTo(new CGPoint(41.35f, 36.84f)); bezier3Path.LineJoinStyle = CGLineJoin.Bevel; strokeColor.SetStroke(); bezier3Path.LineWidth = 1.0f; bezier3Path.Stroke(); //// Bezier 4 Drawing UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new CGPoint(9.74f, 14.26f)); bezier4Path.AddLineTo(new CGPoint(9.74f, 7.16f)); bezier4Path.AddLineTo(new CGPoint(2.65f, 7.16f)); bezier4Path.LineJoinStyle = CGLineJoin.Bevel; strokeColor.SetStroke(); bezier4Path.LineWidth = 1.0f; bezier4Path.Stroke(); } }
static void paintCodeNonRetina() { //// Color Declarations UIColor color = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); UIColor color2 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 0.000f); //// Group { //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(15.05f, 2.27f)); bezierPath.AddLineTo(new PointF(7.17f, 12.34f)); bezierPath.AddCurveToPoint(new PointF(11.5f, 4.39f), new PointF(7.17f, 12.34f), new PointF(9.53f, 6.9f)); bezierPath.AddCurveToPoint(new PointF(15.05f, 2.27f), new PointF(13.47f, 1.87f), new PointF(15.05f, 2.27f)); color.SetFill(); bezierPath.Fill(); UIColor.Black.SetStroke(); bezierPath.LineWidth = 1; bezierPath.Stroke(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(7.56f, 12.87f)); bezier2Path.AddCurveToPoint(new PointF(17.8f, 5.98f), new PointF(7.56f, 12.87f), new PointF(17.82f, 5.8f)); bezier2Path.AddCurveToPoint(new PointF(16.62f, 8.1f), new PointF(17.78f, 6.15f), new PointF(18.68f, 5.93f)); bezier2Path.AddCurveToPoint(new PointF(7.56f, 12.87f), new PointF(14.56f, 10.26f), new PointF(7.56f, 12.87f)); bezier2Path.ClosePath(); color.SetFill(); bezier2Path.Fill(); UIColor.Black.SetStroke(); bezier2Path.LineWidth = 1; bezier2Path.Stroke(); //// Oval 2 Drawing var oval2Path = UIBezierPath.FromOval(new RectangleF(5.5f, 12.5f, 4, 5)); color2.SetFill(); oval2Path.Fill(); UIColor.Black.SetStroke(); oval2Path.LineWidth = 2; oval2Path.Stroke(); //// Oval Drawing var ovalPath = UIBezierPath.FromOval(new RectangleF(3.5f, 9.5f, 4, 5)); color2.SetFill(); ovalPath.Fill(); UIColor.Black.SetStroke(); ovalPath.LineWidth = 2; ovalPath.Stroke(); } }
// Each of these represents a single layer. // It is fine to draw more than one and layer them, however // Rule - Only one layer per function call. public void DrawMultiplication(CGContext ctx) { //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(25.46f, 22.92f)); bezierPath.AddCurveToPoint(new CGPoint(25.46f, 25.58f), new CGPoint(26.18f, 23.64f), new CGPoint(26.18f, 24.85f)); bezierPath.AddLineTo(new CGPoint(25.58f, 25.46f)); bezierPath.AddCurveToPoint(new CGPoint(22.93f, 25.46f), new CGPoint(24.86f, 26.18f), new CGPoint(23.65f, 26.18f)); bezierPath.AddLineTo(new CGPoint(15.03f, 17.54f)); bezierPath.AddLineTo(new CGPoint(7.13f, 25.46f)); bezierPath.AddCurveToPoint(new CGPoint(4.47f, 25.46f), new CGPoint(6.4f, 26.18f), new CGPoint(5.2f, 26.18f)); bezierPath.AddLineTo(new CGPoint(4.6f, 25.58f)); bezierPath.AddCurveToPoint(new CGPoint(4.6f, 22.92f), new CGPoint(3.88f, 24.85f), new CGPoint(3.88f, 23.64f)); bezierPath.AddLineTo(new CGPoint(12.5f, 15.0f)); bezierPath.AddLineTo(new CGPoint(4.54f, 7.08f)); bezierPath.AddCurveToPoint(new CGPoint(4.54f, 4.42f), new CGPoint(3.82f, 6.36f), new CGPoint(3.82f, 5.15f)); bezierPath.AddLineTo(new CGPoint(4.42f, 4.54f)); bezierPath.AddCurveToPoint(new CGPoint(7.07f, 4.54f), new CGPoint(5.14f, 3.82f), new CGPoint(6.35f, 3.82f)); bezierPath.AddLineTo(new CGPoint(14.97f, 12.46f)); bezierPath.AddLineTo(new CGPoint(22.87f, 4.54f)); bezierPath.AddCurveToPoint(new CGPoint(25.52f, 4.54f), new CGPoint(23.59f, 3.82f), new CGPoint(24.8f, 3.82f)); bezierPath.AddLineTo(new CGPoint(25.4f, 4.42f)); bezierPath.AddCurveToPoint(new CGPoint(25.4f, 7.08f), new CGPoint(26.12f, 5.15f), new CGPoint(26.12f, 6.36f)); bezierPath.AddLineTo(new CGPoint(17.56f, 15.0f)); bezierPath.AddLineTo(new CGPoint(25.46f, 22.92f)); bezierPath.ClosePath(); bezierPath.MiterLimit = 4.0f; bezierPath.Fill(); }
private CGPath CreatePath(float centerWidth, float height) { var path = new UIBezierPath(); UIColor.Red.SetStroke(); path.Stroke(); path.MoveTo(new CGPoint(x: 0, y: 0)); path.AddLineTo(new CGPoint(x: (centerWidth - height * 2), y: 0)); path.AddCurveToPoint(new CGPoint(x: centerWidth, y: 30), new CGPoint(x: (centerWidth - 25), y: 0), new CGPoint(x: centerWidth - 40, y: 27)); path.AddCurveToPoint(new CGPoint(x: (centerWidth + height * 2), y: 0), new CGPoint(x: centerWidth + 40, y: 27), new CGPoint(x: (centerWidth + 25), y: 0)); path.AddLineTo(new CGPoint(x: centerWidth * 2, y: 0)); path.AddLineTo(new CGPoint(x: centerWidth * 2, y: height)); path.AddLineTo(new CGPoint(x: 0, y: height)); path.ClosePath(); return(path.CGPath); }
void DrawCrayon(CGContext context, Crayon crayon) { // I <3 Paintcode //// Color Declarations var gradientColor = UIColor.FromRGBA(crayon.R / 255f, crayon.G / 255f, crayon.B / 255f, 1.00f); var gradientColor2 = UIColor.FromRGBA(crayon.R / 255f, crayon.G / 255f, crayon.B / 255f, 0.69f); var gradientColor3 = UIColor.FromRGBA(crayon.R / 255f, crayon.G / 255f, crayon.B / 255f, 0.37f); //// Gradient Declarations var gradientColors = new CGColor [] { gradientColor.CGColor, gradientColor2.CGColor, gradientColor3.CGColor, gradientColor2.CGColor, gradientColor.CGColor }; var gradientLocations = new float [] { 0, 0.37f, 0.66f, 1, 1 }; var gradient = new CGGradient(colorSpace, gradientColors, gradientLocations); //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRoundedRect(new RectangleF(0.5f, 20.5f, 25, 100), UIRectCorner.TopLeft | UIRectCorner.TopRight, new SizeF(8, 8)); context.SaveState(); rectanglePath.AddClip(); context.DrawLinearGradient(gradient, new PointF(0.5f, 70.5f), new PointF(25.5f, 70.5f), 0); context.RestoreState(); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(3.5f, 24.5f)); bezierPath.AddCurveToPoint(new PointF(12, 0.09f), new PointF(6.5f, 17.57f), new PointF(9.79f, -4.27f)); bezierPath.AddCurveToPoint(new PointF(22.5f, 24.5f), new PointF(16.3f, 8.57f), new PointF(22.5f, 24.5f)); context.SaveState(); bezierPath.AddClip(); context.DrawLinearGradient(gradient, new PointF(3.5f, 12.01f), new PointF(22.5f, 12.01f), 0); context.RestoreState(); }
//// PaintCode Trial Version //// www.paintcodeapp.com private void DrawSerpentine(CGRect rect) { //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(rect.GetMinX() + 0.30500f * rect.Width, rect.GetMinY() + 0.43500f * rect.Height)); bezierPath.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.17500f * rect.Width, rect.GetMinY() + 0.40500f * rect.Height), new CGPoint(rect.GetMinX() + 0.30500f * rect.Width, rect.GetMinY() + 0.43500f * rect.Height), new CGPoint(rect.GetMinX() + 0.26500f * rect.Width, rect.GetMinY() + 0.43500f * rect.Height)); bezierPath.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.13500f * rect.Width, rect.GetMinY() + 0.22500f * rect.Height), new CGPoint(rect.GetMinX() + 0.08500f * rect.Width, rect.GetMinY() + 0.37500f * rect.Height), new CGPoint(rect.GetMinX() + 0.09500f * rect.Width, rect.GetMinY() + 0.26500f * rect.Height)); bezierPath.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.41500f * rect.Width, rect.GetMinY() + 0.18500f * rect.Height), new CGPoint(rect.GetMinX() + 0.17500f * rect.Width, rect.GetMinY() + 0.18500f * rect.Height), new CGPoint(rect.GetMinX() + 0.35500f * rect.Width, rect.GetMinY() + 0.14500f * rect.Height)); bezierPath.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.55500f * rect.Width, rect.GetMinY() + 0.40500f * rect.Height), new CGPoint(rect.GetMinX() + 0.47500f * rect.Width, rect.GetMinY() + 0.22500f * rect.Height), new CGPoint(rect.GetMinX() + 0.58500f * rect.Width, rect.GetMinY() + 0.24500f * rect.Height)); bezierPath.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.71500f * rect.Width, rect.GetMinY() + 0.62500f * rect.Height), new CGPoint(rect.GetMinX() + 0.52500f * rect.Width, rect.GetMinY() + 0.56500f * rect.Height), new CGPoint(rect.GetMinX() + 0.63500f * rect.Width, rect.GetMinY() + 0.70500f * rect.Height)); bezierPath.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.89500f * rect.Width, rect.GetMinY() + 0.62500f * rect.Height), new CGPoint(rect.GetMinX() + 0.79500f * rect.Width, rect.GetMinY() + 0.54500f * rect.Height), new CGPoint(rect.GetMinX() + 0.92500f * rect.Width, rect.GetMinY() + 0.54500f * rect.Height)); bezierPath.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.51500f * rect.Width, rect.GetMinY() + 0.81500f * rect.Height), new CGPoint(rect.GetMinX() + 0.86500f * rect.Width, rect.GetMinY() + 0.70500f * rect.Height), new CGPoint(rect.GetMinX() + 0.70500f * rect.Width, rect.GetMinY() + 0.90500f * rect.Height)); bezierPath.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.30500f * rect.Width, rect.GetMinY() + 0.56500f * rect.Height), new CGPoint(rect.GetMinX() + 0.32500f * rect.Width, rect.GetMinY() + 0.72500f * rect.Height), new CGPoint(rect.GetMinX() + 0.30500f * rect.Width, rect.GetMinY() + 0.69500f * rect.Height)); bezierPath.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.30500f * rect.Width, rect.GetMinY() + 0.43500f * rect.Height), new CGPoint(rect.GetMinX() + 0.30500f * rect.Width, rect.GetMinY() + 0.43500f * rect.Height), new CGPoint(rect.GetMinX() + 0.30500f * rect.Width, rect.GetMinY() + 0.43500f * rect.Height)); bezierPath.ClosePath(); UIColor.Gray.SetFill(); bezierPath.Fill(); }
UIBezierPath GetHeartOverlayPath(CGRect originalRect, float scale) { var scaledWidth = (originalRect.Size.Width * scale); var scaledXValue = ((originalRect.Size.Width) - scaledWidth) / 2; var scaledHeight = (originalRect.Size.Height * scale); var scaledYValue = ((originalRect.Size.Height) - scaledHeight) / 2; var scaledRect = new CGRect(x: scaledXValue, y: scaledYValue, width: scaledWidth, height: scaledHeight); UIBezierPath path = new UIBezierPath(); path.MoveTo(new CGPoint(x: originalRect.Size.Width / 2, y: scaledRect.Y + scaledRect.Size.Height)); path.AddCurveToPoint(new CGPoint(x: scaledRect.X, y: scaledRect.Y + (scaledRect.Size.Height / 4)), controlPoint1: new CGPoint(x: scaledRect.X + (scaledRect.Size.Width / 2), y: scaledRect.Y + (scaledRect.Size.Height * 3 / 4)), controlPoint2: new CGPoint(x: scaledRect.X, y: scaledRect.Y + (scaledRect.Size.Height / 2))); path.AddArc(new CGPoint(scaledRect.X + (scaledRect.Size.Width / 4), scaledRect.Y + (scaledRect.Size.Height / 4)), (scaledRect.Size.Width / 4), (nfloat)Math.PI, 0, true); path.AddArc(new CGPoint(scaledRect.X + (scaledRect.Size.Width * 3 / 4), scaledRect.Y + (scaledRect.Size.Height / 4)), (scaledRect.Size.Width / 4), (nfloat)Math.PI, 0, true); path.AddCurveToPoint(new CGPoint(x: originalRect.Size.Width / 2, y: scaledRect.Y + scaledRect.Size.Height), controlPoint1: new CGPoint(x: scaledRect.X + scaledRect.Size.Width, y: scaledRect.Y + (scaledRect.Size.Height / 2)), controlPoint2: new CGPoint(x: scaledRect.X + (scaledRect.Size.Width / 2), y: scaledRect.Y + (scaledRect.Size.Height * 3 / 4))); path.ClosePath(); return(path); }
static void paintCodeRetina() { //// Color Declarations UIColor color2 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(22.72f, 5.43f)); bezierPath.AddCurveToPoint(new PointF(23.37f, 6.19f), new PointF(22.95f, 5.67f), new PointF(23.17f, 5.93f)); bezierPath.AddCurveToPoint(new PointF(27.47f, 4.67f), new PointF(24.63f, 5.42f), new PointF(26.03f, 4.91f)); bezierPath.AddCurveToPoint(new PointF(37.28f, 7.43f), new PointF(30.92f, 4.09f), new PointF(34.61f, 5.01f)); bezierPath.AddCurveToPoint(new PointF(37.28f, 21.57f), new PointF(41.57f, 11.33f), new PointF(41.57f, 17.67f)); bezierPath.AddCurveToPoint(new PointF(27.49f, 24.33f), new PointF(34.62f, 23.99f), new PointF(30.93f, 24.91f)); bezierPath.AddCurveToPoint(new PointF(24.72f, 29.3f), new PointF(27.39f, 26.14f), new PointF(26.47f, 27.92f)); bezierPath.AddCurveToPoint(new PointF(11.28f, 29.3f), new PointF(21.01f, 32.23f), new PointF(14.99f, 32.23f)); bezierPath.AddCurveToPoint(new PointF(9.86f, 20.13f), new PointF(8.13f, 26.82f), new PointF(7.66f, 23.01f)); bezierPath.AddCurveToPoint(new PointF(9.28f, 19.57f), new PointF(9.66f, 19.95f), new PointF(9.47f, 19.77f)); bezierPath.AddCurveToPoint(new PointF(9.28f, 5.43f), new PointF(5.57f, 15.67f), new PointF(5.57f, 9.33f)); bezierPath.AddCurveToPoint(new PointF(22.72f, 5.43f), new PointF(12.99f, 1.52f), new PointF(19.01f, 1.52f)); bezierPath.ClosePath(); UIColor.White.SetFill(); bezierPath.Fill(); UIColor.Black.SetStroke(); bezierPath.LineWidth = 1; bezierPath.Stroke(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(3.5f, 40.5f)); bezier2Path.AddCurveToPoint(new PointF(9.5f, 33.5f), new PointF(9.5f, 33.5f), new PointF(9.5f, 33.5f)); color2.SetFill(); bezier2Path.Fill(); UIColor.Black.SetStroke(); bezier2Path.LineWidth = 2.5f; bezier2Path.Stroke(); //// Bezier 3 Drawing UIBezierPath bezier3Path = new UIBezierPath(); bezier3Path.MoveTo(new PointF(6.5f, 32.5f)); bezier3Path.AddLineTo(new PointF(11.5f, 37.5f)); bezier3Path.AddLineTo(new PointF(10.5f, 32.5f)); bezier3Path.AddLineTo(new PointF(6.5f, 32.5f)); bezier3Path.ClosePath(); color2.SetFill(); bezier3Path.Fill(); UIColor.Black.SetStroke(); bezier3Path.LineWidth = 1; bezier3Path.Stroke(); }
public void DrawDivMulti(CGContext ctx) { //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(56.46f, 22.92f)); bezierPath.AddCurveToPoint(new CGPoint(56.46f, 25.58f), new CGPoint(57.18f, 23.64f), new CGPoint(57.18f, 24.85f)); bezierPath.AddLineTo(new CGPoint(56.58f, 25.46f)); bezierPath.AddCurveToPoint(new CGPoint(53.93f, 25.46f), new CGPoint(55.86f, 26.18f), new CGPoint(54.65f, 26.18f)); bezierPath.AddLineTo(new CGPoint(46.03f, 17.54f)); bezierPath.AddLineTo(new CGPoint(38.13f, 25.46f)); bezierPath.AddCurveToPoint(new CGPoint(35.47f, 25.46f), new CGPoint(37.4f, 26.18f), new CGPoint(36.2f, 26.18f)); bezierPath.AddLineTo(new CGPoint(35.6f, 25.58f)); bezierPath.AddCurveToPoint(new CGPoint(35.6f, 22.92f), new CGPoint(34.88f, 24.85f), new CGPoint(34.88f, 23.64f)); bezierPath.AddLineTo(new CGPoint(43.5f, 15.0f)); bezierPath.AddLineTo(new CGPoint(35.54f, 7.08f)); bezierPath.AddCurveToPoint(new CGPoint(35.54f, 4.42f), new CGPoint(34.82f, 6.36f), new CGPoint(34.82f, 5.15f)); bezierPath.AddLineTo(new CGPoint(35.42f, 4.54f)); bezierPath.AddCurveToPoint(new CGPoint(38.07f, 4.54f), new CGPoint(36.14f, 3.82f), new CGPoint(37.35f, 3.82f)); bezierPath.AddLineTo(new CGPoint(45.97f, 12.46f)); bezierPath.AddLineTo(new CGPoint(53.87f, 4.54f)); bezierPath.AddCurveToPoint(new CGPoint(56.52f, 4.54f), new CGPoint(54.59f, 3.82f), new CGPoint(55.8f, 3.82f)); bezierPath.AddLineTo(new CGPoint(56.4f, 4.42f)); bezierPath.AddCurveToPoint(new CGPoint(56.4f, 7.08f), new CGPoint(57.12f, 5.15f), new CGPoint(57.12f, 6.36f)); bezierPath.AddLineTo(new CGPoint(48.56f, 15.0f)); bezierPath.AddLineTo(new CGPoint(56.46f, 22.92f)); bezierPath.ClosePath(); bezierPath.MiterLimit = 4.0f; bezierPath.Fill(); //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRoundedRect(new CGRect(3.0f, 13.0f, 24.0f, 4.0f), 2.0f); rectanglePath.Fill(); //// Oval1 Drawing var oval1Path = UIBezierPath.FromOval(new CGRect(12.0f, 5.0f, 6.0f, 6.0f)); oval1Path.Fill(); //// Oval2 Drawing var oval2Path = UIBezierPath.FromOval(new CGRect(12.0f, 19.0f, 6.0f, 6.0f)); oval2Path.Fill(); }
public override void TouchesMoved(NSSet touches, UIEvent evt) { isCleared = false; UITouch touch = touches.AnyObject as UITouch; CGPoint point = touch.LocationInView(this); center++; points[center] = point; if (center == 4) { points[3] = new CGPoint((points[2].X + points[4].X) / 2f, (points[2].Y + points[4].Y) / 2f); path.MoveTo(points[0]); path.AddCurveToPoint(points[3], points[1], points[2]); SetNeedsDisplay(); points[0] = points[3]; points[1] = points[4]; center = 1; } }
static void paintCodeRetina() { //// Color Declarations UIColor color = UIColor.FromRGBA(0.000f, 0.219f, 0.657f, 1.000f); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(1.5f, 1.5f)); bezierPath.AddCurveToPoint(new PointF(40.5f, 41.5f), new PointF(40.5f, 41.5f), new PointF(40.5f, 41.5f)); color.SetStroke(); bezierPath.LineWidth = 4; bezierPath.Stroke(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(40.5f, 1.5f)); bezier2Path.AddLineTo(new PointF(1.5f, 42.5f)); color.SetStroke(); bezier2Path.LineWidth = 4; bezier2Path.Stroke(); }
public override void TouchesMoved(MonoTouch.Foundation.NSSet touches, UIEvent evt) { if (!Enabled) { return; } Editing = true; var touch = touches.AnyObject as UITouch; var p = touch.LocationInView(this); ctr++; pts [ctr] = p; if (ctr == 4) { pts[3] = new PointF((pts[2].X + pts[4].X) / 2.0f, (pts[2].Y + pts[4].Y) / 2.0f); // move the endpoint to the middle of the line joining the second control point of the first Bezier segment and the first control point of the second Bezier segment var path = new UIBezierPath(); path.LineWidth = lineThickness; path.MoveTo(pts[0]); path.AddCurveToPoint(pts[3], pts[1], pts[2]); // add a cubic Bezier from pt[0] to pt[3], with control points pt[1] and pt[2] paths.Last().Add(path); this.SetNeedsDisplay(); // replace points and get ready to handle the next segment pts[0] = pts[3]; pts[1] = pts[4]; ctr = 1; } }
private CGPath createCurvedPath(CGPoint anchor, CGPoint[] points) { var path = new UIBezierPath(); if (points.Length > 1) { var previousPoint = points[0]; var startOfCurve = previousPoint; path.MoveTo(anchor); for (int i = 1; i < points.Length; i++) { var endOfCurve = points[i]; var nextPoint = i < points.Length - 1 ? points[i + 1] : points[i]; var(controlPointB, controlPointC) = calculateControlPoints(previousPoint, startOfCurve, endOfCurve, nextPoint); path.AddCurveToPoint(endOfCurve, controlPointB, controlPointC); previousPoint = startOfCurve; startOfCurve = endOfCurve; } } return(path.CGPath); }
static void paintCodeRetina() { //// Color Declarations UIColor color = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); UIColor color2 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 0.000f); //// Group { //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(13.72f, 13.72f)); bezierPath.AddCurveToPoint(new PointF(13.72f, 29.28f), new PointF(9.43f, 18.02f), new PointF(9.43f, 24.98f)); bezierPath.AddCurveToPoint(new PointF(29.28f, 29.28f), new PointF(18.02f, 33.57f), new PointF(24.98f, 33.57f)); bezierPath.AddCurveToPoint(new PointF(29.28f, 13.72f), new PointF(33.57f, 24.98f), new PointF(33.57f, 18.02f)); bezierPath.AddCurveToPoint(new PointF(13.72f, 13.72f), new PointF(24.98f, 9.43f), new PointF(18.02f, 9.43f)); bezierPath.ClosePath(); bezierPath.MoveTo(new PointF(32.11f, 10.19f)); bezierPath.AddCurveToPoint(new PointF(32.11f, 32.81f), new PointF(37.96f, 16.43f), new PointF(37.96f, 26.57f)); bezierPath.AddCurveToPoint(new PointF(10.89f, 32.81f), new PointF(26.25f, 39.06f), new PointF(16.75f, 39.06f)); bezierPath.AddCurveToPoint(new PointF(10.89f, 10.19f), new PointF(5.04f, 26.57f), new PointF(5.04f, 16.43f)); bezierPath.AddCurveToPoint(new PointF(32.11f, 10.19f), new PointF(16.75f, 3.94f), new PointF(26.25f, 3.94f)); bezierPath.ClosePath(); color.SetFill(); bezierPath.Fill(); UIColor.Black.SetStroke(); bezierPath.LineWidth = 1; bezierPath.Stroke(); //// Rounded Rectangle Drawing var roundedRectanglePath = UIBezierPath.FromRoundedRect(new RectangleF(16.5f, 1.5f, 11, 8), 4); color.SetFill(); roundedRectanglePath.Fill(); color2.SetStroke(); roundedRectanglePath.LineWidth = 1; roundedRectanglePath.Stroke(); //// Rounded Rectangle 2 Drawing var roundedRectangle2Path = UIBezierPath.FromRoundedRect(new RectangleF(31.5f, 17.5f, 11, 8), 4); color.SetFill(); roundedRectangle2Path.Fill(); color2.SetStroke(); roundedRectangle2Path.LineWidth = 1; roundedRectangle2Path.Stroke(); //// Rounded Rectangle 3 Drawing var roundedRectangle3Path = UIBezierPath.FromRoundedRect(new RectangleF(0.5f, 17.5f, 11, 8), 4); color.SetFill(); roundedRectangle3Path.Fill(); color2.SetStroke(); roundedRectangle3Path.LineWidth = 1; roundedRectangle3Path.Stroke(); //// Rounded Rectangle 4 Drawing var roundedRectangle4Path = UIBezierPath.FromRoundedRect(new RectangleF(16.5f, 35.5f, 11, 8), 4); color.SetFill(); roundedRectangle4Path.Fill(); color2.SetStroke(); roundedRectangle4Path.LineWidth = 1; roundedRectangle4Path.Stroke(); //// Rounded Rectangle 5 Drawing var roundedRectangle5Path = UIBezierPath.FromRoundedRect(new RectangleF(29.5f, 29.5f, 11, 8), 4); color.SetFill(); roundedRectangle5Path.Fill(); color2.SetStroke(); roundedRectangle5Path.LineWidth = 1; roundedRectangle5Path.Stroke(); //// Rounded Rectangle 6 Drawing var roundedRectangle6Path = UIBezierPath.FromRoundedRect(new RectangleF(3.5f, 29.5f, 11, 8), 4); color.SetFill(); roundedRectangle6Path.Fill(); color2.SetStroke(); roundedRectangle6Path.LineWidth = 1; roundedRectangle6Path.Stroke(); //// Rounded Rectangle 7 Drawing var roundedRectangle7Path = UIBezierPath.FromRoundedRect(new RectangleF(3.5f, 5.5f, 11, 8), 4); color.SetFill(); roundedRectangle7Path.Fill(); color2.SetStroke(); roundedRectangle7Path.LineWidth = 1; roundedRectangle7Path.Stroke(); //// Rounded Rectangle 8 Drawing var roundedRectangle8Path = UIBezierPath.FromRoundedRect(new RectangleF(29.5f, 5.5f, 11, 8), 4); color.SetFill(); roundedRectangle8Path.Fill(); color2.SetStroke(); roundedRectangle8Path.LineWidth = 1; roundedRectangle8Path.Stroke(); } //// Group 2 { //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(18.06f, 18.03f)); bezier2Path.AddCurveToPoint(new PointF(18.06f, 24.18f), new PointF(16.17f, 19.73f), new PointF(16.17f, 22.48f)); bezier2Path.AddCurveToPoint(new PointF(24.94f, 24.18f), new PointF(19.96f, 25.88f), new PointF(23.04f, 25.88f)); bezier2Path.AddCurveToPoint(new PointF(24.94f, 18.03f), new PointF(26.83f, 22.48f), new PointF(26.83f, 19.73f)); bezier2Path.AddCurveToPoint(new PointF(18.06f, 18.03f), new PointF(23.04f, 16.33f), new PointF(19.96f, 16.33f)); bezier2Path.ClosePath(); bezier2Path.MoveTo(new PointF(26.19f, 16.63f)); bezier2Path.AddCurveToPoint(new PointF(26.19f, 25.58f), new PointF(28.77f, 19.1f), new PointF(28.77f, 23.11f)); bezier2Path.AddCurveToPoint(new PointF(16.81f, 25.58f), new PointF(23.6f, 28.05f), new PointF(19.4f, 28.05f)); bezier2Path.AddCurveToPoint(new PointF(16.81f, 16.63f), new PointF(14.23f, 23.11f), new PointF(14.23f, 19.1f)); bezier2Path.AddCurveToPoint(new PointF(26.19f, 16.63f), new PointF(19.4f, 14.16f), new PointF(23.6f, 14.16f)); bezier2Path.ClosePath(); color.SetFill(); bezier2Path.Fill(); UIColor.Black.SetStroke(); bezier2Path.LineWidth = 1; bezier2Path.Stroke(); //// Rounded Rectangle 9 Drawing var roundedRectangle9Path = UIBezierPath.FromRoundedRect(new RectangleF(20.5f, 13.5f, 3, 3), 1.5f); color.SetFill(); roundedRectangle9Path.Fill(); color2.SetStroke(); roundedRectangle9Path.LineWidth = 1; roundedRectangle9Path.Stroke(); //// Rounded Rectangle 10 Drawing var roundedRectangle10Path = UIBezierPath.FromRoundedRect(new RectangleF(25.5f, 19.5f, 5, 3), 1.5f); color.SetFill(); roundedRectangle10Path.Fill(); color2.SetStroke(); roundedRectangle10Path.LineWidth = 1; roundedRectangle10Path.Stroke(); //// Rounded Rectangle 11 Drawing var roundedRectangle11Path = UIBezierPath.FromRoundedRect(new RectangleF(12.5f, 19.5f, 5, 3), 1.5f); color.SetFill(); roundedRectangle11Path.Fill(); color2.SetStroke(); roundedRectangle11Path.LineWidth = 1; roundedRectangle11Path.Stroke(); //// Rounded Rectangle 12 Drawing var roundedRectangle12Path = UIBezierPath.FromRoundedRect(new RectangleF(20.5f, 26.5f, 3, 3), 1.5f); color.SetFill(); roundedRectangle12Path.Fill(); color2.SetStroke(); roundedRectangle12Path.LineWidth = 1; roundedRectangle12Path.Stroke(); //// Rounded Rectangle 13 Drawing var roundedRectangle13Path = UIBezierPath.FromRoundedRect(new RectangleF(24.5f, 24.5f, 5, 2), 1); color.SetFill(); roundedRectangle13Path.Fill(); color2.SetStroke(); roundedRectangle13Path.LineWidth = 1; roundedRectangle13Path.Stroke(); //// Rounded Rectangle 14 Drawing var roundedRectangle14Path = UIBezierPath.FromRoundedRect(new RectangleF(13.5f, 24.5f, 6, 2), 1); color.SetFill(); roundedRectangle14Path.Fill(); color2.SetStroke(); roundedRectangle14Path.LineWidth = 1; roundedRectangle14Path.Stroke(); //// Rounded Rectangle 15 Drawing var roundedRectangle15Path = UIBezierPath.FromRoundedRect(new RectangleF(13.5f, 15.5f, 6, 2), 1); color.SetFill(); roundedRectangle15Path.Fill(); color2.SetStroke(); roundedRectangle15Path.LineWidth = 1; roundedRectangle15Path.Stroke(); //// Rounded Rectangle 16 Drawing var roundedRectangle16Path = UIBezierPath.FromRoundedRect(new RectangleF(24.5f, 15.5f, 5, 2), 1); color.SetFill(); roundedRectangle16Path.Fill(); color2.SetStroke(); roundedRectangle16Path.LineWidth = 1; roundedRectangle16Path.Stroke(); } }
public static UIImage MakeFlosshatt() { bool retina = (UIScreen.MainScreen.Scale > 1.0); if (retina) { UIGraphics.BeginImageContext (new System.Drawing.SizeF (96, 64)); ///BEGIN PAINTCODE RETINA //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor shadowColor2 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 0.454f); UIColor color4 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); //// Shadow Declarations var shadow = shadowColor2.ColorWithAlpha(0.5f).CGColor; var shadowOffset = new SizeF(0.1f, -1.1f); var shadowBlurRadius = 10; //// Group { //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRect(new RectangleF(20.5f, 15.5f, 0, 0)); color4.SetFill(); rectanglePath.Fill(); color4.SetStroke(); rectanglePath.LineWidth = 1; rectanglePath.Stroke(); //// Rectangle 2 Drawing UIBezierPath rectangle2Path = new UIBezierPath(); rectangle2Path.MoveTo(new PointF(20.72f, 49.5f)); rectangle2Path.AddCurveToPoint(new PointF(45.5f, 54.5f), new PointF(20.72f, 49.5f), new PointF(32.97f, 54.5f)); rectangle2Path.AddCurveToPoint(new PointF(70.84f, 49.5f), new PointF(58.03f, 54.5f), new PointF(70.84f, 49.5f)); rectangle2Path.AddLineTo(new PointF(70.5f, 9.5f)); rectangle2Path.AddCurveToPoint(new PointF(59.27f, 15), new PointF(70.5f, 9.5f), new PointF(68.43f, 13.56f)); rectangle2Path.AddCurveToPoint(new PointF(34.21f, 15), new PointF(50.12f, 16.44f), new PointF(41.85f, 15.58f)); rectangle2Path.AddCurveToPoint(new PointF(20.72f, 9.25f), new PointF(26.58f, 14.41f), new PointF(20.72f, 9.25f)); rectangle2Path.AddLineTo(new PointF(20.72f, 49.5f)); rectangle2Path.ClosePath(); color4.SetFill(); rectangle2Path.Fill(); ////// Rectangle 2 Inner Shadow var rectangle2BorderRect = rectangle2Path.Bounds; rectangle2BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle2BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle2BorderRect = RectangleF.Union(rectangle2BorderRect, rectangle2Path.Bounds); rectangle2BorderRect.Inflate(1, 1); var rectangle2NegativePath = UIBezierPath.FromRect(rectangle2BorderRect); rectangle2NegativePath.AppendPath(rectangle2Path); rectangle2NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle2BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectangle2Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle2BorderRect.Width), 0); rectangle2NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle2NegativePath.Fill(); } context.RestoreState(); color4.SetStroke(); rectangle2Path.LineWidth = 1; rectangle2Path.Stroke(); //// Oval Drawing UIBezierPath ovalPath = new UIBezierPath(); ovalPath.MoveTo(new PointF(41.75f, 29.14f)); ovalPath.AddCurveToPoint(new PointF(41.75f, 29.14f), new PointF(41.64f, 28.93f), new PointF(41.75f, 29.14f)); ovalPath.AddCurveToPoint(new PointF(41.75f, 29.14f), new PointF(41.75f, 29.14f), new PointF(41.85f, 29.34f)); ovalPath.ClosePath(); ovalPath.MoveTo(new PointF(71.09f, 40.78f)); ovalPath.AddCurveToPoint(new PointF(85.5f, 53.5f), new PointF(71.09f, 40.78f), new PointF(90.3f, 44.46f)); ovalPath.AddCurveToPoint(new PointF(71.5f, 60.5f), new PointF(83.59f, 57.1f), new PointF(79.87f, 58.44f)); ovalPath.AddCurveToPoint(new PointF(43.5f, 63.5f), new PointF(68.37f, 61.27f), new PointF(55.33f, 63.35f)); ovalPath.AddCurveToPoint(new PointF(19.98f, 60.61f), new PointF(32.61f, 63.64f), new PointF(22.5f, 61.09f)); ovalPath.AddCurveToPoint(new PointF(6.48f, 53.09f), new PointF(14.84f, 59.63f), new PointF(6.96f, 54.65f)); ovalPath.AddCurveToPoint(new PointF(19.98f, 40.78f), new PointF(5.15f, 48.79f), new PointF(10.39f, 43.13f)); ovalPath.AddLineTo(new PointF(19.98f, 49.64f)); ovalPath.AddCurveToPoint(new PointF(45.5f, 53.5f), new PointF(19.98f, 49.64f), new PointF(32.72f, 53.5f)); ovalPath.AddCurveToPoint(new PointF(71.09f, 49.64f), new PointF(58.28f, 53.5f), new PointF(71.09f, 49.64f)); ovalPath.AddLineTo(new PointF(71.09f, 40.78f)); ovalPath.ClosePath(); ovalPath.MiterLimit = 6; color4.SetFill(); ovalPath.Fill(); ////// Oval Inner Shadow var ovalBorderRect = ovalPath.Bounds; ovalBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); ovalBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); ovalBorderRect = RectangleF.Union(ovalBorderRect, ovalPath.Bounds); ovalBorderRect.Inflate(1, 1); var ovalNegativePath = UIBezierPath.FromRect(ovalBorderRect); ovalNegativePath.AppendPath(ovalPath); ovalNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(ovalBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); ovalPath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(ovalBorderRect.Width), 0); ovalNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); ovalNegativePath.Fill(); } context.RestoreState(); color4.SetStroke(); ovalPath.LineWidth = 1; ovalPath.Stroke(); //// Oval 2 Drawing var oval2Path = UIBezierPath.FromOval(new RectangleF(20.5f, 3.5f, 50, 12)); color4.SetFill(); oval2Path.Fill(); ////// Oval 2 Inner Shadow var oval2BorderRect = oval2Path.Bounds; oval2BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval2BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval2BorderRect = RectangleF.Union(oval2BorderRect, oval2Path.Bounds); oval2BorderRect.Inflate(1, 1); var oval2NegativePath = UIBezierPath.FromRect(oval2BorderRect); oval2NegativePath.AppendPath(oval2Path); oval2NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval2BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval2Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval2BorderRect.Width), 0); oval2NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval2NegativePath.Fill(); } context.RestoreState(); color4.SetStroke(); oval2Path.LineWidth = 1; oval2Path.Stroke(); } // END PAINTCODE RETINA } else { UIGraphics.BeginImageContext (new System.Drawing.SizeF (48, 32)); //start paintcode //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor shadowColor2 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 0.454f); UIColor color4 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); //// Shadow Declarations var shadow = shadowColor2.ColorWithAlpha(0.5f).CGColor; var shadowOffset = new SizeF(0.1f, -1.1f); var shadowBlurRadius = 10; //// Group { //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRect(new RectangleF(10.5f, 7.5f, 0, 0)); color4.SetFill(); rectanglePath.Fill(); color4.SetStroke(); rectanglePath.LineWidth = 1; rectanglePath.Stroke(); //// Rectangle 2 Drawing UIBezierPath rectangle2Path = new UIBezierPath(); rectangle2Path.MoveTo(new PointF(9.81f, 24.87f)); rectangle2Path.AddCurveToPoint(new PointF(22.97f, 27.33f), new PointF(9.81f, 24.87f), new PointF(16.32f, 27.33f)); rectangle2Path.AddCurveToPoint(new PointF(36.42f, 24.87f), new PointF(29.62f, 27.33f), new PointF(36.42f, 24.87f)); rectangle2Path.AddLineTo(new PointF(36.24f, 5.2f)); rectangle2Path.AddCurveToPoint(new PointF(30.28f, 7.9f), new PointF(36.24f, 5.2f), new PointF(35.14f, 7.19f)); rectangle2Path.AddCurveToPoint(new PointF(16.98f, 7.9f), new PointF(25.42f, 8.61f), new PointF(21.03f, 8.19f)); rectangle2Path.AddCurveToPoint(new PointF(9.81f, 5.07f), new PointF(12.92f, 7.61f), new PointF(9.81f, 5.07f)); rectangle2Path.AddLineTo(new PointF(9.81f, 24.87f)); rectangle2Path.ClosePath(); color4.SetFill(); rectangle2Path.Fill(); ////// Rectangle 2 Inner Shadow var rectangle2BorderRect = rectangle2Path.Bounds; rectangle2BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle2BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle2BorderRect = RectangleF.Union(rectangle2BorderRect, rectangle2Path.Bounds); rectangle2BorderRect.Inflate(1, 1); var rectangle2NegativePath = UIBezierPath.FromRect(rectangle2BorderRect); rectangle2NegativePath.AppendPath(rectangle2Path); rectangle2NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle2BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectangle2Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle2BorderRect.Width), 0); rectangle2NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle2NegativePath.Fill(); } context.RestoreState(); color4.SetStroke(); rectangle2Path.LineWidth = 1; rectangle2Path.Stroke(); //// Oval Drawing UIBezierPath ovalPath = new UIBezierPath(); ovalPath.MoveTo(new PointF(20.98f, 14.86f)); ovalPath.AddCurveToPoint(new PointF(20.98f, 14.86f), new PointF(20.92f, 14.75f), new PointF(20.98f, 14.86f)); ovalPath.AddCurveToPoint(new PointF(20.98f, 14.86f), new PointF(20.98f, 14.86f), new PointF(21.03f, 14.96f)); ovalPath.ClosePath(); ovalPath.MoveTo(new PointF(36.56f, 20.58f)); ovalPath.AddCurveToPoint(new PointF(44.2f, 26.84f), new PointF(36.56f, 20.58f), new PointF(46.75f, 22.39f)); ovalPath.AddCurveToPoint(new PointF(36.77f, 30.28f), new PointF(43.19f, 28.61f), new PointF(41.21f, 29.27f)); ovalPath.AddCurveToPoint(new PointF(21.91f, 31.75f), new PointF(35.11f, 30.66f), new PointF(28.18f, 31.68f)); ovalPath.AddCurveToPoint(new PointF(9.42f, 30.33f), new PointF(16.13f, 31.82f), new PointF(10.76f, 30.57f)); ovalPath.AddCurveToPoint(new PointF(2.25f, 26.63f), new PointF(6.69f, 29.85f), new PointF(2.51f, 27.4f)); ovalPath.AddCurveToPoint(new PointF(9.42f, 20.58f), new PointF(1.55f, 24.52f), new PointF(4.33f, 21.73f)); ovalPath.AddLineTo(new PointF(9.42f, 24.94f)); ovalPath.AddCurveToPoint(new PointF(22.97f, 26.84f), new PointF(9.42f, 24.94f), new PointF(16.19f, 26.84f)); ovalPath.AddCurveToPoint(new PointF(36.56f, 24.94f), new PointF(29.75f, 26.84f), new PointF(36.56f, 24.94f)); ovalPath.AddLineTo(new PointF(36.56f, 20.58f)); ovalPath.ClosePath(); ovalPath.MiterLimit = 6; color4.SetFill(); ovalPath.Fill(); ////// Oval Inner Shadow var ovalBorderRect = ovalPath.Bounds; ovalBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); ovalBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); ovalBorderRect = RectangleF.Union(ovalBorderRect, ovalPath.Bounds); ovalBorderRect.Inflate(1, 1); var ovalNegativePath = UIBezierPath.FromRect(ovalBorderRect); ovalNegativePath.AppendPath(ovalPath); ovalNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(ovalBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); ovalPath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(ovalBorderRect.Width), 0); ovalNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); ovalNegativePath.Fill(); } context.RestoreState(); color4.SetStroke(); ovalPath.LineWidth = 1; ovalPath.Stroke(); //// Oval 2 Drawing var oval2Path = UIBezierPath.FromOval(new RectangleF(10.5f, 2.5f, 25, 5)); color4.SetFill(); oval2Path.Fill(); ////// Oval 2 Inner Shadow var oval2BorderRect = oval2Path.Bounds; oval2BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval2BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval2BorderRect = RectangleF.Union(oval2BorderRect, oval2Path.Bounds); oval2BorderRect.Inflate(1, 1); var oval2NegativePath = UIBezierPath.FromRect(oval2BorderRect); oval2NegativePath.AppendPath(oval2Path); oval2NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval2BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval2Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval2BorderRect.Width), 0); oval2NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval2NegativePath.Fill(); } context.RestoreState(); color4.SetStroke(); oval2Path.LineWidth = 1; oval2Path.Stroke(); } // END PAINTCODE } var converted = UIGraphics.GetImageFromCurrentImageContext (); UIGraphics.EndImageContext (); return converted; }
void drawBorder() { UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(22.09f, 10.97f)); bezierPath.AddCurveToPoint(new PointF(14.31f, 14.18f), new PointF(19.15f, 10.97f), new PointF(16.39f, 12.11f)); bezierPath.AddCurveToPoint(new PointF(11.09f, 21.94f), new PointF(12.24f, 16.25f), new PointF(11.09f, 19.01f)); bezierPath.AddCurveToPoint(new PointF(14.31f, 29.7f), new PointF(11.09f, 24.88f), new PointF(12.24f, 27.62f)); bezierPath.AddCurveToPoint(new PointF(22.09f, 32.91f), new PointF(16.39f, 31.77f), new PointF(19.16f, 32.91f)); bezierPath.AddCurveToPoint(new PointF(29.87f, 29.7f), new PointF(25.04f, 32.91f), new PointF(27.8f, 31.77f)); bezierPath.AddCurveToPoint(new PointF(33.09f, 21.94f), new PointF(31.95f, 27.63f), new PointF(33.09f, 24.88f)); bezierPath.AddCurveToPoint(new PointF(29.87f, 14.18f), new PointF(33.09f, 19.01f), new PointF(31.95f, 16.26f)); bezierPath.AddCurveToPoint(new PointF(22.09f, 10.97f), new PointF(27.8f, 12.11f), new PointF(25.04f, 10.97f)); bezierPath.ClosePath(); bezierPath.MoveTo(new PointF(22.09f, 31.09f)); bezierPath.AddCurveToPoint(new PointF(12.92f, 21.94f), new PointF(17.02f, 31.09f), new PointF(12.92f, 26.98f)); bezierPath.AddCurveToPoint(new PointF(22.09f, 12.8f), new PointF(12.92f, 16.9f), new PointF(17.02f, 12.8f)); bezierPath.AddCurveToPoint(new PointF(31.26f, 21.94f), new PointF(27.17f, 12.8f), new PointF(31.26f, 16.9f)); bezierPath.AddCurveToPoint(new PointF(22.09f, 31.09f), new PointF(31.26f, 26.98f), new PointF(27.17f, 31.09f)); bezierPath.ClosePath(); bezierPath.MiterLimit = 4; UIColor.LightGray.ColorWithAlpha(.5f).SetFill(); bezierPath.Fill(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(41.31f, 17.37f)); bezier2Path.AddLineTo(new PointF(39.57f, 17.37f)); bezier2Path.AddCurveToPoint(new PointF(36.95f, 14.72f), new PointF(38.14f, 17.37f), new PointF(36.95f, 16.18f)); bezier2Path.AddCurveToPoint(new PointF(37.81f, 12.85f), new PointF(36.95f, 13.99f), new PointF(37.26f, 13.34f)); bezier2Path.AddLineTo(new PointF(38.94f, 11.75f)); bezier2Path.AddCurveToPoint(new PointF(38.94f, 7.76f), new PointF(40.05f, 10.65f), new PointF(40.05f, 8.87f)); bezier2Path.AddLineTo(new PointF(36.38f, 5.23f)); bezier2Path.AddCurveToPoint(new PointF(34.38f, 4.43f), new PointF(35.88f, 4.73f), new PointF(35.13f, 4.43f)); bezier2Path.AddCurveToPoint(new PointF(32.37f, 5.23f), new PointF(33.62f, 4.43f), new PointF(32.89f, 4.73f)); bezier2Path.AddLineTo(new PointF(31.29f, 6.31f)); bezier2Path.AddCurveToPoint(new PointF(29.32f, 7.19f), new PointF(30.78f, 6.88f), new PointF(30.07f, 7.19f)); bezier2Path.AddCurveToPoint(new PointF(26.61f, 4.59f), new PointF(27.86f, 7.19f), new PointF(26.61f, 6)); bezier2Path.AddLineTo(new PointF(26.61f, 2.87f)); bezier2Path.AddCurveToPoint(new PointF(23.86f, 0), new PointF(26.61f, 1.33f), new PointF(25.4f, 0)); bezier2Path.AddLineTo(new PointF(20.37f, 0)); bezier2Path.AddCurveToPoint(new PointF(17.53f, 2.87f), new PointF(18.79f, 0), new PointF(17.53f, 1.31f)); bezier2Path.AddLineTo(new PointF(17.53f, 4.61f)); bezier2Path.AddCurveToPoint(new PointF(14.85f, 7.2f), new PointF(17.53f, 6.01f), new PointF(16.32f, 7.2f)); bezier2Path.AddCurveToPoint(new PointF(12.95f, 6.35f), new PointF(14.12f, 7.2f), new PointF(13.45f, 6.89f)); bezier2Path.AddLineTo(new PointF(11.84f, 5.26f)); bezier2Path.AddCurveToPoint(new PointF(9.83f, 4.46f), new PointF(11.33f, 4.74f), new PointF(10.59f, 4.46f)); bezier2Path.AddCurveToPoint(new PointF(7.83f, 5.26f), new PointF(9.07f, 4.46f), new PointF(8.34f, 4.75f)); bezier2Path.AddLineTo(new PointF(5.27f, 7.77f)); bezier2Path.AddCurveToPoint(new PointF(5.27f, 11.75f), new PointF(4.17f, 8.87f), new PointF(4.17f, 10.66f)); bezier2Path.AddLineTo(new PointF(6.35f, 12.82f)); bezier2Path.AddCurveToPoint(new PointF(7.24f, 14.73f), new PointF(6.92f, 13.34f), new PointF(7.24f, 13.99f)); bezier2Path.AddCurveToPoint(new PointF(4.63f, 17.38f), new PointF(7.24f, 16.19f), new PointF(6.05f, 17.38f)); bezier2Path.AddLineTo(new PointF(2.89f, 17.38f)); bezier2Path.AddCurveToPoint(new PointF(0, 20.21f), new PointF(1.32f, 17.37f), new PointF(0, 18.65f)); bezier2Path.AddLineTo(new PointF(0, 21.94f)); bezier2Path.AddLineTo(new PointF(0, 23.68f)); bezier2Path.AddCurveToPoint(new PointF(2.89f, 26.51f), new PointF(0, 25.22f), new PointF(1.32f, 26.51f)); bezier2Path.AddLineTo(new PointF(4.63f, 26.51f)); bezier2Path.AddCurveToPoint(new PointF(7.24f, 29.17f), new PointF(6.05f, 26.51f), new PointF(7.24f, 27.7f)); bezier2Path.AddCurveToPoint(new PointF(6.35f, 31.09f), new PointF(7.24f, 29.9f), new PointF(6.92f, 30.57f)); bezier2Path.AddLineTo(new PointF(5.27f, 32.14f)); bezier2Path.AddCurveToPoint(new PointF(5.27f, 36.11f), new PointF(4.17f, 33.23f), new PointF(4.17f, 35.02f)); bezier2Path.AddLineTo(new PointF(7.83f, 38.65f)); bezier2Path.AddCurveToPoint(new PointF(9.83f, 39.45f), new PointF(8.33f, 39.17f), new PointF(9.07f, 39.45f)); bezier2Path.AddCurveToPoint(new PointF(11.84f, 38.65f), new PointF(10.59f, 39.45f), new PointF(11.32f, 39.15f)); bezier2Path.AddLineTo(new PointF(12.95f, 37.55f)); bezier2Path.AddCurveToPoint(new PointF(14.84f, 36.71f), new PointF(13.43f, 37.02f), new PointF(14.11f, 36.71f)); bezier2Path.AddCurveToPoint(new PointF(17.52f, 39.3f), new PointF(16.31f, 36.71f), new PointF(17.52f, 37.9f)); bezier2Path.AddLineTo(new PointF(17.52f, 41.04f)); bezier2Path.AddCurveToPoint(new PointF(20.35f, 43.91f), new PointF(17.52f, 42.58f), new PointF(18.78f, 43.91f)); bezier2Path.AddLineTo(new PointF(23.83f, 43.91f)); bezier2Path.AddCurveToPoint(new PointF(26.69f, 41.04f), new PointF(25.39f, 43.91f), new PointF(26.69f, 42.59f)); bezier2Path.AddLineTo(new PointF(26.69f, 39.3f)); bezier2Path.AddCurveToPoint(new PointF(29.36f, 36.71f), new PointF(26.69f, 37.9f), new PointF(27.89f, 36.71f)); bezier2Path.AddCurveToPoint(new PointF(31.29f, 37.59f), new PointF(30.09f, 36.71f), new PointF(30.77f, 37.03f)); bezier2Path.AddLineTo(new PointF(32.37f, 38.66f)); bezier2Path.AddCurveToPoint(new PointF(34.38f, 39.46f), new PointF(32.89f, 39.17f), new PointF(33.62f, 39.46f)); bezier2Path.AddCurveToPoint(new PointF(36.38f, 38.66f), new PointF(35.13f, 39.46f), new PointF(35.86f, 39.17f)); bezier2Path.AddLineTo(new PointF(38.94f, 36.13f)); bezier2Path.AddCurveToPoint(new PointF(38.94f, 32.14f), new PointF(40.04f, 35.03f), new PointF(40.04f, 33.23f)); bezier2Path.AddLineTo(new PointF(37.81f, 31.04f)); bezier2Path.AddCurveToPoint(new PointF(36.95f, 29.13f), new PointF(37.26f, 30.55f), new PointF(36.95f, 29.85f)); bezier2Path.AddCurveToPoint(new PointF(39.57f, 26.43f), new PointF(36.95f, 27.67f), new PointF(38.14f, 26.43f)); bezier2Path.AddLineTo(new PointF(41.31f, 26.43f)); bezier2Path.AddCurveToPoint(new PointF(43.98f, 23.7f), new PointF(42.87f, 26.43f), new PointF(43.98f, 25.26f)); bezier2Path.AddLineTo(new PointF(43.98f, 21.94f)); bezier2Path.AddLineTo(new PointF(43.98f, 20.21f)); bezier2Path.AddCurveToPoint(new PointF(41.31f, 17.37f), new PointF(43.98f, 18.65f), new PointF(42.87f, 17.37f)); bezier2Path.ClosePath(); bezier2Path.MoveTo(new PointF(42.17f, 21.94f)); bezier2Path.AddLineTo(new PointF(42.17f, 23.67f)); bezier2Path.AddCurveToPoint(new PointF(41.33f, 24.57f), new PointF(42.17f, 24.15f), new PointF(41.9f, 24.57f)); bezier2Path.AddLineTo(new PointF(39.59f, 24.57f)); bezier2Path.AddCurveToPoint(new PointF(36.44f, 25.94f), new PointF(38.41f, 24.57f), new PointF(37.29f, 25.07f)); bezier2Path.AddCurveToPoint(new PointF(35.14f, 29.12f), new PointF(35.6f, 26.8f), new PointF(35.14f, 27.93f)); bezier2Path.AddCurveToPoint(new PointF(36.57f, 32.34f), new PointF(35.14f, 30.35f), new PointF(35.65f, 31.5f)); bezier2Path.AddLineTo(new PointF(37.66f, 33.42f)); bezier2Path.AddCurveToPoint(new PointF(37.66f, 34.82f), new PointF(38.04f, 33.81f), new PointF(38.04f, 34.45f)); bezier2Path.AddLineTo(new PointF(35.11f, 37.36f)); bezier2Path.AddCurveToPoint(new PointF(34.39f, 37.63f), new PointF(34.92f, 37.53f), new PointF(34.66f, 37.63f)); bezier2Path.AddCurveToPoint(new PointF(33.66f, 37.36f), new PointF(34.11f, 37.63f), new PointF(33.84f, 37.53f)); bezier2Path.AddLineTo(new PointF(32.62f, 36.32f)); bezier2Path.AddCurveToPoint(new PointF(29.36f, 34.88f), new PointF(31.74f, 35.39f), new PointF(30.58f, 34.88f)); bezier2Path.AddCurveToPoint(new PointF(26.21f, 36.16f), new PointF(28.16f, 34.88f), new PointF(27.06f, 35.34f)); bezier2Path.AddCurveToPoint(new PointF(24.88f, 39.3f), new PointF(25.33f, 37.01f), new PointF(24.88f, 38.11f)); bezier2Path.AddLineTo(new PointF(24.88f, 41.04f)); bezier2Path.AddCurveToPoint(new PointF(23.86f, 42.08f), new PointF(24.88f, 41.6f), new PointF(24.38f, 42.08f)); bezier2Path.AddLineTo(new PointF(20.37f, 42.08f)); bezier2Path.AddCurveToPoint(new PointF(19.38f, 41.04f), new PointF(19.85f, 42.08f), new PointF(19.38f, 41.6f)); bezier2Path.AddLineTo(new PointF(19.38f, 39.3f)); bezier2Path.AddCurveToPoint(new PointF(18.04f, 36.16f), new PointF(19.38f, 38.13f), new PointF(18.91f, 37.01f)); bezier2Path.AddCurveToPoint(new PointF(14.87f, 34.88f), new PointF(17.18f, 35.34f), new PointF(16.05f, 34.88f)); bezier2Path.AddCurveToPoint(new PointF(11.65f, 36.3f), new PointF(13.66f, 34.88f), new PointF(12.49f, 35.39f)); bezier2Path.AddLineTo(new PointF(10.59f, 37.36f)); bezier2Path.AddCurveToPoint(new PointF(9.87f, 37.63f), new PointF(10.4f, 37.53f), new PointF(10.14f, 37.63f)); bezier2Path.AddCurveToPoint(new PointF(9.17f, 37.38f), new PointF(9.59f, 37.63f), new PointF(9.32f, 37.54f)); bezier2Path.AddLineTo(new PointF(9.16f, 37.37f)); bezier2Path.AddLineTo(new PointF(9.14f, 37.36f)); bezier2Path.AddLineTo(new PointF(6.59f, 34.82f)); bezier2Path.AddCurveToPoint(new PointF(6.59f, 33.43f), new PointF(6.21f, 34.45f), new PointF(6.21f, 33.82f)); bezier2Path.AddLineTo(new PointF(7.63f, 32.4f)); bezier2Path.AddCurveToPoint(new PointF(9.09f, 29.14f), new PointF(8.57f, 31.53f), new PointF(9.09f, 30.38f)); bezier2Path.AddCurveToPoint(new PointF(7.79f, 26.01f), new PointF(9.09f, 27.95f), new PointF(8.63f, 26.87f)); bezier2Path.AddCurveToPoint(new PointF(4.64f, 24.7f), new PointF(6.94f, 25.14f), new PointF(5.82f, 24.7f)); bezier2Path.AddLineTo(new PointF(2.89f, 24.7f)); bezier2Path.AddCurveToPoint(new PointF(1.83f, 23.69f), new PointF(2.31f, 24.7f), new PointF(1.83f, 24.21f)); bezier2Path.AddLineTo(new PointF(1.83f, 21.94f)); bezier2Path.AddLineTo(new PointF(1.83f, 20.21f)); bezier2Path.AddCurveToPoint(new PointF(2.89f, 19.2f), new PointF(1.83f, 19.69f), new PointF(2.31f, 19.2f)); bezier2Path.AddLineTo(new PointF(4.63f, 19.2f)); bezier2Path.AddCurveToPoint(new PointF(7.78f, 17.89f), new PointF(5.81f, 19.2f), new PointF(6.93f, 18.75f)); bezier2Path.AddCurveToPoint(new PointF(9.08f, 14.74f), new PointF(8.62f, 17.03f), new PointF(9.08f, 15.92f)); bezier2Path.AddCurveToPoint(new PointF(7.62f, 11.5f), new PointF(9.08f, 13.51f), new PointF(8.56f, 12.35f)); bezier2Path.AddLineTo(new PointF(6.57f, 10.46f)); bezier2Path.AddCurveToPoint(new PointF(6.28f, 9.76f), new PointF(6.31f, 10.21f), new PointF(6.28f, 9.92f)); bezier2Path.AddCurveToPoint(new PointF(6.57f, 9.06f), new PointF(6.28f, 9.61f), new PointF(6.31f, 9.31f)); bezier2Path.AddLineTo(new PointF(9.11f, 6.54f)); bezier2Path.AddCurveToPoint(new PointF(9.83f, 6.26f), new PointF(9.29f, 6.37f), new PointF(9.56f, 6.26f)); bezier2Path.AddCurveToPoint(new PointF(10.53f, 6.51f), new PointF(10.11f, 6.26f), new PointF(10.38f, 6.35f)); bezier2Path.AddLineTo(new PointF(10.54f, 6.53f)); bezier2Path.AddLineTo(new PointF(10.55f, 6.54f)); bezier2Path.AddLineTo(new PointF(11.63f, 7.61f)); bezier2Path.AddCurveToPoint(new PointF(14.85f, 9.03f), new PointF(12.48f, 8.53f), new PointF(13.62f, 9.03f)); bezier2Path.AddCurveToPoint(new PointF(18.01f, 7.75f), new PointF(16.04f, 9.03f), new PointF(17.15f, 8.57f)); bezier2Path.AddCurveToPoint(new PointF(19.36f, 4.61f), new PointF(18.88f, 6.9f), new PointF(19.36f, 5.79f)); bezier2Path.AddLineTo(new PointF(19.36f, 2.87f)); bezier2Path.AddCurveToPoint(new PointF(20.34f, 1.83f), new PointF(19.36f, 2.31f), new PointF(19.82f, 1.83f)); bezier2Path.AddLineTo(new PointF(23.83f, 1.83f)); bezier2Path.AddCurveToPoint(new PointF(24.75f, 2.87f), new PointF(24.35f, 1.83f), new PointF(24.75f, 2.31f)); bezier2Path.AddLineTo(new PointF(24.75f, 4.61f)); bezier2Path.AddCurveToPoint(new PointF(26.12f, 7.75f), new PointF(24.75f, 5.78f), new PointF(25.25f, 6.9f)); bezier2Path.AddCurveToPoint(new PointF(29.31f, 9.03f), new PointF(26.98f, 8.57f), new PointF(28.12f, 9.03f)); bezier2Path.AddCurveToPoint(new PointF(32.59f, 7.59f), new PointF(30.55f, 9.03f), new PointF(31.72f, 8.51f)); bezier2Path.AddLineTo(new PointF(33.63f, 6.55f)); bezier2Path.AddCurveToPoint(new PointF(34.35f, 6.27f), new PointF(33.81f, 6.38f), new PointF(34.08f, 6.27f)); bezier2Path.AddCurveToPoint(new PointF(35.07f, 6.54f), new PointF(34.63f, 6.27f), new PointF(34.9f, 6.38f)); bezier2Path.AddLineTo(new PointF(37.63f, 9.06f)); bezier2Path.AddCurveToPoint(new PointF(37.93f, 9.76f), new PointF(37.81f, 9.25f), new PointF(37.93f, 9.5f)); bezier2Path.AddCurveToPoint(new PointF(37.64f, 10.46f), new PointF(37.93f, 10.02f), new PointF(37.82f, 10.27f)); bezier2Path.AddLineTo(new PointF(36.55f, 11.53f)); bezier2Path.AddCurveToPoint(new PointF(35.12f, 14.75f), new PointF(35.64f, 12.38f), new PointF(35.12f, 13.52f)); bezier2Path.AddCurveToPoint(new PointF(36.41f, 17.89f), new PointF(35.12f, 15.94f), new PointF(35.58f, 17.03f)); bezier2Path.AddCurveToPoint(new PointF(39.57f, 19.2f), new PointF(37.26f, 18.75f), new PointF(38.39f, 19.2f)); bezier2Path.AddLineTo(new PointF(41.31f, 19.2f)); bezier2Path.AddCurveToPoint(new PointF(42.17f, 20.23f), new PointF(41.93f, 19.2f), new PointF(42.16f, 19.77f)); bezier2Path.AddLineTo(new PointF(42.17f, 21.94f)); bezier2Path.ClosePath(); bezier2Path.MiterLimit = 4; UIColor.LightGray.ColorWithAlpha(.5f).SetFill(); bezier2Path.Fill(); }
static void paintCodeNonRetina() { //// Color Declarations UIColor color = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); UIColor color2 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 0.000f); //// Group { //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(7.02f, 6.51f)); bezierPath.AddCurveToPoint(new PointF(7.02f, 14.47f), new PointF(4.82f, 8.71f), new PointF(4.82f, 12.27f)); bezierPath.AddCurveToPoint(new PointF(14.98f, 14.47f), new PointF(9.22f, 16.67f), new PointF(12.78f, 16.67f)); bezierPath.AddCurveToPoint(new PointF(14.98f, 6.51f), new PointF(17.18f, 12.27f), new PointF(17.18f, 8.71f)); bezierPath.AddCurveToPoint(new PointF(7.02f, 6.51f), new PointF(12.78f, 4.31f), new PointF(9.22f, 4.31f)); bezierPath.ClosePath(); bezierPath.MoveTo(new PointF(16.43f, 4.7f)); bezierPath.AddCurveToPoint(new PointF(16.43f, 16.28f), new PointF(19.42f, 7.9f), new PointF(19.42f, 13.08f)); bezierPath.AddCurveToPoint(new PointF(5.57f, 16.28f), new PointF(13.43f, 19.47f), new PointF(8.57f, 19.47f)); bezierPath.AddCurveToPoint(new PointF(5.57f, 4.7f), new PointF(2.58f, 13.08f), new PointF(2.58f, 7.9f)); bezierPath.AddCurveToPoint(new PointF(16.43f, 4.7f), new PointF(8.57f, 1.5f), new PointF(13.43f, 1.5f)); bezierPath.ClosePath(); color.SetFill(); bezierPath.Fill(); UIColor.Black.SetStroke(); bezierPath.LineWidth = 1; bezierPath.Stroke(); //// Rounded Rectangle Drawing var roundedRectanglePath = UIBezierPath.FromRoundedRect(new RectangleF(8.5f, 0.5f, 6, 4), 2); color.SetFill(); roundedRectanglePath.Fill(); color2.SetStroke(); roundedRectanglePath.LineWidth = 1; roundedRectanglePath.Stroke(); //// Rounded Rectangle 2 Drawing var roundedRectangle2Path = UIBezierPath.FromRoundedRect(new RectangleF(16.5f, 8.5f, 5, 4), 2); color.SetFill(); roundedRectangle2Path.Fill(); color2.SetStroke(); roundedRectangle2Path.LineWidth = 1; roundedRectangle2Path.Stroke(); //// Rounded Rectangle 3 Drawing var roundedRectangle3Path = UIBezierPath.FromRoundedRect(new RectangleF(0.5f, 8.5f, 5, 4), 2); color.SetFill(); roundedRectangle3Path.Fill(); color2.SetStroke(); roundedRectangle3Path.LineWidth = 1; roundedRectangle3Path.Stroke(); //// Rounded Rectangle 4 Drawing var roundedRectangle4Path = UIBezierPath.FromRoundedRect(new RectangleF(8.5f, 17.5f, 6, 4), 2); color.SetFill(); roundedRectangle4Path.Fill(); color2.SetStroke(); roundedRectangle4Path.LineWidth = 1; roundedRectangle4Path.Stroke(); //// Rounded Rectangle 5 Drawing var roundedRectangle5Path = UIBezierPath.FromRoundedRect(new RectangleF(15.5f, 14.5f, 5, 4), 2); color.SetFill(); roundedRectangle5Path.Fill(); color2.SetStroke(); roundedRectangle5Path.LineWidth = 1; roundedRectangle5Path.Stroke(); //// Rounded Rectangle 6 Drawing var roundedRectangle6Path = UIBezierPath.FromRoundedRect(new RectangleF(1.5f, 14.5f, 6, 4), 2); color.SetFill(); roundedRectangle6Path.Fill(); color2.SetStroke(); roundedRectangle6Path.LineWidth = 1; roundedRectangle6Path.Stroke(); //// Rounded Rectangle 7 Drawing var roundedRectangle7Path = UIBezierPath.FromRoundedRect(new RectangleF(1.5f, 2.5f, 6, 4), 2); color.SetFill(); roundedRectangle7Path.Fill(); color2.SetStroke(); roundedRectangle7Path.LineWidth = 1; roundedRectangle7Path.Stroke(); //// Rounded Rectangle 8 Drawing var roundedRectangle8Path = UIBezierPath.FromRoundedRect(new RectangleF(15.5f, 2.5f, 5, 4), 2); color.SetFill(); roundedRectangle8Path.Fill(); color2.SetStroke(); roundedRectangle8Path.LineWidth = 1; roundedRectangle8Path.Stroke(); } //// Group 2 { //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(9.19f, 8.66f)); bezier2Path.AddCurveToPoint(new PointF(9.19f, 11.92f), new PointF(8.19f, 9.56f), new PointF(8.19f, 11.02f)); bezier2Path.AddCurveToPoint(new PointF(12.81f, 11.92f), new PointF(10.19f, 12.82f), new PointF(11.81f, 12.82f)); bezier2Path.AddCurveToPoint(new PointF(12.81f, 8.66f), new PointF(13.81f, 11.02f), new PointF(13.81f, 9.56f)); bezier2Path.AddCurveToPoint(new PointF(9.19f, 8.66f), new PointF(11.81f, 7.76f), new PointF(10.19f, 7.76f)); bezier2Path.ClosePath(); bezier2Path.MoveTo(new PointF(13.47f, 7.92f)); bezier2Path.AddCurveToPoint(new PointF(13.47f, 12.66f), new PointF(14.83f, 9.23f), new PointF(14.83f, 11.35f)); bezier2Path.AddCurveToPoint(new PointF(8.53f, 12.66f), new PointF(12.1f, 13.97f), new PointF(9.9f, 13.97f)); bezier2Path.AddCurveToPoint(new PointF(8.53f, 7.92f), new PointF(7.17f, 11.35f), new PointF(7.17f, 9.23f)); bezier2Path.AddCurveToPoint(new PointF(13.47f, 7.92f), new PointF(9.9f, 6.61f), new PointF(12.1f, 6.61f)); bezier2Path.ClosePath(); color.SetFill(); bezier2Path.Fill(); UIColor.Black.SetStroke(); bezier2Path.LineWidth = 1; bezier2Path.Stroke(); //// Rounded Rectangle 9 Drawing var roundedRectangle9Path = UIBezierPath.FromRoundedRect(new RectangleF(11.5f, 6.5f, 0, 2), 0); color.SetFill(); roundedRectangle9Path.Fill(); color2.SetStroke(); roundedRectangle9Path.LineWidth = 1; roundedRectangle9Path.Stroke(); //// Rounded Rectangle 10 Drawing var roundedRectangle10Path = UIBezierPath.FromRoundedRect(new RectangleF(12.5f, 9.5f, 3, 1), 0.5f); color.SetFill(); roundedRectangle10Path.Fill(); color2.SetStroke(); roundedRectangle10Path.LineWidth = 1; roundedRectangle10Path.Stroke(); //// Rounded Rectangle 11 Drawing var roundedRectangle11Path = UIBezierPath.FromRoundedRect(new RectangleF(6.5f, 9.5f, 3, 1), 0.5f); color.SetFill(); roundedRectangle11Path.Fill(); color2.SetStroke(); roundedRectangle11Path.LineWidth = 1; roundedRectangle11Path.Stroke(); //// Rounded Rectangle 12 Drawing var roundedRectangle12Path = UIBezierPath.FromRoundedRect(new RectangleF(11.5f, 12.5f, 0, 2), 0); color.SetFill(); roundedRectangle12Path.Fill(); color2.SetStroke(); roundedRectangle12Path.LineWidth = 1; roundedRectangle12Path.Stroke(); //// Rounded Rectangle 13 Drawing var roundedRectangle13Path = UIBezierPath.FromRoundedRect(new RectangleF(11.5f, 11.5f, 4, 1), 0.5f); color.SetFill(); roundedRectangle13Path.Fill(); color2.SetStroke(); roundedRectangle13Path.LineWidth = 1; roundedRectangle13Path.Stroke(); //// Rounded Rectangle 14 Drawing var roundedRectangle14Path = UIBezierPath.FromRoundedRect(new RectangleF(6.5f, 11.5f, 5, 1), 0.5f); color.SetFill(); roundedRectangle14Path.Fill(); color2.SetStroke(); roundedRectangle14Path.LineWidth = 1; roundedRectangle14Path.Stroke(); //// Rounded Rectangle 15 Drawing var roundedRectangle15Path = UIBezierPath.FromRoundedRect(new RectangleF(6.5f, 7.5f, 5, 1), 0.5f); color.SetFill(); roundedRectangle15Path.Fill(); color2.SetStroke(); roundedRectangle15Path.LineWidth = 1; roundedRectangle15Path.Stroke(); //// Rounded Rectangle 16 Drawing var roundedRectangle16Path = UIBezierPath.FromRoundedRect(new RectangleF(11.5f, 7.5f, 4, 1), 0.5f); color.SetFill(); roundedRectangle16Path.Fill(); color2.SetStroke(); roundedRectangle16Path.LineWidth = 1; roundedRectangle16Path.Stroke(); } }
public override void DrawRect (RectangleF area, UIViewPrintFormatter formatter) { base.DrawRect (area, formatter); //General Declarations CGContext context = UIGraphics.GetCurrentContext (); // Color Declarations UIColor mmFill = new UIColor (0F, 0F, 0F, 0.196F); UIColor shape1DropShadowColor = new UIColor (1F, 1F, 1F, 0.4F); UIColor shape1InnerShadowColor = new UIColor (0F, 0F, 0F, 0.392F); // Shadow Declarations UIColor mmDropShadow = shape1DropShadowColor; SizeF mmDropShadowOffset = new SizeF (0.1F, 1.1F); Single mmDropShadowBlurRadius = 0; UIColor mmInnerShadow = shape1InnerShadowColor; SizeF mmInnerShadowOffset = new SizeF (0.1F, 1.1F); Single mmInnerShadowBlurRadius = 0; // Frames RectangleF frame = this.Bounds; // mmGroup { // mmShape Drawing UIBezierPath mmShapePath = new UIBezierPath (); mmShapePath.MoveTo (new PointF (frame.GetMinX () + 0.51759F * frame.Width, frame.GetMinY () + 0.96761F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.37558F * frame.Width, frame.GetMinY() + 0.91398F * frame.Height), new PointF (frame.GetMinX() + 0.46395F * frame.Width, frame.GetMinY() + 0.96761F * frame.Height), new PointF (frame.GetMinX() + 0.41351F * frame.Width, frame.GetMinY() + 0.94854F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.31759F * frame.Width, frame.GetMinY() + 0.76824F * frame.Height), new PointF (frame.GetMinX() + 0.33346F * frame.Width, frame.GetMinY() + 0.87556F * frame.Height), new PointF (frame.GetMinX() + 0.31234F * frame.Width, frame.GetMinY() + 0.82249F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.31904F * frame.Width, frame.GetMinY() + 0.75325F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.30262F * frame.Width, frame.GetMinY() + 0.75459F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.28470F * frame.Width, frame.GetMinY() + 0.75535F * frame.Height), new PointF (frame.GetMinX() + 0.29666F * frame.Width, frame.GetMinY() + 0.75510F * frame.Height), new PointF (frame.GetMinX() + 0.29065F * frame.Width, frame.GetMinY() + 0.75535F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.14274F * frame.Width, frame.GetMinY() + 0.70173F * frame.Height), new PointF (frame.GetMinX() + 0.23106F * frame.Width, frame.GetMinY() + 0.75535F * frame.Height), new PointF (frame.GetMinX() + 0.18067F * frame.Width, frame.GetMinY() + 0.73625F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.14274F * frame.Width, frame.GetMinY() + 0.44291F * frame.Height), new PointF (frame.GetMinX() + 0.06451F * frame.Width, frame.GetMinY() + 0.63038F * frame.Height), new PointF (frame.GetMinX() + 0.06451F * frame.Width, frame.GetMinY() + 0.51425F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.45528F * frame.Width, frame.GetMinY() + 0.15799F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.48085F * frame.Width, frame.GetMinY() + 0.14832F * frame.Height), new PointF (frame.GetMinX() + 0.46207F * frame.Width, frame.GetMinY() + 0.15176F * frame.Height), new PointF (frame.GetMinX() + 0.47120F * frame.Width, frame.GetMinY() + 0.14832F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.50639F * frame.Width, frame.GetMinY() + 0.15799F * frame.Height), new PointF (frame.GetMinX() + 0.49051F * frame.Width, frame.GetMinY() + 0.14832F * frame.Height), new PointF (frame.GetMinX() + 0.49957F * frame.Width, frame.GetMinY() + 0.15176F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.50639F * frame.Width, frame.GetMinY() + 0.20462F * frame.Height), new PointF (frame.GetMinX() + 0.52050F * frame.Width, frame.GetMinY() + 0.17087F * frame.Height), new PointF (frame.GetMinX() + 0.52050F * frame.Width, frame.GetMinY() + 0.19177F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.19390F * frame.Width, frame.GetMinY() + 0.48951F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.19386F * frame.Width, frame.GetMinY() + 0.65510F * frame.Height), new PointF (frame.GetMinX() + 0.14397F * frame.Width, frame.GetMinY() + 0.53518F * frame.Height), new PointF (frame.GetMinX() + 0.14397F * frame.Width, frame.GetMinY() + 0.60942F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.28476F * frame.Width, frame.GetMinY() + 0.68936F * frame.Height), new PointF (frame.GetMinX() + 0.21821F * frame.Width, frame.GetMinY() + 0.67720F * frame.Height), new PointF (frame.GetMinX() + 0.25047F * frame.Width, frame.GetMinY() + 0.68936F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.37557F * frame.Width, frame.GetMinY() + 0.65514F * frame.Height), new PointF (frame.GetMinX() + 0.31904F * frame.Width, frame.GetMinY() + 0.68936F * frame.Height), new PointF (frame.GetMinX() + 0.35128F * frame.Width, frame.GetMinY() + 0.67720F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.68812F * frame.Width, frame.GetMinY() + 0.37025F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.71365F * frame.Width, frame.GetMinY() + 0.36056F * frame.Height), new PointF (frame.GetMinX() + 0.69491F * frame.Width, frame.GetMinY() + 0.36401F * frame.Height), new PointF (frame.GetMinX() + 0.70403F * frame.Width, frame.GetMinY() + 0.36056F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.73923F * frame.Width, frame.GetMinY() + 0.37025F * frame.Height), new PointF (frame.GetMinX() + 0.72332F * frame.Width, frame.GetMinY() + 0.36056F * frame.Height), new PointF (frame.GetMinX() + 0.73241F * frame.Width, frame.GetMinY() + 0.36401F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.73923F * frame.Width, frame.GetMinY() + 0.41681F * frame.Height), new PointF (frame.GetMinX() + 0.75333F * frame.Width, frame.GetMinY() + 0.38310F * frame.Height), new PointF (frame.GetMinX() + 0.75333F * frame.Width, frame.GetMinY() + 0.40399F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.42673F * frame.Width, frame.GetMinY() + 0.70173F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.42670F * frame.Width, frame.GetMinY() + 0.86737F * frame.Height), new PointF (frame.GetMinX() + 0.37681F * frame.Width, frame.GetMinY() + 0.74744F * frame.Height), new PointF (frame.GetMinX() + 0.37681F * frame.Width, frame.GetMinY() + 0.82172F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.51759F * frame.Width, frame.GetMinY() + 0.90159F * frame.Height), new PointF (frame.GetMinX() + 0.45104F * frame.Width, frame.GetMinY() + 0.88944F * frame.Height), new PointF (frame.GetMinX() + 0.48328F * frame.Width, frame.GetMinY() + 0.90159F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.60840F * frame.Width, frame.GetMinY() + 0.86743F * frame.Height), new PointF (frame.GetMinX() + 0.55183F * frame.Width, frame.GetMinY() + 0.90159F * frame.Height), new PointF (frame.GetMinX() + 0.58413F * frame.Width, frame.GetMinY() + 0.88944F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.92092F * frame.Width, frame.GetMinY() + 0.58246F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.94646F * frame.Width, frame.GetMinY() + 0.57284F * frame.Height), new PointF (frame.GetMinX() + 0.92773F * frame.Width, frame.GetMinY() + 0.57623F * frame.Height), new PointF (frame.GetMinX() + 0.93682F * frame.Width, frame.GetMinY() + 0.57284F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.97208F * frame.Width, frame.GetMinY() + 0.58246F * frame.Height), new PointF (frame.GetMinX() + 0.95617F * frame.Width, frame.GetMinY() + 0.57284F * frame.Height), new PointF (frame.GetMinX() + 0.96523F * frame.Width, frame.GetMinY() + 0.57623F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.97208F * frame.Width, frame.GetMinY() + 0.62912F * frame.Height), new PointF (frame.GetMinX() + 0.98615F * frame.Width, frame.GetMinY() + 0.59535F * frame.Height), new PointF (frame.GetMinX() + 0.98615F * frame.Width, frame.GetMinY() + 0.61626F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.65956F * frame.Width, frame.GetMinY() + 0.91398F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.51759F * frame.Width, frame.GetMinY() + 0.96761F * frame.Height), new PointF (frame.GetMinX() + 0.62160F * frame.Width, frame.GetMinY() + 0.94854F * frame.Height), new PointF (frame.GetMinX() + 0.57117F * frame.Width, frame.GetMinY() + 0.96761F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.51759F * frame.Width, frame.GetMinY() + 0.96761F * frame.Height)); mmShapePath.ClosePath (); mmShapePath.MoveTo (new PointF (frame.GetMinX() + 0.51965F * frame.Width, frame.GetMinY() + 0.81940F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.49408F * frame.Width, frame.GetMinY() + 0.80982F * frame.Height), new PointF (frame.GetMinX() + 0.50999F * frame.Width, frame.GetMinY() + 0.81940F * frame.Height), new PointF (frame.GetMinX() + 0.50091F * frame.Width, frame.GetMinY() + 0.81600F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.49408F * frame.Width, frame.GetMinY() + 0.76313F * frame.Height), new PointF (frame.GetMinX() + 0.48000F * frame.Width, frame.GetMinY() + 0.79686F * frame.Height), new PointF (frame.GetMinX() + 0.48000F * frame.Width, frame.GetMinY() + 0.77600F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.80659F * frame.Width, frame.GetMinY() + 0.47824F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.80662F * frame.Width, frame.GetMinY() + 0.31264F * frame.Height), new PointF (frame.GetMinX() + 0.85650F * frame.Width, frame.GetMinY() + 0.43259F * frame.Height), new PointF (frame.GetMinX() + 0.85650F * frame.Width, frame.GetMinY() + 0.35831F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.71574F * frame.Width, frame.GetMinY() + 0.27840F * frame.Height), new PointF (frame.GetMinX() + 0.78226F * frame.Width, frame.GetMinY() + 0.29053F * frame.Height), new PointF (frame.GetMinX() + 0.75001F * frame.Width, frame.GetMinY() + 0.27840F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.62493F * frame.Width, frame.GetMinY() + 0.31260F * frame.Height), new PointF (frame.GetMinX() + 0.68146F * frame.Width, frame.GetMinY() + 0.27840F * frame.Height), new PointF (frame.GetMinX() + 0.64921F * frame.Width, frame.GetMinY() + 0.29053F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.31239F * frame.Width, frame.GetMinY() + 0.59752F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.28684F * frame.Width, frame.GetMinY() + 0.60718F * frame.Height), new PointF (frame.GetMinX() + 0.30556F * frame.Width, frame.GetMinY() + 0.60378F * frame.Height), new PointF (frame.GetMinX() + 0.29644F * frame.Width, frame.GetMinY() + 0.60718F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.26125F * frame.Width, frame.GetMinY() + 0.59752F * frame.Height), new PointF (frame.GetMinX() + 0.27718F * frame.Width, frame.GetMinY() + 0.60718F * frame.Height), new PointF (frame.GetMinX() + 0.26808F * frame.Width, frame.GetMinY() + 0.60378F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.26125F * frame.Width, frame.GetMinY() + 0.55093F * frame.Height), new PointF (frame.GetMinX() + 0.24715F * frame.Width, frame.GetMinY() + 0.58467F * frame.Height), new PointF (frame.GetMinX() + 0.24715F * frame.Width, frame.GetMinY() + 0.56377F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.57377F * frame.Width, frame.GetMinY() + 0.26601F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.57380F * frame.Width, frame.GetMinY() + 0.10041F * frame.Height), new PointF (frame.GetMinX() + 0.62368F * frame.Width, frame.GetMinY() + 0.22029F * frame.Height), new PointF (frame.GetMinX() + 0.62368F * frame.Width, frame.GetMinY() + 0.14606F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.48291F * frame.Width, frame.GetMinY() + 0.06617F * frame.Height), new PointF (frame.GetMinX() + 0.54946F * frame.Width, frame.GetMinY() + 0.07832F * frame.Height), new PointF (frame.GetMinX() + 0.51721F * frame.Width, frame.GetMinY() + 0.06617F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.39208F * frame.Width, frame.GetMinY() + 0.10040F * frame.Height), new PointF (frame.GetMinX() + 0.44863F * frame.Width, frame.GetMinY() + 0.06617F * frame.Height), new PointF (frame.GetMinX() + 0.41637F * frame.Width, frame.GetMinY() + 0.07832F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.07956F * frame.Width, frame.GetMinY() + 0.38530F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.05400F * frame.Width, frame.GetMinY() + 0.39496F * frame.Height), new PointF (frame.GetMinX() + 0.07274F * frame.Width, frame.GetMinY() + 0.39149F * frame.Height), new PointF (frame.GetMinX() + 0.06365F * frame.Width, frame.GetMinY() + 0.39496F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.02841F * frame.Width, frame.GetMinY() + 0.38530F * frame.Height), new PointF (frame.GetMinX() + 0.04434F * frame.Width, frame.GetMinY() + 0.39496F * frame.Height), new PointF (frame.GetMinX() + 0.03525F * frame.Width, frame.GetMinY() + 0.39149F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.02841F * frame.Width, frame.GetMinY() + 0.33867F * frame.Height), new PointF (frame.GetMinX() + 0.01434F * frame.Width, frame.GetMinY() + 0.37241F * frame.Height), new PointF (frame.GetMinX() + 0.01434F * frame.Width, frame.GetMinY() + 0.35151F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.34095F * frame.Width, frame.GetMinY() + 0.05378F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.48291F * frame.Width, frame.GetMinY() + 0.00013F * frame.Height), new PointF (frame.GetMinX() + 0.37888F * frame.Width, frame.GetMinY() + 0.01919F * frame.Height), new PointF (frame.GetMinX() + 0.42931F * frame.Width, frame.GetMinY() + 0.00013F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.62491F * frame.Width, frame.GetMinY() + 0.05378F * frame.Height), new PointF (frame.GetMinX() + 0.53657F * frame.Width, frame.GetMinY() + 0.00013F * frame.Height), new PointF (frame.GetMinX() + 0.58700F * frame.Width, frame.GetMinY() + 0.01919F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.68292F * frame.Width, frame.GetMinY() + 0.19950F * frame.Height), new PointF (frame.GetMinX() + 0.66705F * frame.Width, frame.GetMinY() + 0.09219F * frame.Height), new PointF (frame.GetMinX() + 0.68815F * frame.Width, frame.GetMinY() + 0.14529F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.68143F * frame.Width, frame.GetMinY() + 0.21454F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.69786F * frame.Width, frame.GetMinY() + 0.21318F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.71580F * frame.Width, frame.GetMinY() + 0.21244F * frame.Height), new PointF (frame.GetMinX() + 0.70379F * frame.Width, frame.GetMinY() + 0.21269F * frame.Height), new PointF (frame.GetMinX() + 0.70984F * frame.Width, frame.GetMinY() + 0.21244F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.85774F * frame.Width, frame.GetMinY() + 0.26604F * frame.Height), new PointF (frame.GetMinX() + 0.76941F * frame.Width, frame.GetMinY() + 0.21244F * frame.Height), new PointF (frame.GetMinX() + 0.81981F * frame.Width, frame.GetMinY() + 0.23147F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.85774F * frame.Width, frame.GetMinY() + 0.52485F * frame.Height), new PointF (frame.GetMinX() + 0.93599F * frame.Width, frame.GetMinY() + 0.33738F * frame.Height), new PointF (frame.GetMinX() + 0.93599F * frame.Width, frame.GetMinY() + 0.45349F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.54521F * frame.Width, frame.GetMinY() + 0.80977F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.51965F * frame.Width, frame.GetMinY() + 0.81940F * frame.Height), new PointF (frame.GetMinX() + 0.53840F * frame.Width, frame.GetMinY() + 0.81600F * frame.Height), new PointF (frame.GetMinX() + 0.52930F * frame.Width, frame.GetMinY() + 0.81940F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.51965F * frame.Width, frame.GetMinY() + 0.81940F * frame.Height)); mmShapePath.ClosePath (); context.SaveState (); context.SetShadowWithColor (mmDropShadowOffset, mmDropShadowBlurRadius, mmDropShadow.CGColor); context.SetBlendMode (CGBlendMode.Overlay); mmFill.SetFill (); mmShapePath.Fill (); RectangleF mmShapeBorderRect = RectangleF.Inflate (mmShapePath.Bounds, mmInnerShadowBlurRadius, mmInnerShadowBlurRadius); mmShapeBorderRect.Offset (mmInnerShadowOffset.Width, mmInnerShadowOffset.Height); mmShapeBorderRect.UnionWith (mmShapePath.Bounds); UIBezierPath mmShapeNegativePath = UIBezierPath.FromRect (mmShapeBorderRect); mmShapeNegativePath.AppendPath (mmShapePath); mmShapeNegativePath.UsesEvenOddFillRule = true; context.SaveState (); { Single xOffset = mmInnerShadowOffset.Width + (float) Math.Round (mmShapeBorderRect.Size.Width); Single yOffset = mmInnerShadowOffset.Height; context.SetShadowWithColor (new SizeF (xOffset + CopySign (0.1F, xOffset), yOffset + CopySign (0.1F, yOffset)), mmInnerShadowBlurRadius, mmInnerShadow.CGColor); mmShapePath.AddClip (); CGAffineTransform transform = CGAffineTransform.MakeTranslation ((float)-Math.Round (mmShapeBorderRect.Size.Width), 0F); mmShapeNegativePath.ApplyTransform (transform); UIColor.Gray.SetFill (); mmShapeNegativePath.Fill (); } context.RestoreState (); context.RestoreState (); } }
void DrawCanvas(CGRect frame) { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations var color = UIColor.FromRGBA(0.851f, 0.851f, 0.851f, 1.000f); var fillColor3 = UIColor.FromRGBA(0.333f, 0.333f, 0.333f, 1.000f); var fillColor4 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); var fillColor5 = UIColor.FromRGBA(0.867f, 0.867f, 0.863f, 1.000f); var fillColor6 = UIColor.FromRGBA(0.671f, 0.671f, 0.671f, 1.000f); var fillColor7 = UIColor.FromRGBA(0.467f, 0.467f, 0.467f, 1.000f); var fillColor8 = UIColor.FromRGBA(0.918f, 0.478f, 0.149f, 1.000f); var fillColor9 = UIColor.FromRGBA(0.529f, 0.529f, 0.529f, 1.000f); var fillColor10 = UIColor.FromRGBA(0.271f, 0.271f, 0.271f, 1.000f); var color2 = UIColor.FromRGBA(0.941f, 0.941f, 0.941f, 1.000f); var color5 = UIColor.FromRGBA(0.275f, 0.275f, 0.275f, 1.000f); //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRoundedRect(new CGRect(frame.GetMinX(), frame.GetMinY() + NMath.Floor((frame.Height) * 0.00000f + 0.5f), frame.Width - 0.5f, frame.Height - NMath.Floor((frame.Height) * 0.00000f + 0.5f)), 4.0f); color2.SetFill(); rectanglePath.Fill(); color.SetStroke(); rectanglePath.LineWidth = 1.0f; rectanglePath.Stroke(); //// Group 2 { context.SaveState(); context.TranslateCTM(frame.GetMinX() + 0.43716f * frame.Width, frame.GetMinY() + 0.12195f * frame.Height); context.ScaleCTM(0.4f, 0.4f); //// Rectangle 2 Drawing var rectangle2Path = UIBezierPath.FromRect(new CGRect(0.0f, 36.0f, 112.0f, 36.0f)); fillColor3.SetFill(); rectangle2Path.Fill(); //// Rectangle 3 Drawing var rectangle3Path = UIBezierPath.FromRect(new CGRect(0.0f, 72.0f, 112.0f, 8.0f)); fillColor4.SetFill(); rectangle3Path.Fill(); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(0.0f, 80.0f)); bezierPath.AddCurveToPoint(new CGPoint(8.0f, 88.0f), new CGPoint(0.0f, 84.42f), new CGPoint(3.58f, 88.0f)); bezierPath.AddLineTo(new CGPoint(104.0f, 88.0f)); bezierPath.AddCurveToPoint(new CGPoint(112.0f, 80.0f), new CGPoint(108.42f, 88.0f), new CGPoint(112.0f, 84.42f)); bezierPath.AddLineTo(new CGPoint(0.0f, 80.0f)); bezierPath.AddLineTo(new CGPoint(0.0f, 80.0f)); bezierPath.ClosePath(); bezierPath.UsesEvenOddFillRule = true; fillColor5.SetFill(); bezierPath.Fill(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new CGPoint(56.3f, 88.0f)); bezier2Path.AddLineTo(new CGPoint(104.0f, 88.0f)); bezier2Path.AddCurveToPoint(new CGPoint(112.0f, 80.0f), new CGPoint(108.42f, 88.0f), new CGPoint(112.0f, 84.42f)); bezier2Path.AddLineTo(new CGPoint(48.3f, 80.0f)); bezier2Path.AddLineTo(new CGPoint(56.3f, 88.0f)); bezier2Path.AddLineTo(new CGPoint(56.3f, 88.0f)); bezier2Path.ClosePath(); bezier2Path.UsesEvenOddFillRule = true; fillColor6.SetFill(); bezier2Path.Fill(); //// Rectangle 4 Drawing var rectangle4Path = UIBezierPath.FromRect(new CGRect(0.0f, 28.0f, 112.0f, 8.0f)); fillColor4.SetFill(); rectangle4Path.Fill(); //// Bezier 3 Drawing UIBezierPath bezier3Path = new UIBezierPath(); bezier3Path.MoveTo(new CGPoint(104.0f, 8.0f)); bezier3Path.AddLineTo(new CGPoint(76.0f, 8.0f)); bezier3Path.AddLineTo(new CGPoint(68.0f, 0.0f)); bezier3Path.AddLineTo(new CGPoint(44.0f, 0.0f)); bezier3Path.AddLineTo(new CGPoint(36.0f, 8.0f)); bezier3Path.AddLineTo(new CGPoint(8.0f, 8.0f)); bezier3Path.AddCurveToPoint(new CGPoint(0.0f, 16.0f), new CGPoint(3.6f, 8.0f), new CGPoint(0.0f, 11.6f)); bezier3Path.AddLineTo(new CGPoint(0.0f, 28.0f)); bezier3Path.AddLineTo(new CGPoint(112.0f, 28.0f)); bezier3Path.AddLineTo(new CGPoint(112.0f, 16.0f)); bezier3Path.AddCurveToPoint(new CGPoint(104.0f, 8.0f), new CGPoint(112.0f, 11.58f), new CGPoint(108.42f, 8.0f)); bezier3Path.AddLineTo(new CGPoint(104.0f, 8.0f)); bezier3Path.ClosePath(); bezier3Path.UsesEvenOddFillRule = true; fillColor5.SetFill(); bezier3Path.Fill(); //// Oval Drawing var ovalPath = UIBezierPath.FromOval(new CGRect(28.0f, 20.0f, 56.0f, 56.0f)); fillColor7.SetFill(); ovalPath.Fill(); //// Oval 2 Drawing var oval2Path = UIBezierPath.FromOval(new CGRect(32.0f, 24.0f, 48.0f, 48.0f)); fillColor4.SetFill(); oval2Path.Fill(); //// Oval 3 Drawing var oval3Path = UIBezierPath.FromOval(new CGRect(8.0f, 16.0f, 8.0f, 8.0f)); fillColor8.SetFill(); oval3Path.Fill(); //// Group 3 { context.SaveState(); context.SetAlpha(0.4f); context.BeginTransparencyLayer(); //// Bezier 4 Drawing UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new CGPoint(104.0f, 24.0f)); bezier4Path.AddLineTo(new CGPoint(96.0f, 24.0f)); bezier4Path.AddLineTo(new CGPoint(104.0f, 16.0f)); bezier4Path.AddLineTo(new CGPoint(104.0f, 24.0f)); bezier4Path.ClosePath(); bezier4Path.UsesEvenOddFillRule = true; fillColor3.SetFill(); bezier4Path.Fill(); context.EndTransparencyLayer(); context.RestoreState(); } //// Bezier 5 Drawing UIBezierPath bezier5Path = new UIBezierPath(); bezier5Path.MoveTo(new CGPoint(96.0f, 24.0f)); bezier5Path.AddLineTo(new CGPoint(96.0f, 16.0f)); bezier5Path.AddLineTo(new CGPoint(104.0f, 16.0f)); bezier5Path.AddLineTo(new CGPoint(96.0f, 24.0f)); bezier5Path.ClosePath(); bezier5Path.UsesEvenOddFillRule = true; fillColor9.SetFill(); bezier5Path.Fill(); //// Oval 4 Drawing var oval4Path = UIBezierPath.FromOval(new CGRect(40.0f, 32.0f, 32.0f, 32.0f)); fillColor3.SetFill(); oval4Path.Fill(); //// Bezier 6 Drawing UIBezierPath bezier6Path = new UIBezierPath(); bezier6Path.MoveTo(new CGPoint(60.0f, 36.0f)); bezier6Path.AddCurveToPoint(new CGPoint(44.0f, 52.0f), new CGPoint(51.16f, 36.0f), new CGPoint(44.0f, 43.16f)); bezier6Path.AddCurveToPoint(new CGPoint(46.88f, 61.12f), new CGPoint(44.0f, 55.4f), new CGPoint(45.07f, 58.53f)); bezier6Path.AddCurveToPoint(new CGPoint(56.0f, 64.0f), new CGPoint(49.47f, 62.93f), new CGPoint(52.6f, 64.0f)); bezier6Path.AddCurveToPoint(new CGPoint(72.0f, 48.0f), new CGPoint(64.84f, 64.0f), new CGPoint(72.0f, 56.84f)); bezier6Path.AddCurveToPoint(new CGPoint(69.12f, 38.88f), new CGPoint(72.0f, 44.6f), new CGPoint(70.93f, 41.47f)); bezier6Path.AddCurveToPoint(new CGPoint(60.0f, 36.0f), new CGPoint(66.53f, 37.07f), new CGPoint(63.4f, 36.0f)); bezier6Path.AddLineTo(new CGPoint(60.0f, 36.0f)); bezier6Path.ClosePath(); bezier6Path.UsesEvenOddFillRule = true; fillColor7.SetFill(); bezier6Path.Fill(); //// Oval 5 Drawing var oval5Path = UIBezierPath.FromOval(new CGRect(48.0f, 40.0f, 12.0f, 12.0f)); fillColor6.SetFill(); oval5Path.Fill(); //// Oval 6 Drawing var oval6Path = UIBezierPath.FromOval(new CGRect(60.0f, 48.0f, 8.0f, 8.0f)); fillColor5.SetFill(); oval6Path.Fill(); //// Group 4 { context.SaveState(); context.SetAlpha(0.4f); context.BeginTransparencyLayer(); //// Bezier 7 Drawing UIBezierPath bezier7Path = new UIBezierPath(); bezier7Path.MoveTo(new CGPoint(41.65f, 72.0f)); bezier7Path.AddCurveToPoint(new CGPoint(35.96f, 67.54f), new CGPoint(39.57f, 70.75f), new CGPoint(37.65f, 69.26f)); bezier7Path.AddLineTo(new CGPoint(35.9f, 67.6f)); bezier7Path.AddLineTo(new CGPoint(40.3f, 72.0f)); bezier7Path.AddLineTo(new CGPoint(41.65f, 72.0f)); bezier7Path.AddLineTo(new CGPoint(41.65f, 72.0f)); bezier7Path.ClosePath(); bezier7Path.UsesEvenOddFillRule = true; fillColor3.SetFill(); bezier7Path.Fill(); context.EndTransparencyLayer(); context.RestoreState(); } //// Bezier 8 Drawing UIBezierPath bezier8Path = new UIBezierPath(); bezier8Path.MoveTo(new CGPoint(81.26f, 36.0f)); bezier8Path.AddCurveToPoint(new CGPoint(84.0f, 48.0f), new CGPoint(83.0f, 39.64f), new CGPoint(84.0f, 43.7f)); bezier8Path.AddCurveToPoint(new CGPoint(70.36f, 72.0f), new CGPoint(84.0f, 58.2f), new CGPoint(78.52f, 67.1f)); bezier8Path.AddLineTo(new CGPoint(112.0f, 72.0f)); bezier8Path.AddLineTo(new CGPoint(112.0f, 64.5f)); bezier8Path.AddLineTo(new CGPoint(83.5f, 36.0f)); bezier8Path.AddLineTo(new CGPoint(81.26f, 36.0f)); bezier8Path.AddLineTo(new CGPoint(81.26f, 36.0f)); bezier8Path.ClosePath(); bezier8Path.UsesEvenOddFillRule = true; fillColor10.SetFill(); bezier8Path.Fill(); context.RestoreState(); } //// Text Drawing CGRect textRect = new CGRect(frame.GetMinX() + 7.0f, frame.GetMinY() + NMath.Floor((frame.Height - 8.0f) * 0.67568f + 0.5f), frame.Width - 14.0f, frame.Height - 8.0f - NMath.Floor((frame.Height - 8.0f) * 0.67568f + 0.5f)); { var textContent = "Picture Search"; color5.SetFill(); var textStyle = new NSMutableParagraphStyle(); textStyle.Alignment = UITextAlignment.Center; var textFontAttributes = new UIStringAttributes() { Font = UIFont.FromName("Avenir-Medium", UIFont.ButtonFontSize), ForegroundColor = color5, ParagraphStyle = textStyle }; var textTextHeight = new NSString(textContent).GetBoundingRect(new CGSize(textRect.Width, nfloat.MaxValue), NSStringDrawingOptions.UsesLineFragmentOrigin, textFontAttributes, null).Height; context.SaveState(); context.ClipToRect(textRect); new NSString(textContent).DrawString(new CGRect(textRect.GetMinX(), textRect.GetMinY() + (textRect.Height - textTextHeight) / 2.0f, textRect.Width, textTextHeight), UIFont.FromName("Avenir-Medium", UIFont.ButtonFontSize), UILineBreakMode.WordWrap, UITextAlignment.Center); context.RestoreState(); } }
public override void Draw (RectangleF rect) { base.Draw (rect); // ------------- START PAINTCODE ---------------- //// General Declarations var colorSpace = CGColorSpace.CreateDeviceRGB (); var context = UIGraphics.GetCurrentContext (); //// Color Declarations UIColor gold = UIColor.FromRGBA (1.00f, 0.95f, 0.57f, 1.00f); UIColor brown = UIColor.FromRGBA (0.79f, 0.75f, 0.18f, 1.00f); UIColor lightBrown = UIColor.FromRGBA (0.69f, 0.57f, 0.23f, 1.00f); UIColor darkishBlue = UIColor.FromRGBA (0.20f, 0.39f, 0.98f, 1.00f); UIColor bottomColorDown = UIColor.FromRGBA (0.21f, 0.21f, 0.21f, 1.00f); //// Gradient Declarations var newGradientColors = new CGColor [] {UIColor.Black.CGColor, UIColor.White.CGColor}; var newGradientLocations = new float [] {0, 1}; var newGradient = new CGGradient (colorSpace, newGradientColors, newGradientLocations); var calendarGradientColors = new CGColor [] { UIColor.DarkGray.CGColor, UIColor.FromRGBA (0.72f, 0.72f, 0.72f, 1.00f).CGColor, UIColor.White.CGColor }; var calendarGradientLocations = new float [] {0, 0.26f, 0.26f}; var calendarGradient = new CGGradient (colorSpace, calendarGradientColors, calendarGradientLocations); //// Shadow Declarations var shadow = UIColor.DarkGray.CGColor; var shadowOffset = new SizeF (2, 2); var shadowBlurRadius = 2; //// Abstracted Graphic Attributes var monthContent = "MAR"; var dayContent = "24"; var dayFont = UIFont.FromName ("Helvetica-Bold", 24); var textContent = "News Headline"; //// Oval 11 Drawing var oval11Path = UIBezierPath.FromOval (new RectangleF (256.5f, 46.5f, 13, 14)); lightBrown.SetFill (); oval11Path.Fill (); UIColor.Black.SetStroke (); oval11Path.LineWidth = 1; oval11Path.Stroke (); //// Oval 12 Drawing var oval12Path = UIBezierPath.FromOval (new RectangleF (280.5f, 46.5f, 13, 14)); lightBrown.SetFill (); oval12Path.Fill (); UIColor.Black.SetStroke (); oval12Path.LineWidth = 1; oval12Path.Stroke (); //// Rounded Rectangle Drawing var roundedRectanglePath = UIBezierPath.FromRoundedRect (new RectangleF (8.5f, 60.5f, 37, 36), 4); context.SaveState (); context.SetShadowWithColor (shadowOffset, shadowBlurRadius, shadow); context.BeginTransparencyLayer (null); roundedRectanglePath.AddClip (); context.DrawLinearGradient (calendarGradient, new PointF (27, 96.5f), new PointF (27, 60.5f), 0); context.EndTransparencyLayer (); context.RestoreState (); UIColor.DarkGray.SetStroke (); roundedRectanglePath.LineWidth = 1; roundedRectanglePath.Stroke (); //// Rounded Rectangle 3 Drawing UIBezierPath roundedRectangle3Path = new UIBezierPath (); roundedRectangle3Path.MoveTo (new PointF (9, 91.2f)); roundedRectangle3Path.AddCurveToPoint (new PointF (12.56f, 95), new PointF (9, 93.3f), new PointF (10.32f, 95)); roundedRectangle3Path.AddLineTo (new PointF (40.94f, 95)); roundedRectangle3Path.AddCurveToPoint (new PointF (45, 91.2f), new PointF (43.18f, 95), new PointF (45, 93.3f)); roundedRectangle3Path.AddLineTo (new PointF (45, 87)); roundedRectangle3Path.AddCurveToPoint (new PointF (43.42f, 85.5f), new PointF (45, 84.9f), new PointF (45.66f, 85.5f)); roundedRectangle3Path.AddLineTo (new PointF (10.94f, 85.5f)); roundedRectangle3Path.AddCurveToPoint (new PointF (9, 87), new PointF (8.7f, 85.5f), new PointF (9, 84.9f)); roundedRectangle3Path.AddLineTo (new PointF (9, 91.2f)); roundedRectangle3Path.ClosePath (); UIColor.Red.SetFill (); roundedRectangle3Path.Fill (); //// Month Drawing var monthRect = new RectangleF (10, 84, 34, 15); UIColor.White.SetFill (); new NSString (monthContent).DrawString ( monthRect, UIFont.FromName("Helvetica-Bold", 9), UILineBreakMode.WordWrap, UITextAlignment.Center ); //// Day Drawing var dayRect = new RectangleF (0, 58, 54, 31); UIColor.Black.SetFill (); new NSString (dayContent).DrawString (dayRect, dayFont, UILineBreakMode.WordWrap, UITextAlignment.Center); //// Text Drawing var textRect = new RectangleF (54, 60, 75, 38); UIColor.Black.SetFill (); new NSString (textContent).DrawString ( textRect, UIFont.FromName("Helvetica", 16), UILineBreakMode.WordWrap, UITextAlignment.Left ); //// Star Drawing UIBezierPath starPath = new UIBezierPath (); starPath.MoveTo (new PointF (31, 14.5f)); starPath.AddLineTo (new PointF (26.24f, 21.45f)); starPath.AddLineTo (new PointF (18.16f, 23.83f)); starPath.AddLineTo (new PointF (23.3f, 30.5f)); starPath.AddLineTo (new PointF (23.06f, 38.92f)); starPath.AddLineTo (new PointF (31, 36.1f)); starPath.AddLineTo (new PointF (38.94f, 38.92f)); starPath.AddLineTo (new PointF (38.7f, 30.5f)); starPath.AddLineTo (new PointF (43.84f, 23.83f)); starPath.AddLineTo (new PointF (35.76f, 21.45f)); starPath.ClosePath (); gold.SetFill (); starPath.Fill (); brown.SetStroke (); starPath.LineWidth = 1; starPath.Stroke (); //// Blue blob Drawing UIBezierPath blueBlobPath = new UIBezierPath (); blueBlobPath.MoveTo (new PointF (256.5f, 16.5f)); blueBlobPath.AddCurveToPoint (new PointF (240.5f, 41.5f), new PointF (235.5f, 37.5f), new PointF (217.53f, 41.55f)); blueBlobPath.AddCurveToPoint (new PointF (265.5f, 30.5f), new PointF (263.47f, 41.45f), new PointF (265.5f, 30.5f)); blueBlobPath.AddCurveToPoint (new PointF (256.5f, 16.5f), new PointF (265.5f, 30.5f), new PointF (277.5f, -4.5f)); blueBlobPath.ClosePath (); blueBlobPath.MiterLimit = 2; blueBlobPath.LineJoinStyle = CGLineJoin.Round; darkishBlue.SetFill (); blueBlobPath.Fill (); bottomColorDown.SetStroke (); blueBlobPath.LineWidth = 1; blueBlobPath.Stroke (); //// Button Drawing var buttonPath = UIBezierPath.FromRoundedRect (new RectangleF (54.5f, 10.5f, 163, 31), 4); context.SaveState (); buttonPath.AddClip (); context.DrawRadialGradient (newGradient, new PointF (100.39f, 55.13f), 7.84f, new PointF (136, 26), 86.67f, CGGradientDrawingOptions.DrawsBeforeStartLocation | CGGradientDrawingOptions.DrawsAfterEndLocation); context.RestoreState (); UIColor.Black.SetStroke (); buttonPath.LineWidth = 1; buttonPath.Stroke (); //// Smiley face Drawing var smileyFacePath = UIBezierPath.FromOval (new RectangleF (159.5f, 49.5f, 47, 47)); gold.SetFill (); smileyFacePath.Fill (); UIColor.Black.SetStroke (); smileyFacePath.LineWidth = 1; smileyFacePath.Stroke (); //// Oval 2 Drawing var oval2Path = UIBezierPath.FromOval (new RectangleF (169.5f, 64.5f, 8, 8)); UIColor.Black.SetFill (); oval2Path.Fill (); UIColor.Black.SetStroke (); oval2Path.LineWidth = 1; oval2Path.Stroke (); //// Oval 3 Drawing var oval3Path = UIBezierPath.FromOval (new RectangleF (188.5f, 64.5f, 8, 8)); UIColor.Black.SetFill (); oval3Path.Fill (); UIColor.Black.SetStroke (); oval3Path.LineWidth = 1; oval3Path.Stroke (); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath (); bezier2Path.MoveTo (new PointF (172.5f, 80.5f)); bezier2Path.AddCurveToPoint (new PointF (185.5f, 85.5f), new PointF (177.75f, 85), new PointF (182.04f, 86.03f)); bezier2Path.AddCurveToPoint (new PointF (194.5f, 79.5f), new PointF (191.27f, 84.62f), new PointF (194.5f, 79.5f)); UIColor.Black.SetStroke (); bezier2Path.LineWidth = 2; bezier2Path.Stroke (); //// Oval 5 Drawing var oval5Path = UIBezierPath.FromOval (new RectangleF (256.5f, 52.5f, 36, 33)); lightBrown.SetFill (); oval5Path.Fill (); UIColor.Black.SetStroke (); oval5Path.LineWidth = 1; oval5Path.Stroke (); //// Oval 6 Drawing var oval6Path = UIBezierPath.FromOval (new RectangleF (262.5f, 59.5f, 10, 19)); UIColor.White.SetFill (); oval6Path.Fill (); UIColor.Black.SetStroke (); oval6Path.LineWidth = 1; oval6Path.Stroke (); //// Oval 7 Drawing var oval7Path = UIBezierPath.FromOval (new RectangleF (275.5f, 59.5f, 10, 19)); UIColor.White.SetFill (); oval7Path.Fill (); UIColor.Black.SetStroke (); oval7Path.LineWidth = 1; oval7Path.Stroke (); //// Oval 9 Drawing var oval9Path = UIBezierPath.FromOval (new RectangleF (264.5f, 68.5f, 6, 5)); UIColor.Black.SetFill (); oval9Path.Fill (); UIColor.Black.SetStroke (); oval9Path.LineWidth = 1; oval9Path.Stroke (); //// Oval 10 Drawing var oval10Path = UIBezierPath.FromOval (new RectangleF (277.5f, 68.5f, 6, 5)); UIColor.Black.SetFill (); oval10Path.Fill (); UIColor.Black.SetStroke (); oval10Path.LineWidth = 1; oval10Path.Stroke (); //// Oval 4 Drawing var oval4Path = UIBezierPath.FromOval (new RectangleF (250.5f, 70.5f, 47, 24)); lightBrown.SetFill (); oval4Path.Fill (); UIColor.Black.SetStroke (); oval4Path.LineWidth = 1; oval4Path.Stroke (); //// Oval 8 Drawing var oval8Path = UIBezierPath.FromOval (new RectangleF (267.5f, 77.5f, 9, 4)); UIColor.Black.SetFill (); oval8Path.Fill (); UIColor.Black.SetStroke (); oval8Path.LineWidth = 1; oval8Path.Stroke (); //// Bezier 5 Drawing UIBezierPath bezier5Path = new UIBezierPath (); bezier5Path.MoveTo (new PointF (270.5f, 81.5f)); bezier5Path.AddCurveToPoint (new PointF (267.5f, 88.5f), new PointF (269.5f, 85.5f), new PointF (267.5f, 88.5f)); UIColor.Black.SetStroke (); bezier5Path.LineWidth = 1; bezier5Path.Stroke (); //// Bezier 6 Drawing UIBezierPath bezier6Path = new UIBezierPath (); bezier6Path.MoveTo (new PointF (272.5f, 81.5f)); bezier6Path.AddLineTo (new PointF (274.5f, 87.5f)); UIColor.Black.SetStroke (); bezier6Path.LineWidth = 1; bezier6Path.Stroke (); // ------------- END PAINTCODE ---------------- }
static void paintCodeNonRetina() { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor color3 = UIColor.FromRGBA(0.000f, 0.200f, 0.067f, 1.000f); UIColor color5 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); UIColor color6 = UIColor.FromRGBA(0.200f, 0.067f, 0.000f, 1.000f); UIColor color7 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 0.000f); UIColor color8 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); //// Shadow Declarations var shadow = color6.CGColor; var shadowOffset = new SizeF(0.1f, 1.1f); var shadowBlurRadius = 11.5f; //// Group { //// Bezier 17 Drawing UIBezierPath bezier17Path = new UIBezierPath(); bezier17Path.MoveTo(new PointF(15.75f, 31.72f)); bezier17Path.AddCurveToPoint(new PointF(17.23f, 31.68f), new PointF(16.28f, 31.71f), new PointF(16.78f, 31.69f)); bezier17Path.AddCurveToPoint(new PointF(27.75f, 31.17f), new PointF(23.41f, 31.51f), new PointF(23.36f, 31.67f)); bezier17Path.AddCurveToPoint(new PointF(39.75f, 29.52f), new PointF(32.47f, 30.64f), new PointF(39.75f, 29.52f)); color6.SetStroke(); bezier17Path.LineWidth = 3; bezier17Path.Stroke(); //// Eyelash { //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(4.25f, 17.73f)); bezierPath.AddCurveToPoint(new PointF(18.72f, 9), new PointF(7.06f, 17.46f), new PointF(12.66f, 11.35f)); bezierPath.AddCurveToPoint(new PointF(34.56f, 9), new PointF(26.18f, 6.1f), new PointF(33.6f, 9.07f)); bezierPath.AddCurveToPoint(new PointF(47.89f, 17.73f), new PointF(36.34f, 8.86f), new PointF(47.89f, 17.73f)); color6.SetStroke(); bezierPath.LineWidth = 3; bezierPath.Stroke(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(0.11f, 9)); bezier2Path.AddCurveToPoint(new PointF(3.35f, 13.42f), new PointF(0.11f, 9), new PointF(2.29f, 12.48f)); bezier2Path.AddCurveToPoint(new PointF(7, 16.64f), new PointF(7, 16.64f), new PointF(7, 16.64f)); color6.SetStroke(); bezier2Path.LineWidth = 3; bezier2Path.Stroke(); //// Bezier 3 Drawing UIBezierPath bezier3Path = new UIBezierPath(); bezier3Path.MoveTo(new PointF(1.95f, 6.27f)); bezier3Path.AddCurveToPoint(new PointF(5.19f, 10.69f), new PointF(1.95f, 6.27f), new PointF(4.13f, 9.75f)); bezier3Path.AddCurveToPoint(new PointF(9.3f, 14.45f), new PointF(8.84f, 13.91f), new PointF(9.3f, 14.45f)); color6.SetStroke(); bezier3Path.LineWidth = 3; bezier3Path.Stroke(); //// Bezier 4 Drawing UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new PointF(5.4f, 5.18f)); bezier4Path.AddCurveToPoint(new PointF(8.64f, 9.6f), new PointF(5.4f, 5.18f), new PointF(7.57f, 8.66f)); bezier4Path.AddCurveToPoint(new PointF(12.29f, 12.82f), new PointF(12.29f, 12.82f), new PointF(12.29f, 12.82f)); color6.SetStroke(); bezier4Path.LineWidth = 3; bezier4Path.Stroke(); //// Bezier 5 Drawing UIBezierPath bezier5Path = new UIBezierPath(); bezier5Path.MoveTo(new PointF(8.84f, 2.45f)); bezier5Path.AddCurveToPoint(new PointF(12.08f, 6.87f), new PointF(8.84f, 2.45f), new PointF(11.02f, 5.93f)); bezier5Path.AddCurveToPoint(new PointF(15.73f, 10.09f), new PointF(15.73f, 10.09f), new PointF(15.73f, 10.09f)); color6.SetStroke(); bezier5Path.LineWidth = 3; bezier5Path.Stroke(); //// Bezier 6 Drawing UIBezierPath bezier6Path = new UIBezierPath(); bezier6Path.MoveTo(new PointF(6.78f, 4.64f)); bezier6Path.AddCurveToPoint(new PointF(13.89f, 11.18f), new PointF(13.62f, 11.18f), new PointF(13.89f, 11.18f)); color6.SetStroke(); bezier6Path.LineWidth = 3; bezier6Path.Stroke(); //// Bezier 7 Drawing UIBezierPath bezier7Path = new UIBezierPath(); bezier7Path.MoveTo(new PointF(17.34f, 9.55f)); bezier7Path.AddCurveToPoint(new PointF(14.58f, 6.82f), new PointF(16.35f, 8.02f), new PointF(15.24f, 7.86f)); bezier7Path.AddCurveToPoint(new PointF(12.06f, 0.82f), new PointF(11.74f, 2.28f), new PointF(12.06f, 0.82f)); color6.SetStroke(); bezier7Path.LineWidth = 3; bezier7Path.Stroke(); //// Bezier 8 Drawing UIBezierPath bezier8Path = new UIBezierPath(); bezier8Path.MoveTo(new PointF(13.89f, 1.36f)); bezier8Path.AddCurveToPoint(new PointF(17.13f, 5.78f), new PointF(13.89f, 1.36f), new PointF(16.07f, 4.84f)); bezier8Path.AddCurveToPoint(new PointF(20.78f, 9), new PointF(20.78f, 9), new PointF(20.78f, 9)); color6.SetStroke(); bezier8Path.LineWidth = 3; bezier8Path.Stroke(); //// Bezier 9 Drawing UIBezierPath bezier9Path = new UIBezierPath(); bezier9Path.MoveTo(new PointF(15.73f, 0.27f)); bezier9Path.AddCurveToPoint(new PointF(18.97f, 4.69f), new PointF(15.73f, 0.27f), new PointF(17.91f, 3.75f)); bezier9Path.AddCurveToPoint(new PointF(22.62f, 7.91f), new PointF(22.62f, 7.91f), new PointF(22.62f, 7.91f)); color6.SetStroke(); bezier9Path.LineWidth = 3; bezier9Path.Stroke(); //// Bezier 10 Drawing UIBezierPath bezier10Path = new UIBezierPath(); bezier10Path.MoveTo(new PointF(19.18f, 0.27f)); bezier10Path.AddCurveToPoint(new PointF(22.42f, 4.69f), new PointF(19.18f, 0.27f), new PointF(21.35f, 3.75f)); bezier10Path.AddCurveToPoint(new PointF(26.07f, 7.91f), new PointF(26.07f, 7.91f), new PointF(26.07f, 7.91f)); color6.SetStroke(); bezier10Path.LineWidth = 3; bezier10Path.Stroke(); //// Bezier 11 Drawing UIBezierPath bezier11Path = new UIBezierPath(); bezier11Path.MoveTo(new PointF(22.62f, 0.27f)); bezier11Path.AddCurveToPoint(new PointF(25.86f, 4.69f), new PointF(22.62f, 0.27f), new PointF(24.8f, 3.75f)); bezier11Path.AddCurveToPoint(new PointF(29.51f, 7.91f), new PointF(29.51f, 7.91f), new PointF(29.51f, 7.91f)); color6.SetStroke(); bezier11Path.LineWidth = 3; bezier11Path.Stroke(); //// Bezier 12 Drawing UIBezierPath bezier12Path = new UIBezierPath(); bezier12Path.MoveTo(new PointF(26.07f, 1.36f)); bezier12Path.AddCurveToPoint(new PointF(29.31f, 5.78f), new PointF(26.07f, 1.36f), new PointF(28.24f, 4.84f)); bezier12Path.AddCurveToPoint(new PointF(32.96f, 9), new PointF(32.96f, 9), new PointF(32.96f, 9)); color6.SetStroke(); bezier12Path.LineWidth = 3; bezier12Path.Stroke(); //// Bezier 13 Drawing UIBezierPath bezier13Path = new UIBezierPath(); bezier13Path.MoveTo(new PointF(29.51f, 1.91f)); bezier13Path.AddCurveToPoint(new PointF(32.75f, 6.33f), new PointF(29.51f, 1.91f), new PointF(31.69f, 5.39f)); bezier13Path.AddCurveToPoint(new PointF(36.4f, 9.55f), new PointF(36.4f, 9.55f), new PointF(36.4f, 9.55f)); color6.SetStroke(); bezier13Path.LineWidth = 3; bezier13Path.Stroke(); //// Bezier 14 Drawing UIBezierPath bezier14Path = new UIBezierPath(); bezier14Path.MoveTo(new PointF(33.25f, 1.91f)); bezier14Path.AddLineTo(new PointF(41.22f, 12.27f)); color6.SetStroke(); bezier14Path.LineWidth = 3; bezier14Path.Stroke(); //// Bezier 15 Drawing UIBezierPath bezier15Path = new UIBezierPath(); bezier15Path.MoveTo(new PointF(41.25f, 4.09f)); bezier15Path.AddCurveToPoint(new PointF(47.89f, 17.18f), new PointF(44.9f, 7.31f), new PointF(47.89f, 17.18f)); color6.SetStroke(); bezier15Path.LineWidth = 3; bezier15Path.Stroke(); //// Bezier 16 Drawing UIBezierPath bezier16Path = new UIBezierPath(); bezier16Path.MoveTo(new PointF(37.78f, 3.55f)); bezier16Path.AddCurveToPoint(new PointF(44.21f, 14.45f), new PointF(41.43f, 6.76f), new PointF(44.21f, 14.45f)); color6.SetStroke(); bezier16Path.LineWidth = 3; bezier16Path.Stroke(); } //// Oval Drawing var ovalPath = UIBezierPath.FromOval(new RectangleF(14.5f, 12.5f, 24, 19)); color3.SetFill(); ovalPath.Fill(); ////// Oval Inner Shadow var ovalBorderRect = ovalPath.Bounds; ovalBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); ovalBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); ovalBorderRect = RectangleF.Union(ovalBorderRect, ovalPath.Bounds); ovalBorderRect.Inflate(1, 1); var ovalNegativePath = UIBezierPath.FromRect(ovalBorderRect); ovalNegativePath.AppendPath(ovalPath); ovalNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(ovalBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); ovalPath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(ovalBorderRect.Width), 0); ovalNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); ovalNegativePath.Fill(); } context.RestoreState(); color7.SetStroke(); ovalPath.LineWidth = 1; ovalPath.Stroke(); //// Oval 3 Drawing var oval3Path = UIBezierPath.FromOval(new RectangleF(22.5f, 17.5f, 9, 8)); color5.SetFill(); oval3Path.Fill(); color5.SetStroke(); oval3Path.LineWidth = 1; oval3Path.Stroke(); //// Oval 2 Drawing var oval2Path = UIBezierPath.FromOval(new RectangleF(30.5f, 15.5f, 6, 4)); color8.SetFill(); oval2Path.Fill(); color7.SetStroke(); oval2Path.LineWidth = 1; oval2Path.Stroke(); //// Oval 4 Drawing var oval4Path = UIBezierPath.FromOval(new RectangleF(15.5f, 19.5f, 5, 6)); color8.SetFill(); oval4Path.Fill(); color7.SetStroke(); oval4Path.LineWidth = 1; oval4Path.Stroke(); //// Oval 5 Drawing var oval5Path = UIBezierPath.FromOval(new RectangleF(21.5f, 25.5f, 5, 4)); color8.SetFill(); oval5Path.Fill(); color7.SetStroke(); oval5Path.LineWidth = 1; oval5Path.Stroke(); //// Bezier 18 Drawing UIBezierPath bezier18Path = new UIBezierPath(); bezier18Path.MoveTo(new PointF(23.75f, 12.97f)); bezier18Path.AddCurveToPoint(new PointF(32.75f, 14.62f), new PointF(28.7f, 11.66f), new PointF(35.17f, 13.14f)); bezier18Path.AddCurveToPoint(new PointF(30.15f, 16.78f), new PointF(31.31f, 15.5f), new PointF(30.54f, 16.21f)); bezier18Path.AddCurveToPoint(new PointF(30.25f, 18.48f), new PointF(29.32f, 17.97f), new PointF(30.25f, 18.48f)); bezier18Path.AddCurveToPoint(new PointF(26.25f, 17.38f), new PointF(30.25f, 18.48f), new PointF(28.1f, 17.38f)); bezier18Path.AddCurveToPoint(new PointF(23.75f, 18.48f), new PointF(24.4f, 17.38f), new PointF(23.75f, 18.48f)); bezier18Path.AddLineTo(new PointF(22.25f, 20.14f)); bezier18Path.AddLineTo(new PointF(16.75f, 18.48f)); bezier18Path.AddCurveToPoint(new PointF(23.75f, 12.97f), new PointF(16.75f, 18.48f), new PointF(19.48f, 14.09f)); bezier18Path.ClosePath(); color3.SetFill(); bezier18Path.Fill(); ////// Bezier 18 Inner Shadow var bezier18BorderRect = bezier18Path.Bounds; bezier18BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier18BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier18BorderRect = RectangleF.Union(bezier18BorderRect, bezier18Path.Bounds); bezier18BorderRect.Inflate(1, 1); var bezier18NegativePath = UIBezierPath.FromRect(bezier18BorderRect); bezier18NegativePath.AppendPath(bezier18Path); bezier18NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier18BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier18Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier18BorderRect.Width), 0); bezier18NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier18NegativePath.Fill(); } context.RestoreState(); color7.SetStroke(); bezier18Path.LineWidth = 1; bezier18Path.Stroke(); } }
static void PaintCodeDrawRetina() { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor color = UIColor.FromRGBA(0.833f, 0.833f, 0.833f, 1.000f); UIColor color3 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); //// Shadow Declarations var shadow = UIColor.Black.ColorWithAlpha(0.66f).CGColor; var shadowOffset = new SizeF(0.1f, -0.1f); var shadowBlurRadius = 17; //// Group 2 { //// Group { //// Oval Drawing var ovalPath = UIBezierPath.FromOval(new RectangleF(16.5f, 3.5f, 60, 57)); color.SetFill(); ovalPath.Fill(); ////// Oval Inner Shadow var ovalBorderRect = ovalPath.Bounds; ovalBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); ovalBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); ovalBorderRect = RectangleF.Union(ovalBorderRect, ovalPath.Bounds); ovalBorderRect.Inflate(1, 1); var ovalNegativePath = UIBezierPath.FromRect(ovalBorderRect); ovalNegativePath.AppendPath(ovalPath); ovalNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(ovalBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); ovalPath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(ovalBorderRect.Width), 0); ovalNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); ovalNegativePath.Fill(); } context.RestoreState(); color3.SetStroke(); ovalPath.LineWidth = 3; ovalPath.Stroke(); //// Oval 2 Drawing var oval2Path = UIBezierPath.FromOval(new RectangleF(26.5f, 37.5f, 5, 6)); UIColor.LightGray.SetFill(); oval2Path.Fill(); ////// Oval 2 Inner Shadow var oval2BorderRect = oval2Path.Bounds; oval2BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval2BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval2BorderRect = RectangleF.Union(oval2BorderRect, oval2Path.Bounds); oval2BorderRect.Inflate(1, 1); var oval2NegativePath = UIBezierPath.FromRect(oval2BorderRect); oval2NegativePath.AppendPath(oval2Path); oval2NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval2BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval2Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval2BorderRect.Width), 0); oval2NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval2NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); oval2Path.LineWidth = 1; oval2Path.Stroke(); //// Oval 4 Drawing var oval4Path = UIBezierPath.FromOval(new RectangleF(65.5f, 28.5f, 2, 3)); UIColor.LightGray.SetFill(); oval4Path.Fill(); ////// Oval 4 Inner Shadow var oval4BorderRect = oval4Path.Bounds; oval4BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval4BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval4BorderRect = RectangleF.Union(oval4BorderRect, oval4Path.Bounds); oval4BorderRect.Inflate(1, 1); var oval4NegativePath = UIBezierPath.FromRect(oval4BorderRect); oval4NegativePath.AppendPath(oval4Path); oval4NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval4BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval4Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval4BorderRect.Width), 0); oval4NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval4NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); oval4Path.LineWidth = 1; oval4Path.Stroke(); //// Oval 5 Drawing var oval5Path = UIBezierPath.FromOval(new RectangleF(25.5f, 30.5f, 2, 2)); UIColor.LightGray.SetFill(); oval5Path.Fill(); ////// Oval 5 Inner Shadow var oval5BorderRect = oval5Path.Bounds; oval5BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval5BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval5BorderRect = RectangleF.Union(oval5BorderRect, oval5Path.Bounds); oval5BorderRect.Inflate(1, 1); var oval5NegativePath = UIBezierPath.FromRect(oval5BorderRect); oval5NegativePath.AppendPath(oval5Path); oval5NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval5BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval5Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval5BorderRect.Width), 0); oval5NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval5NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); oval5Path.LineWidth = 1; oval5Path.Stroke(); //// Oval 6 Drawing var oval6Path = UIBezierPath.FromOval(new RectangleF(63.5f, 20.5f, 3, 3)); UIColor.LightGray.SetFill(); oval6Path.Fill(); ////// Oval 6 Inner Shadow var oval6BorderRect = oval6Path.Bounds; oval6BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval6BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval6BorderRect = RectangleF.Union(oval6BorderRect, oval6Path.Bounds); oval6BorderRect.Inflate(1, 1); var oval6NegativePath = UIBezierPath.FromRect(oval6BorderRect); oval6NegativePath.AppendPath(oval6Path); oval6NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval6BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval6Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval6BorderRect.Width), 0); oval6NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval6NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); oval6Path.LineWidth = 1; oval6Path.Stroke(); //// Oval 7 Drawing var oval7Path = UIBezierPath.FromOval(new RectangleF(26.5f, 20.5f, 3, 3)); UIColor.LightGray.SetFill(); oval7Path.Fill(); ////// Oval 7 Inner Shadow var oval7BorderRect = oval7Path.Bounds; oval7BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval7BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval7BorderRect = RectangleF.Union(oval7BorderRect, oval7Path.Bounds); oval7BorderRect.Inflate(1, 1); var oval7NegativePath = UIBezierPath.FromRect(oval7BorderRect); oval7NegativePath.AppendPath(oval7Path); oval7NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval7BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval7Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval7BorderRect.Width), 0); oval7NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval7NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); oval7Path.LineWidth = 1; oval7Path.Stroke(); //// Oval 8 Drawing var oval8Path = UIBezierPath.FromOval(new RectangleF(59.5f, 15.5f, 2, 2)); UIColor.LightGray.SetFill(); oval8Path.Fill(); ////// Oval 8 Inner Shadow var oval8BorderRect = oval8Path.Bounds; oval8BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval8BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval8BorderRect = RectangleF.Union(oval8BorderRect, oval8Path.Bounds); oval8BorderRect.Inflate(1, 1); var oval8NegativePath = UIBezierPath.FromRect(oval8BorderRect); oval8NegativePath.AppendPath(oval8Path); oval8NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval8BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval8Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval8BorderRect.Width), 0); oval8NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval8NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); oval8Path.LineWidth = 1; oval8Path.Stroke(); //// Oval 9 Drawing var oval9Path = UIBezierPath.FromOval(new RectangleF(31.5f, 15.5f, 2, 2)); UIColor.LightGray.SetFill(); oval9Path.Fill(); ////// Oval 9 Inner Shadow var oval9BorderRect = oval9Path.Bounds; oval9BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval9BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval9BorderRect = RectangleF.Union(oval9BorderRect, oval9Path.Bounds); oval9BorderRect.Inflate(1, 1); var oval9NegativePath = UIBezierPath.FromRect(oval9BorderRect); oval9NegativePath.AppendPath(oval9Path); oval9NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval9BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval9Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval9BorderRect.Width), 0); oval9NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval9NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); oval9Path.LineWidth = 1; oval9Path.Stroke(); //// Oval 10 Drawing var oval10Path = UIBezierPath.FromOval(new RectangleF(50.5f, 12.5f, 4, 3)); UIColor.LightGray.SetFill(); oval10Path.Fill(); ////// Oval 10 Inner Shadow var oval10BorderRect = oval10Path.Bounds; oval10BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval10BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval10BorderRect = RectangleF.Union(oval10BorderRect, oval10Path.Bounds); oval10BorderRect.Inflate(1, 1); var oval10NegativePath = UIBezierPath.FromRect(oval10BorderRect); oval10NegativePath.AppendPath(oval10Path); oval10NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval10BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval10Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval10BorderRect.Width), 0); oval10NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval10NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); oval10Path.LineWidth = 1; oval10Path.Stroke(); //// Oval 11 Drawing var oval11Path = UIBezierPath.FromOval(new RectangleF(41.5f, 12.5f, 3, 3)); UIColor.LightGray.SetFill(); oval11Path.Fill(); ////// Oval 11 Inner Shadow var oval11BorderRect = oval11Path.Bounds; oval11BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval11BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval11BorderRect = RectangleF.Union(oval11BorderRect, oval11Path.Bounds); oval11BorderRect.Inflate(1, 1); var oval11NegativePath = UIBezierPath.FromRect(oval11BorderRect); oval11NegativePath.AppendPath(oval11Path); oval11NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval11BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval11Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval11BorderRect.Width), 0); oval11NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval11NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); oval11Path.LineWidth = 1; oval11Path.Stroke(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(52.58f, 28.38f)); bezier2Path.AddCurveToPoint(new PointF(49.54f, 35.62f), new PointF(54.65f, 31.67f), new PointF(52.52f, 34.42f)); bezier2Path.AddCurveToPoint(new PointF(41.94f, 32.73f), new PointF(41.69f, 38.8f), new PointF(42.25f, 33.53f)); bezier2Path.AddCurveToPoint(new PointF(43.46f, 18.23f), new PointF(41.33f, 31.13f), new PointF(43.46f, 18.23f)); bezier2Path.AddCurveToPoint(new PointF(52.58f, 28.38f), new PointF(43.46f, 18.23f), new PointF(50.51f, 25.08f)); bezier2Path.ClosePath(); color3.SetFill(); bezier2Path.Fill(); UIColor.Black.SetStroke(); bezier2Path.LineWidth = 1; bezier2Path.Stroke(); //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRect(new RectangleF(37.5f, 48.5f, 5, 4)); color.SetFill(); rectanglePath.Fill(); ////// Rectangle Inner Shadow var rectangleBorderRect = rectanglePath.Bounds; rectangleBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangleBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangleBorderRect = RectangleF.Union(rectangleBorderRect, rectanglePath.Bounds); rectangleBorderRect.Inflate(1, 1); var rectangleNegativePath = UIBezierPath.FromRect(rectangleBorderRect); rectangleNegativePath.AppendPath(rectanglePath); rectangleNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangleBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectanglePath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangleBorderRect.Width), 0); rectangleNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangleNegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); rectanglePath.LineWidth = 1; rectanglePath.Stroke(); //// Rectangle 2 Drawing var rectangle2Path = UIBezierPath.FromRect(new RectangleF(45.5f, 48.5f, 3, 4)); color.SetFill(); rectangle2Path.Fill(); ////// Rectangle 2 Inner Shadow var rectangle2BorderRect = rectangle2Path.Bounds; rectangle2BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle2BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle2BorderRect = RectangleF.Union(rectangle2BorderRect, rectangle2Path.Bounds); rectangle2BorderRect.Inflate(1, 1); var rectangle2NegativePath = UIBezierPath.FromRect(rectangle2BorderRect); rectangle2NegativePath.AppendPath(rectangle2Path); rectangle2NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle2BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectangle2Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle2BorderRect.Width), 0); rectangle2NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle2NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); rectangle2Path.LineWidth = 1; rectangle2Path.Stroke(); //// Rectangle 3 Drawing var rectangle3Path = UIBezierPath.FromRect(new RectangleF(51.5f, 48.5f, 6, 4)); color.SetFill(); rectangle3Path.Fill(); ////// Rectangle 3 Inner Shadow var rectangle3BorderRect = rectangle3Path.Bounds; rectangle3BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle3BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle3BorderRect = RectangleF.Union(rectangle3BorderRect, rectangle3Path.Bounds); rectangle3BorderRect.Inflate(1, 1); var rectangle3NegativePath = UIBezierPath.FromRect(rectangle3BorderRect); rectangle3NegativePath.AppendPath(rectangle3Path); rectangle3NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle3BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectangle3Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle3BorderRect.Width), 0); rectangle3NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle3NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); rectangle3Path.LineWidth = 1; rectangle3Path.Stroke(); //// Oval 3 Drawing var oval3Path = UIBezierPath.FromOval(new RectangleF(63.5f, 37.5f, 4, 6)); UIColor.LightGray.SetFill(); oval3Path.Fill(); ////// Oval 3 Inner Shadow var oval3BorderRect = oval3Path.Bounds; oval3BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval3BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval3BorderRect = RectangleF.Union(oval3BorderRect, oval3Path.Bounds); oval3BorderRect.Inflate(1, 1); var oval3NegativePath = UIBezierPath.FromRect(oval3BorderRect); oval3NegativePath.AppendPath(oval3Path); oval3NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval3BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval3Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval3BorderRect.Width), 0); oval3NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval3NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); oval3Path.LineWidth = 1; oval3Path.Stroke(); } } }
static void PaintCodeDrawNonRetina() { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor color = UIColor.FromRGBA(0.833f, 0.833f, 0.833f, 1.000f); UIColor color3 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); //// Shadow Declarations var shadow = UIColor.Black.ColorWithAlpha(0.66f).CGColor; var shadowOffset = new SizeF(0.1f, -0.1f); var shadowBlurRadius = 17; //// Oval Drawing var ovalPath = UIBezierPath.FromOval(new RectangleF(0.5f, 0.5f, 47, 31)); color.SetFill(); ovalPath.Fill(); ////// Oval Inner Shadow var ovalBorderRect = ovalPath.Bounds; ovalBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); ovalBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); ovalBorderRect = RectangleF.Union(ovalBorderRect, ovalPath.Bounds); ovalBorderRect.Inflate(1, 1); var ovalNegativePath = UIBezierPath.FromRect(ovalBorderRect); ovalNegativePath.AppendPath(ovalPath); ovalNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(ovalBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); ovalPath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(ovalBorderRect.Width), 0); ovalNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); ovalNegativePath.Fill(); } context.RestoreState(); color3.SetStroke(); ovalPath.LineWidth = 3; ovalPath.Stroke(); //// Oval 2 Drawing var oval2Path = UIBezierPath.FromOval(new RectangleF(8.5f, 19.5f, 2, 3)); UIColor.LightGray.SetFill(); oval2Path.Fill(); ////// Oval 2 Inner Shadow var oval2BorderRect = oval2Path.Bounds; oval2BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval2BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval2BorderRect = RectangleF.Union(oval2BorderRect, oval2Path.Bounds); oval2BorderRect.Inflate(1, 1); var oval2NegativePath = UIBezierPath.FromRect(oval2BorderRect); oval2NegativePath.AppendPath(oval2Path); oval2NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval2BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval2Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval2BorderRect.Width), 0); oval2NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval2NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); oval2Path.LineWidth = 1; oval2Path.Stroke(); //// Oval 4 Drawing var oval4Path = UIBezierPath.FromOval(new RectangleF(39.5f, 14.5f, 2, 2)); UIColor.LightGray.SetFill(); oval4Path.Fill(); ////// Oval 4 Inner Shadow var oval4BorderRect = oval4Path.Bounds; oval4BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval4BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval4BorderRect = RectangleF.Union(oval4BorderRect, oval4Path.Bounds); oval4BorderRect.Inflate(1, 1); var oval4NegativePath = UIBezierPath.FromRect(oval4BorderRect); oval4NegativePath.AppendPath(oval4Path); oval4NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval4BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval4Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval4BorderRect.Width), 0); oval4NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval4NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); oval4Path.LineWidth = 1; oval4Path.Stroke(); //// Oval 5 Drawing var oval5Path = UIBezierPath.FromOval(new RectangleF(6.5f, 14.5f, 2, 2)); UIColor.LightGray.SetFill(); oval5Path.Fill(); ////// Oval 5 Inner Shadow var oval5BorderRect = oval5Path.Bounds; oval5BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval5BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval5BorderRect = RectangleF.Union(oval5BorderRect, oval5Path.Bounds); oval5BorderRect.Inflate(1, 1); var oval5NegativePath = UIBezierPath.FromRect(oval5BorderRect); oval5NegativePath.AppendPath(oval5Path); oval5NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval5BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval5Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval5BorderRect.Width), 0); oval5NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval5NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); oval5Path.LineWidth = 1; oval5Path.Stroke(); //// Oval 6 Drawing var oval6Path = UIBezierPath.FromOval(new RectangleF(37.5f, 9.5f, 2, 2)); UIColor.LightGray.SetFill(); oval6Path.Fill(); ////// Oval 6 Inner Shadow var oval6BorderRect = oval6Path.Bounds; oval6BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval6BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval6BorderRect = RectangleF.Union(oval6BorderRect, oval6Path.Bounds); oval6BorderRect.Inflate(1, 1); var oval6NegativePath = UIBezierPath.FromRect(oval6BorderRect); oval6NegativePath.AppendPath(oval6Path); oval6NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval6BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval6Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval6BorderRect.Width), 0); oval6NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval6NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); oval6Path.LineWidth = 1; oval6Path.Stroke(); //// Oval 7 Drawing var oval7Path = UIBezierPath.FromOval(new RectangleF(8.5f, 9.5f, 2, 2)); UIColor.LightGray.SetFill(); oval7Path.Fill(); ////// Oval 7 Inner Shadow var oval7BorderRect = oval7Path.Bounds; oval7BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval7BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval7BorderRect = RectangleF.Union(oval7BorderRect, oval7Path.Bounds); oval7BorderRect.Inflate(1, 1); var oval7NegativePath = UIBezierPath.FromRect(oval7BorderRect); oval7NegativePath.AppendPath(oval7Path); oval7NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval7BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval7Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval7BorderRect.Width), 0); oval7NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval7NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); oval7Path.LineWidth = 1; oval7Path.Stroke(); //// Oval 8 Drawing var oval8Path = UIBezierPath.FromOval(new RectangleF(32.5f, 6.5f, 3, 2)); UIColor.LightGray.SetFill(); oval8Path.Fill(); ////// Oval 8 Inner Shadow var oval8BorderRect = oval8Path.Bounds; oval8BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval8BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval8BorderRect = RectangleF.Union(oval8BorderRect, oval8Path.Bounds); oval8BorderRect.Inflate(1, 1); var oval8NegativePath = UIBezierPath.FromRect(oval8BorderRect); oval8NegativePath.AppendPath(oval8Path); oval8NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval8BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval8Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval8BorderRect.Width), 0); oval8NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval8NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); oval8Path.LineWidth = 1; oval8Path.Stroke(); //// Oval 9 Drawing var oval9Path = UIBezierPath.FromOval(new RectangleF(12.5f, 6.5f, 2, 2)); UIColor.LightGray.SetFill(); oval9Path.Fill(); ////// Oval 9 Inner Shadow var oval9BorderRect = oval9Path.Bounds; oval9BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval9BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval9BorderRect = RectangleF.Union(oval9BorderRect, oval9Path.Bounds); oval9BorderRect.Inflate(1, 1); var oval9NegativePath = UIBezierPath.FromRect(oval9BorderRect); oval9NegativePath.AppendPath(oval9Path); oval9NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval9BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval9Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval9BorderRect.Width), 0); oval9NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval9NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); oval9Path.LineWidth = 1; oval9Path.Stroke(); //// Oval 10 Drawing var oval10Path = UIBezierPath.FromOval(new RectangleF(26.5f, 4.5f, 2, 2)); UIColor.LightGray.SetFill(); oval10Path.Fill(); ////// Oval 10 Inner Shadow var oval10BorderRect = oval10Path.Bounds; oval10BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval10BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval10BorderRect = RectangleF.Union(oval10BorderRect, oval10Path.Bounds); oval10BorderRect.Inflate(1, 1); var oval10NegativePath = UIBezierPath.FromRect(oval10BorderRect); oval10NegativePath.AppendPath(oval10Path); oval10NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval10BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval10Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval10BorderRect.Width), 0); oval10NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval10NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); oval10Path.LineWidth = 1; oval10Path.Stroke(); //// Oval 11 Drawing var oval11Path = UIBezierPath.FromOval(new RectangleF(19.5f, 4.5f, 2, 2)); UIColor.LightGray.SetFill(); oval11Path.Fill(); ////// Oval 11 Inner Shadow var oval11BorderRect = oval11Path.Bounds; oval11BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval11BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval11BorderRect = RectangleF.Union(oval11BorderRect, oval11Path.Bounds); oval11BorderRect.Inflate(1, 1); var oval11NegativePath = UIBezierPath.FromRect(oval11BorderRect); oval11NegativePath.AppendPath(oval11Path); oval11NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval11BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval11Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval11BorderRect.Width), 0); oval11NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval11NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); oval11Path.LineWidth = 1; oval11Path.Stroke(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(28.78f, 14)); bezier2Path.AddCurveToPoint(new PointF(26.39f, 18), new PointF(30.41f, 15.82f), new PointF(28.73f, 17.34f)); bezier2Path.AddCurveToPoint(new PointF(20.41f, 16.4f), new PointF(20.21f, 19.75f), new PointF(20.65f, 16.84f)); bezier2Path.AddCurveToPoint(new PointF(21.61f, 8.4f), new PointF(19.93f, 15.52f), new PointF(21.61f, 8.4f)); bezier2Path.AddCurveToPoint(new PointF(28.78f, 14), new PointF(21.61f, 8.4f), new PointF(27.16f, 12.18f)); bezier2Path.ClosePath(); color3.SetFill(); bezier2Path.Fill(); UIColor.Black.SetStroke(); bezier2Path.LineWidth = 1; bezier2Path.Stroke(); //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRect(new RectangleF(16.5f, 24.5f, 5, 3)); color.SetFill(); rectanglePath.Fill(); ////// Rectangle Inner Shadow var rectangleBorderRect = rectanglePath.Bounds; rectangleBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangleBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangleBorderRect = RectangleF.Union(rectangleBorderRect, rectanglePath.Bounds); rectangleBorderRect.Inflate(1, 1); var rectangleNegativePath = UIBezierPath.FromRect(rectangleBorderRect); rectangleNegativePath.AppendPath(rectanglePath); rectangleNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangleBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectanglePath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangleBorderRect.Width), 0); rectangleNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangleNegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); rectanglePath.LineWidth = 1; rectanglePath.Stroke(); //// Rectangle 2 Drawing var rectangle2Path = UIBezierPath.FromRect(new RectangleF(23.5f, 24.5f, 3, 3)); color.SetFill(); rectangle2Path.Fill(); ////// Rectangle 2 Inner Shadow var rectangle2BorderRect = rectangle2Path.Bounds; rectangle2BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle2BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle2BorderRect = RectangleF.Union(rectangle2BorderRect, rectangle2Path.Bounds); rectangle2BorderRect.Inflate(1, 1); var rectangle2NegativePath = UIBezierPath.FromRect(rectangle2BorderRect); rectangle2NegativePath.AppendPath(rectangle2Path); rectangle2NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle2BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectangle2Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle2BorderRect.Width), 0); rectangle2NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle2NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); rectangle2Path.LineWidth = 1; rectangle2Path.Stroke(); //// Rectangle 3 Drawing var rectangle3Path = UIBezierPath.FromRect(new RectangleF(28.5f, 24.5f, 4, 3)); color.SetFill(); rectangle3Path.Fill(); ////// Rectangle 3 Inner Shadow var rectangle3BorderRect = rectangle3Path.Bounds; rectangle3BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle3BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle3BorderRect = RectangleF.Union(rectangle3BorderRect, rectangle3Path.Bounds); rectangle3BorderRect.Inflate(1, 1); var rectangle3NegativePath = UIBezierPath.FromRect(rectangle3BorderRect); rectangle3NegativePath.AppendPath(rectangle3Path); rectangle3NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle3BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectangle3Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle3BorderRect.Width), 0); rectangle3NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle3NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); rectangle3Path.LineWidth = 1; rectangle3Path.Stroke(); //// Oval 3 Drawing var oval3Path = UIBezierPath.FromOval(new RectangleF(37.5f, 19.5f, 2, 3)); UIColor.LightGray.SetFill(); oval3Path.Fill(); ////// Oval 3 Inner Shadow var oval3BorderRect = oval3Path.Bounds; oval3BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval3BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval3BorderRect = RectangleF.Union(oval3BorderRect, oval3Path.Bounds); oval3BorderRect.Inflate(1, 1); var oval3NegativePath = UIBezierPath.FromRect(oval3BorderRect); oval3NegativePath.AppendPath(oval3Path); oval3NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval3BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval3Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval3BorderRect.Width), 0); oval3NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval3NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); oval3Path.LineWidth = 1; oval3Path.Stroke(); }
public override void generatePointsForDrawing(CGRect Bounds) { if (this.startConnectable == null || this.endConnectable == null) { return; } ////////////////// // prepare data // ////////////////// var startPoints = this.startConnectable.attachmentPoints(this.startDir); var endPoints = this.endConnectable.attachmentPoints(this.endDir); var myConvertedStartPoints = new Tuple <CGPoint, CGPoint>( this.ConvertPointFromView(startPoints.Item1, fromView: this.start), this.ConvertPointFromView(startPoints.Item2, fromView: this.start)); var myConvertedEndPoints = new Tuple <CGPoint, CGPoint> ( this.ConvertPointFromView(endPoints.Item1, fromView: this.end), this.ConvertPointFromView(endPoints.Item2, fromView: this.end)); if (this.startDir == this.endDir) { var tempPoint = myConvertedStartPoints.Item1; myConvertedStartPoints = new Tuple <CGPoint, CGPoint>( myConvertedStartPoints.Item2, tempPoint); } var path = CreateMutablePath();// new CGPath(); path.MoveToPoint(myConvertedStartPoints.Item1.X, myConvertedStartPoints.Item1.Y); path.AddLineToPoint(myConvertedEndPoints.Item2.X, myConvertedEndPoints.Item2.Y); path.AddLineToPoint(myConvertedEndPoints.Item1.X, myConvertedEndPoints.Item1.Y); path.AddLineToPoint(myConvertedStartPoints.Item2.X, myConvertedStartPoints.Item2.Y); path.CloseSubpath(); // for now, assuming axis-aligned attachment points; var isVertical = (this.startDir == Direction.Up || this.startDir == Direction.Down) && (this.endDir == Direction.Up || this.endDir == Direction.Down); CGFloat midpoint; if (isVertical) { midpoint = myConvertedStartPoints.Item1.Y + (myConvertedEndPoints.Item2.Y - myConvertedStartPoints.Item1.Y) / 2; } else { midpoint = myConvertedStartPoints.Item1.X + (myConvertedEndPoints.Item2.X - myConvertedStartPoints.Item1.X) / 2; } var bezierPath = new UIBezierPath(); var fillPath = new UIBezierPath(); var currentEdgePath = new UIBezierPath(); List <UIBezierPath> edgePaths = new List <UIBezierPath>(); bezierPath.MoveTo(myConvertedStartPoints.Item1); bezierPath.AddCurveToPoint( myConvertedEndPoints.Item2, controlPoint1: (isVertical ? new CGPoint(myConvertedStartPoints.Item1.X, midpoint) : new CGPoint(midpoint, myConvertedStartPoints.Item1.Y)), controlPoint2: (isVertical ? new CGPoint(myConvertedEndPoints.Item2.X, midpoint) : new CGPoint(midpoint, myConvertedEndPoints.Item2.Y))); //bezierPath.ApplyTransform(CGAffineTransform.MakeTranslation(0, -this.underOffset)); // <<< currentEdgePath = new UIBezierPath(); currentEdgePath.MoveTo(myConvertedStartPoints.Item1); currentEdgePath.AddCurveToPoint( myConvertedEndPoints.Item2, controlPoint1: (isVertical ? new CGPoint(myConvertedStartPoints.Item1.X, midpoint) : new CGPoint(midpoint, myConvertedStartPoints.Item1.Y)), controlPoint2: (isVertical ? new CGPoint(myConvertedEndPoints.Item2.X, midpoint) : new CGPoint(midpoint, myConvertedEndPoints.Item2.Y))); currentEdgePath.ApplyTransform(CGAffineTransform.MakeTranslation(0, -this.underOffset)); edgePaths.Add(currentEdgePath); fillPath.AppendPath(currentEdgePath); bezierPath.AddLineTo(myConvertedEndPoints.Item1); bezierPath.AddCurveToPoint( myConvertedStartPoints.Item2, controlPoint1: (isVertical ? new CGPoint(myConvertedEndPoints.Item1.X, midpoint) : new CGPoint(midpoint, myConvertedEndPoints.Item1.Y)), controlPoint2: (isVertical ? new CGPoint(myConvertedStartPoints.Item2.X, midpoint) : new CGPoint(midpoint, myConvertedStartPoints.Item2.Y))); //bezierPath.ApplyTransform(CGAffineTransform.MakeTranslation(0, -this.underOffset)); // <<< bezierPath.AddLineTo(myConvertedStartPoints.Item1); currentEdgePath = new UIBezierPath(); currentEdgePath.MoveTo(myConvertedEndPoints.Item1); currentEdgePath.AddCurveToPoint( myConvertedStartPoints.Item2, controlPoint1: (isVertical ? new CGPoint(myConvertedEndPoints.Item1.X, midpoint) : new CGPoint(midpoint, myConvertedEndPoints.Item1.Y)), controlPoint2: (isVertical ? new CGPoint(myConvertedStartPoints.Item2.X, midpoint) : new CGPoint(midpoint, myConvertedStartPoints.Item2.Y))); currentEdgePath.ApplyTransform(CGAffineTransform.MakeTranslation(0, -this.underOffset)); edgePaths.Add(currentEdgePath); fillPath.AppendPath(currentEdgePath); bezierPath.AddLineTo(myConvertedStartPoints.Item1); //fillPath.AddLineTo(myConvertedStartPoints.Item1); bezierPath.ClosePath(); nfloat delta = 0; bezierPath.ApplyTransform(CGAffineTransform.MakeTranslation(0, -this.underOffset + delta)); fillPath.ClosePath(); this.fillPath = bezierPath; this.edgePaths = edgePaths.ToArray(); }
public override void Draw(CGRect rect) { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations var fillColor = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); var strokeColor = UIColor.FromRGBA(0.807f, 0.807f, 0.807f, 1.000f); var strokeColor2 = UIColor.FromRGBA(0.851f, 0.851f, 0.851f, 1.000f); //// Frames CGRect frame = new CGRect(0.0f, 0.0f, 772.0f, 356.0f); //// Group 2 { //// Group 3 { context.SaveState(); context.BeginTransparencyLayer(); //// Clip Clip 2 UIBezierPath clip2Path = new UIBezierPath(); clip2Path.MoveTo(new CGPoint(frame.GetMinX() - 41.0f, frame.GetMinY() - 45.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 730.0f, frame.GetMinY() - 45.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 730.0f, frame.GetMinY() + 310.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 41.0f, frame.GetMinY() + 310.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 41.0f, frame.GetMinY() - 45.0f)); clip2Path.ClosePath(); clip2Path.MoveTo(new CGPoint(frame.GetMinX() - 20.0f, frame.GetMinY() - 20.5f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() - 24.0f), new CGPoint(frame.GetMinX() - 20.0f, frame.GetMinY() - 22.44f), new CGPoint(frame.GetMinX() - 18.44f, frame.GetMinY() - 24.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() - 24.0f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 709.0f, frame.GetMinY() - 20.5f), new CGPoint(frame.GetMinX() + 707.44f, frame.GetMinY() - 24.0f), new CGPoint(frame.GetMinX() + 709.0f, frame.GetMinY() - 22.44f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 709.0f, frame.GetMinY() + 285.5f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() + 289.0f), new CGPoint(frame.GetMinX() + 709.0f, frame.GetMinY() + 287.44f), new CGPoint(frame.GetMinX() + 707.44f, frame.GetMinY() + 289.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() + 289.0f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 20.0f, frame.GetMinY() + 285.5f), new CGPoint(frame.GetMinX() - 18.44f, frame.GetMinY() + 289.0f), new CGPoint(frame.GetMinX() - 20.0f, frame.GetMinY() + 287.44f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 20.0f, frame.GetMinY() - 20.5f)); clip2Path.ClosePath(); clip2Path.MoveTo(new CGPoint(frame.GetMinX() - 21.0f, frame.GetMinY() - 20.5f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 21.0f, frame.GetMinY() + 285.5f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() + 290.0f), new CGPoint(frame.GetMinX() - 21.0f, frame.GetMinY() + 287.99f), new CGPoint(frame.GetMinX() - 18.99f, frame.GetMinY() + 290.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() + 290.0f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 710.0f, frame.GetMinY() + 285.5f), new CGPoint(frame.GetMinX() + 707.99f, frame.GetMinY() + 290.0f), new CGPoint(frame.GetMinX() + 710.0f, frame.GetMinY() + 287.99f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 710.0f, frame.GetMinY() - 20.5f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() - 25.0f), new CGPoint(frame.GetMinX() + 710.0f, frame.GetMinY() - 22.99f), new CGPoint(frame.GetMinX() + 707.99f, frame.GetMinY() - 25.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() - 25.0f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 21.0f, frame.GetMinY() - 20.5f), new CGPoint(frame.GetMinX() - 18.99f, frame.GetMinY() - 25.0f), new CGPoint(frame.GetMinX() - 21.0f, frame.GetMinY() - 22.99f)); clip2Path.ClosePath(); clip2Path.UsesEvenOddFillRule = true; clip2Path.AddClip(); //// Group 4 { context.SaveState(); context.BeginTransparencyLayer(); //// Clip Clip UIBezierPath clipPath = new UIBezierPath(); clipPath.MoveTo(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 20.5f)); clipPath.AddCurveToPoint(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() - 24.5f), new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 22.71f), new CGPoint(frame.GetMinX() - 18.72f, frame.GetMinY() - 24.5f)); clipPath.AddLineTo(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() - 24.5f)); clipPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() - 20.5f), new CGPoint(frame.GetMinX() + 707.71f, frame.GetMinY() - 24.5f), new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() - 22.71f)); clipPath.AddLineTo(new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() + 285.5f)); clipPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() + 289.5f), new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() + 287.71f), new CGPoint(frame.GetMinX() + 707.72f, frame.GetMinY() + 289.5f)); clipPath.AddLineTo(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() + 289.5f)); clipPath.AddCurveToPoint(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() + 285.5f), new CGPoint(frame.GetMinX() - 18.71f, frame.GetMinY() + 289.5f), new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() + 287.71f)); clipPath.AddLineTo(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 20.5f)); clipPath.ClosePath(); clipPath.UsesEvenOddFillRule = true; clipPath.AddClip(); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 20.5f)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() - 24.5f), new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 22.71f), new CGPoint(frame.GetMinX() - 18.72f, frame.GetMinY() - 24.5f)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() - 24.5f)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() - 20.5f), new CGPoint(frame.GetMinX() + 707.71f, frame.GetMinY() - 24.5f), new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() - 22.71f)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() + 285.5f)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() + 289.5f), new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() + 287.71f), new CGPoint(frame.GetMinX() + 707.72f, frame.GetMinY() + 289.5f)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() + 289.5f)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() + 285.5f), new CGPoint(frame.GetMinX() - 18.71f, frame.GetMinY() + 289.5f), new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() + 287.71f)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 20.5f)); bezierPath.ClosePath(); fillColor.SetFill(); bezierPath.Fill(); context.EndTransparencyLayer(); context.RestoreState(); } context.EndTransparencyLayer(); context.RestoreState(); } //// Group 5 { context.SaveState(); context.BeginTransparencyLayer(); //// Clip Clip 3 UIBezierPath clip3Path = new UIBezierPath(); clip3Path.MoveTo(new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() - 11.14f)); clip3Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 9.35f, frame.GetMinY() - 15.5f), new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() - 13.55f), new CGPoint(frame.GetMinX() - 11.65f, frame.GetMinY() - 15.5f)); clip3Path.AddLineTo(new CGPoint(frame.GetMinX() + 740.35f, frame.GetMinY() - 15.5f)); clip3Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() - 11.14f), new CGPoint(frame.GetMinX() + 742.64f, frame.GetMinY() - 15.5f), new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() - 13.56f)); clip3Path.AddLineTo(new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() + 322.14f)); clip3Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 740.35f, frame.GetMinY() + 326.5f), new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() + 324.55f), new CGPoint(frame.GetMinX() + 742.65f, frame.GetMinY() + 326.5f)); clip3Path.AddLineTo(new CGPoint(frame.GetMinX() - 9.35f, frame.GetMinY() + 326.5f)); clip3Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() + 322.14f), new CGPoint(frame.GetMinX() - 11.64f, frame.GetMinY() + 326.5f), new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() + 324.56f)); clip3Path.AddLineTo(new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() - 11.14f)); clip3Path.ClosePath(); clip3Path.UsesEvenOddFillRule = true; clip3Path.AddClip(); //// Bezier 4 Drawing UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() - 11.14f)); bezier4Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 9.35f, frame.GetMinY() - 15.5f), new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() - 13.55f), new CGPoint(frame.GetMinX() - 11.65f, frame.GetMinY() - 15.5f)); bezier4Path.AddLineTo(new CGPoint(frame.GetMinX() + 740.35f, frame.GetMinY() - 15.5f)); bezier4Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() - 11.14f), new CGPoint(frame.GetMinX() + 742.64f, frame.GetMinY() - 15.5f), new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() - 13.56f)); bezier4Path.AddLineTo(new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() + 322.14f)); bezier4Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 740.35f, frame.GetMinY() + 326.5f), new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() + 324.55f), new CGPoint(frame.GetMinX() + 742.65f, frame.GetMinY() + 326.5f)); bezier4Path.AddLineTo(new CGPoint(frame.GetMinX() - 9.35f, frame.GetMinY() + 326.5f)); bezier4Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() + 322.14f), new CGPoint(frame.GetMinX() - 11.64f, frame.GetMinY() + 326.5f), new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() + 324.56f)); bezier4Path.AddLineTo(new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() - 11.14f)); bezier4Path.ClosePath(); strokeColor2.SetStroke(); bezier4Path.LineWidth = 2.0f; bezier4Path.Stroke(); context.EndTransparencyLayer(); context.RestoreState(); } //// Bezier 6 Drawing UIBezierPath bezier6Path = new UIBezierPath(); bezier6Path.MoveTo(new CGPoint(frame.GetMinX() + 36.0f, frame.GetMinY() + 155.6f)); bezier6Path.AddLineTo(new CGPoint(frame.GetMinX() + 696.0f, frame.GetMinY() + 155.6f)); bezier6Path.LineCapStyle = CGLineCap.Square; strokeColor.SetStroke(); bezier6Path.LineWidth = 1.0f; bezier6Path.Stroke(); } }
static void paintCodeRetina() { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor color3 = UIColor.FromRGBA(0.000f, 0.200f, 0.067f, 1.000f); UIColor color5 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); UIColor color6 = UIColor.FromRGBA(0.200f, 0.067f, 0.000f, 1.000f); UIColor color7 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 0.000f); UIColor color8 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); //// Shadow Declarations var shadow = color6.CGColor; var shadowOffset = new SizeF(0.1f, 1.1f); var shadowBlurRadius = 11.5f; //// Bezier 17 Drawing UIBezierPath bezier17Path = new UIBezierPath(); bezier17Path.MoveTo(new PointF(31.5f, 57.5f)); bezier17Path.AddCurveToPoint(new PointF(34.47f, 57.42f), new PointF(32.56f, 57.47f), new PointF(33.55f, 57.44f)); bezier17Path.AddCurveToPoint(new PointF(55.5f, 56.5f), new PointF(46.81f, 57.12f), new PointF(46.72f, 57.4f)); bezier17Path.AddCurveToPoint(new PointF(79.5f, 53.5f), new PointF(64.93f, 55.53f), new PointF(79.5f, 53.5f)); color6.SetStroke(); bezier17Path.LineWidth = 3; bezier17Path.Stroke(); //// Eyelash { //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(8.5f, 32.5f)); bezierPath.AddCurveToPoint(new PointF(37.44f, 16.5f), new PointF(14.12f, 32.02f), new PointF(25.32f, 20.81f)); bezierPath.AddCurveToPoint(new PointF(69.13f, 16.5f), new PointF(52.35f, 11.19f), new PointF(67.2f, 16.63f)); bezierPath.AddCurveToPoint(new PointF(95.77f, 32.5f), new PointF(72.68f, 16.25f), new PointF(95.77f, 32.5f)); color6.SetStroke(); bezierPath.LineWidth = 3; bezierPath.Stroke(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(0.23f, 16.5f)); bezier2Path.AddCurveToPoint(new PointF(6.71f, 24.6f), new PointF(0.23f, 16.5f), new PointF(4.58f, 22.88f)); bezier2Path.AddCurveToPoint(new PointF(14.01f, 30.5f), new PointF(14.01f, 30.5f), new PointF(14.01f, 30.5f)); color6.SetStroke(); bezier2Path.LineWidth = 3; bezier2Path.Stroke(); //// Bezier 3 Drawing UIBezierPath bezier3Path = new UIBezierPath(); bezier3Path.MoveTo(new PointF(3.9f, 11.5f)); bezier3Path.AddCurveToPoint(new PointF(10.38f, 19.6f), new PointF(3.9f, 11.5f), new PointF(8.25f, 17.88f)); bezier3Path.AddCurveToPoint(new PointF(18.6f, 26.5f), new PointF(17.68f, 25.5f), new PointF(18.6f, 26.5f)); color6.SetStroke(); bezier3Path.LineWidth = 3; bezier3Path.Stroke(); //// Bezier 4 Drawing UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new PointF(10.79f, 9.5f)); bezier4Path.AddCurveToPoint(new PointF(17.27f, 17.6f), new PointF(10.79f, 9.5f), new PointF(15.14f, 15.88f)); bezier4Path.AddCurveToPoint(new PointF(24.57f, 23.5f), new PointF(24.57f, 23.5f), new PointF(24.57f, 23.5f)); color6.SetStroke(); bezier4Path.LineWidth = 3; bezier4Path.Stroke(); //// Bezier 5 Drawing UIBezierPath bezier5Path = new UIBezierPath(); bezier5Path.MoveTo(new PointF(17.68f, 4.5f)); bezier5Path.AddCurveToPoint(new PointF(24.16f, 12.6f), new PointF(17.68f, 4.5f), new PointF(22.03f, 10.88f)); bezier5Path.AddCurveToPoint(new PointF(31.46f, 18.5f), new PointF(31.46f, 18.5f), new PointF(31.46f, 18.5f)); color6.SetStroke(); bezier5Path.LineWidth = 3; bezier5Path.Stroke(); //// Bezier 6 Drawing UIBezierPath bezier6Path = new UIBezierPath(); bezier6Path.MoveTo(new PointF(13.55f, 8.5f)); bezier6Path.AddCurveToPoint(new PointF(27.79f, 20.5f), new PointF(27.24f, 20.5f), new PointF(27.79f, 20.5f)); color6.SetStroke(); bezier6Path.LineWidth = 3; bezier6Path.Stroke(); //// Bezier 7 Drawing UIBezierPath bezier7Path = new UIBezierPath(); bezier7Path.MoveTo(new PointF(34.68f, 17.5f)); bezier7Path.AddCurveToPoint(new PointF(29.17f, 12.5f), new PointF(32.71f, 14.7f), new PointF(30.47f, 14.41f)); bezier7Path.AddCurveToPoint(new PointF(24.11f, 1.5f), new PointF(23.48f, 4.18f), new PointF(24.11f, 1.5f)); color6.SetStroke(); bezier7Path.LineWidth = 3; bezier7Path.Stroke(); //// Bezier 8 Drawing UIBezierPath bezier8Path = new UIBezierPath(); bezier8Path.MoveTo(new PointF(27.79f, 2.5f)); bezier8Path.AddCurveToPoint(new PointF(34.27f, 10.6f), new PointF(27.79f, 2.5f), new PointF(32.14f, 8.88f)); bezier8Path.AddCurveToPoint(new PointF(41.57f, 16.5f), new PointF(41.57f, 16.5f), new PointF(41.57f, 16.5f)); color6.SetStroke(); bezier8Path.LineWidth = 3; bezier8Path.Stroke(); //// Bezier 9 Drawing UIBezierPath bezier9Path = new UIBezierPath(); bezier9Path.MoveTo(new PointF(31.46f, 0.5f)); bezier9Path.AddCurveToPoint(new PointF(37.94f, 8.6f), new PointF(31.46f, 0.5f), new PointF(35.81f, 6.88f)); bezier9Path.AddCurveToPoint(new PointF(45.24f, 14.5f), new PointF(45.24f, 14.5f), new PointF(45.24f, 14.5f)); color6.SetStroke(); bezier9Path.LineWidth = 3; bezier9Path.Stroke(); //// Bezier 10 Drawing UIBezierPath bezier10Path = new UIBezierPath(); bezier10Path.MoveTo(new PointF(38.35f, 0.5f)); bezier10Path.AddCurveToPoint(new PointF(44.83f, 8.6f), new PointF(38.35f, 0.5f), new PointF(42.7f, 6.88f)); bezier10Path.AddCurveToPoint(new PointF(52.13f, 14.5f), new PointF(52.13f, 14.5f), new PointF(52.13f, 14.5f)); color6.SetStroke(); bezier10Path.LineWidth = 3; bezier10Path.Stroke(); //// Bezier 11 Drawing UIBezierPath bezier11Path = new UIBezierPath(); bezier11Path.MoveTo(new PointF(45.24f, 0.5f)); bezier11Path.AddCurveToPoint(new PointF(51.72f, 8.6f), new PointF(45.24f, 0.5f), new PointF(49.59f, 6.88f)); bezier11Path.AddCurveToPoint(new PointF(59.02f, 14.5f), new PointF(59.02f, 14.5f), new PointF(59.02f, 14.5f)); color6.SetStroke(); bezier11Path.LineWidth = 3; bezier11Path.Stroke(); //// Bezier 12 Drawing UIBezierPath bezier12Path = new UIBezierPath(); bezier12Path.MoveTo(new PointF(52.13f, 2.5f)); bezier12Path.AddCurveToPoint(new PointF(58.61f, 10.6f), new PointF(52.13f, 2.5f), new PointF(56.48f, 8.88f)); bezier12Path.AddCurveToPoint(new PointF(65.91f, 16.5f), new PointF(65.91f, 16.5f), new PointF(65.91f, 16.5f)); color6.SetStroke(); bezier12Path.LineWidth = 3; bezier12Path.Stroke(); //// Bezier 13 Drawing UIBezierPath bezier13Path = new UIBezierPath(); bezier13Path.MoveTo(new PointF(59.02f, 3.5f)); bezier13Path.AddCurveToPoint(new PointF(65.5f, 11.6f), new PointF(59.02f, 3.5f), new PointF(63.37f, 9.88f)); bezier13Path.AddCurveToPoint(new PointF(72.8f, 17.5f), new PointF(72.8f, 17.5f), new PointF(72.8f, 17.5f)); color6.SetStroke(); bezier13Path.LineWidth = 3; bezier13Path.Stroke(); //// Bezier 14 Drawing UIBezierPath bezier14Path = new UIBezierPath(); bezier14Path.MoveTo(new PointF(66.5f, 3.5f)); bezier14Path.AddLineTo(new PointF(82.45f, 22.5f)); color6.SetStroke(); bezier14Path.LineWidth = 3; bezier14Path.Stroke(); //// Bezier 15 Drawing UIBezierPath bezier15Path = new UIBezierPath(); bezier15Path.MoveTo(new PointF(82.5f, 7.5f)); bezier15Path.AddCurveToPoint(new PointF(95.77f, 31.5f), new PointF(89.8f, 13.4f), new PointF(95.77f, 31.5f)); color6.SetStroke(); bezier15Path.LineWidth = 3; bezier15Path.Stroke(); //// Bezier 16 Drawing UIBezierPath bezier16Path = new UIBezierPath(); bezier16Path.MoveTo(new PointF(75.56f, 6.5f)); bezier16Path.AddCurveToPoint(new PointF(88.42f, 26.5f), new PointF(82.86f, 12.4f), new PointF(88.42f, 26.5f)); color6.SetStroke(); bezier16Path.LineWidth = 3; bezier16Path.Stroke(); } //// Oval Drawing var ovalPath = UIBezierPath.FromOval(new RectangleF(29.5f, 22.5f, 48, 34)); color3.SetFill(); ovalPath.Fill(); ////// Oval Inner Shadow var ovalBorderRect = ovalPath.Bounds; ovalBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); ovalBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); ovalBorderRect = RectangleF.Union(ovalBorderRect, ovalPath.Bounds); ovalBorderRect.Inflate(1, 1); var ovalNegativePath = UIBezierPath.FromRect(ovalBorderRect); ovalNegativePath.AppendPath(ovalPath); ovalNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(ovalBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); ovalPath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(ovalBorderRect.Width), 0); ovalNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); ovalNegativePath.Fill(); } context.RestoreState(); color7.SetStroke(); ovalPath.LineWidth = 1; ovalPath.Stroke(); //// Oval 3 Drawing var oval3Path = UIBezierPath.FromOval(new RectangleF(44.5f, 32.5f, 18, 13)); color5.SetFill(); oval3Path.Fill(); color5.SetStroke(); oval3Path.LineWidth = 1; oval3Path.Stroke(); //// Oval 2 Drawing var oval2Path = UIBezierPath.FromOval(new RectangleF(60.5f, 27.5f, 12, 7)); color8.SetFill(); oval2Path.Fill(); color7.SetStroke(); oval2Path.LineWidth = 1; oval2Path.Stroke(); //// Oval 4 Drawing var oval4Path = UIBezierPath.FromOval(new RectangleF(31.5f, 34.5f, 9, 11)); color8.SetFill(); oval4Path.Fill(); color7.SetStroke(); oval4Path.LineWidth = 1; oval4Path.Stroke(); //// Oval 5 Drawing var oval5Path = UIBezierPath.FromOval(new RectangleF(43.5f, 45.5f, 9, 8)); color8.SetFill(); oval5Path.Fill(); color7.SetStroke(); oval5Path.LineWidth = 1; oval5Path.Stroke(); //// Bezier 18 Drawing UIBezierPath bezier18Path = new UIBezierPath(); bezier18Path.MoveTo(new PointF(47.5f, 23.5f)); bezier18Path.AddCurveToPoint(new PointF(65.5f, 26.5f), new PointF(57.41f, 21.14f), new PointF(70.33f, 23.82f)); bezier18Path.AddCurveToPoint(new PointF(60.3f, 30.41f), new PointF(62.62f, 28.1f), new PointF(61.08f, 29.39f)); bezier18Path.AddCurveToPoint(new PointF(60.5f, 33.5f), new PointF(58.65f, 32.57f), new PointF(60.5f, 33.5f)); bezier18Path.AddCurveToPoint(new PointF(52.5f, 31.5f), new PointF(60.5f, 33.5f), new PointF(56.21f, 31.49f)); bezier18Path.AddCurveToPoint(new PointF(47.5f, 33.5f), new PointF(48.79f, 31.51f), new PointF(47.5f, 33.5f)); bezier18Path.AddLineTo(new PointF(44.5f, 36.5f)); bezier18Path.AddLineTo(new PointF(33.5f, 33.5f)); bezier18Path.AddCurveToPoint(new PointF(47.5f, 23.5f), new PointF(33.5f, 33.5f), new PointF(38.95f, 25.54f)); bezier18Path.ClosePath(); color3.SetFill(); bezier18Path.Fill(); ////// Bezier 18 Inner Shadow var bezier18BorderRect = bezier18Path.Bounds; bezier18BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier18BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier18BorderRect = RectangleF.Union(bezier18BorderRect, bezier18Path.Bounds); bezier18BorderRect.Inflate(1, 1); var bezier18NegativePath = UIBezierPath.FromRect(bezier18BorderRect); bezier18NegativePath.AppendPath(bezier18Path); bezier18NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier18BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier18Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier18BorderRect.Width), 0); bezier18NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier18NegativePath.Fill(); } context.RestoreState(); color7.SetStroke(); bezier18Path.LineWidth = 1; bezier18Path.Stroke(); }
static void paintCodeNonRetina() { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor shadowColor2 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 0.448f); UIColor color3 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); //// Shadow Declarations var shadow = shadowColor2.CGColor; var shadowOffset = new SizeF(0.1f, -0.1f); var shadowBlurRadius = 16; //// Group 2 { //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(2.56f, 2.54f)); bezierPath.AddCurveToPoint(new PointF(11.56f, 5.76f), new PointF(11.1f, 5.76f), new PointF(11.56f, 5.76f)); bezierPath.AddLineTo(new PointF(46.74f, 5.62f)); bezierPath.AddLineTo(new PointF(36.72f, 2.54f)); bezierPath.AddLineTo(new PointF(2.56f, 2.54f)); bezierPath.ClosePath(); bezierPath.MiterLimit = 6.5f; UIColor.Orange.SetFill(); bezierPath.Fill(); ////// Bezier Inner Shadow var bezierBorderRect = bezierPath.Bounds; bezierBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezierBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezierBorderRect = RectangleF.Union(bezierBorderRect, bezierPath.Bounds); bezierBorderRect.Inflate(1, 1); var bezierNegativePath = UIBezierPath.FromRect(bezierBorderRect); bezierNegativePath.AppendPath(bezierPath); bezierNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezierBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezierPath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezierBorderRect.Width), 0); bezierNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezierNegativePath.Fill(); } context.RestoreState(); color3.SetStroke(); bezierPath.LineWidth = 1; bezierPath.Stroke(); //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRect(new RectangleF(12.5f, 5.5f, 34, 25)); UIColor.Orange.SetFill(); rectanglePath.Fill(); ////// Rectangle Inner Shadow var rectangleBorderRect = rectanglePath.Bounds; rectangleBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangleBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangleBorderRect = RectangleF.Union(rectangleBorderRect, rectanglePath.Bounds); rectangleBorderRect.Inflate(1, 1); var rectangleNegativePath = UIBezierPath.FromRect(rectangleBorderRect); rectangleNegativePath.AppendPath(rectanglePath); rectangleNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangleBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectanglePath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangleBorderRect.Width), 0); rectangleNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangleNegativePath.Fill(); } context.RestoreState(); color3.SetStroke(); rectanglePath.LineWidth = 1; rectanglePath.Stroke(); //// Rectangle 2 Drawing UIBezierPath rectangle2Path = new UIBezierPath(); rectangle2Path.MoveTo(new PointF(2.15f, 22.52f)); rectangle2Path.AddLineTo(new PointF(11.91f, 30.82f)); rectangle2Path.AddLineTo(new PointF(11.91f, 5.92f)); rectangle2Path.AddLineTo(new PointF(2.15f, 2.18f)); rectangle2Path.AddLineTo(new PointF(2.15f, 22.52f)); rectangle2Path.ClosePath(); UIColor.Orange.SetFill(); rectangle2Path.Fill(); ////// Rectangle 2 Inner Shadow var rectangle2BorderRect = rectangle2Path.Bounds; rectangle2BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle2BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle2BorderRect = RectangleF.Union(rectangle2BorderRect, rectangle2Path.Bounds); rectangle2BorderRect.Inflate(1, 1); var rectangle2NegativePath = UIBezierPath.FromRect(rectangle2BorderRect); rectangle2NegativePath.AppendPath(rectangle2Path); rectangle2NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle2BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectangle2Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle2BorderRect.Width), 0); rectangle2NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle2NegativePath.Fill(); } context.RestoreState(); color3.SetStroke(); rectangle2Path.LineWidth = 1; rectangle2Path.Stroke(); } }
static void paintCodeRetina() { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor color3 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); UIColor color4 = UIColor.FromRGBA(0.429f, 0.000f, 0.000f, 1.000f); UIColor color5 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); UIColor color6 = UIColor.FromRGBA(0.456f, 0.456f, 0.456f, 1.000f); //// Shadow Declarations var shadow = UIColor.Black.CGColor; var shadowOffset = new SizeF(0.1f, -1.1f); var shadowBlurRadius = 8.5f; var shadow2 = color6.CGColor; var shadow2Offset = new SizeF(0.1f, -0.1f); var shadow2BlurRadius = 3.5f; //// Abstracted Attributes //var textContent = "Hello, World!"; //// Group { //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(32.5f, 20.5f)); bezier2Path.AddLineTo(new PointF(32.5f, 62.5f)); bezier2Path.AddLineTo(new PointF(49.5f, 62.5f)); bezier2Path.AddLineTo(new PointF(47.5f, 23.5f)); bezier2Path.AddLineTo(new PointF(32.5f, 20.5f)); bezier2Path.ClosePath(); color4.SetFill(); bezier2Path.Fill(); ////// Bezier 2 Inner Shadow var bezier2BorderRect = bezier2Path.Bounds; bezier2BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier2BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier2BorderRect = RectangleF.Union(bezier2BorderRect, bezier2Path.Bounds); bezier2BorderRect.Inflate(1, 1); var bezier2NegativePath = UIBezierPath.FromRect(bezier2BorderRect); bezier2NegativePath.AppendPath(bezier2Path); bezier2NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier2BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier2Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier2BorderRect.Width), 0); bezier2NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier2NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezier2Path.LineWidth = 1; bezier2Path.Stroke(); //// Bezier 18 Drawing UIBezierPath bezier18Path = new UIBezierPath(); bezier18Path.MoveTo(new PointF(47.5f, 62.48f)); bezier18Path.AddLineTo(new PointF(47.5f, 25.58f)); bezier18Path.AddLineTo(new PointF(96.5f, 22.5f)); bezier18Path.AddLineTo(new PointF(96.5f, 63.5f)); bezier18Path.AddLineTo(new PointF(47.5f, 62.48f)); bezier18Path.ClosePath(); color4.SetFill(); bezier18Path.Fill(); ////// Bezier 18 Inner Shadow var bezier18BorderRect = bezier18Path.Bounds; bezier18BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier18BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier18BorderRect = RectangleF.Union(bezier18BorderRect, bezier18Path.Bounds); bezier18BorderRect.Inflate(1, 1); var bezier18NegativePath = UIBezierPath.FromRect(bezier18BorderRect); bezier18NegativePath.AppendPath(bezier18Path); bezier18NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier18BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier18Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier18BorderRect.Width), 0); bezier18NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier18NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezier18Path.LineWidth = 1; bezier18Path.Stroke(); //// Bezier 6 Drawing UIBezierPath bezier6Path = new UIBezierPath(); bezier6Path.MoveTo(new PointF(85.5f, 5.5f)); bezier6Path.AddLineTo(new PointF(95.5f, 10.79f)); bezier6Path.AddLineTo(new PointF(95.5f, 20.5f)); bezier6Path.AddLineTo(new PointF(85.5f, 5.5f)); bezier6Path.ClosePath(); color4.SetFill(); bezier6Path.Fill(); ////// Bezier 6 Inner Shadow var bezier6BorderRect = bezier6Path.Bounds; bezier6BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier6BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier6BorderRect = RectangleF.Union(bezier6BorderRect, bezier6Path.Bounds); bezier6BorderRect.Inflate(1, 1); var bezier6NegativePath = UIBezierPath.FromRect(bezier6BorderRect); bezier6NegativePath.AppendPath(bezier6Path); bezier6NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier6BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier6Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier6BorderRect.Width), 0); bezier6NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier6NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezier6Path.LineWidth = 1; bezier6Path.Stroke(); //// Bezier 5 Drawing UIBezierPath bezier5Path = new UIBezierPath(); bezier5Path.MoveTo(new PointF(45.5f, 25.5f)); bezier5Path.AddLineTo(new PointF(96.5f, 22.02f)); bezier5Path.AddLineTo(new PointF(84.75f, 5.5f)); bezier5Path.AddLineTo(new PointF(38.5f, 13.5f)); bezier5Path.AddLineTo(new PointF(45.5f, 25.5f)); bezier5Path.ClosePath(); color4.SetFill(); bezier5Path.Fill(); ////// Bezier 5 Inner Shadow var bezier5BorderRect = bezier5Path.Bounds; bezier5BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier5BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier5BorderRect = RectangleF.Union(bezier5BorderRect, bezier5Path.Bounds); bezier5BorderRect.Inflate(1, 1); var bezier5NegativePath = UIBezierPath.FromRect(bezier5BorderRect); bezier5NegativePath.AppendPath(bezier5Path); bezier5NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier5BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier5Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier5BorderRect.Width), 0); bezier5NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier5NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezier5Path.LineWidth = 1; bezier5Path.Stroke(); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(7.5f, 26.5f)); bezierPath.AddLineTo(new PointF(7.5f, 62.5f)); bezierPath.AddLineTo(new PointF(31.5f, 62.5f)); bezierPath.AddLineTo(new PointF(31.5f, 22.5f)); bezierPath.AddLineTo(new PointF(7.5f, 26.5f)); bezierPath.ClosePath(); color4.SetFill(); bezierPath.Fill(); ////// Bezier Inner Shadow var bezierBorderRect = bezierPath.Bounds; bezierBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezierBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezierBorderRect = RectangleF.Union(bezierBorderRect, bezierPath.Bounds); bezierBorderRect.Inflate(1, 1); var bezierNegativePath = UIBezierPath.FromRect(bezierBorderRect); bezierNegativePath.AppendPath(bezierPath); bezierNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezierBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezierPath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezierBorderRect.Width), 0); bezierNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezierNegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezierPath.LineWidth = 1; bezierPath.Stroke(); //// Text Drawing var textRect = new RectangleF(32, 23, 0, 0); //UIColor.Black.SetFill(); //new NSString(textContent).DrawString(textRect, UIFont.FromName("Helvetica", 12), UILineBreakMode.WordWrap, UITextAlignment.Center); //// Bezier 3 Drawing UIBezierPath bezier3Path = new UIBezierPath(); bezier3Path.MoveTo(new PointF(32.5f, 21.5f)); bezier3Path.AddLineTo(new PointF(2.5f, 26.5f)); bezier3Path.AddLineTo(new PointF(32.5f, 0.5f)); bezier3Path.AddLineTo(new PointF(32.5f, 21.5f)); color4.SetFill(); bezier3Path.Fill(); ////// Bezier 3 Inner Shadow var bezier3BorderRect = bezier3Path.Bounds; bezier3BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier3BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier3BorderRect = RectangleF.Union(bezier3BorderRect, bezier3Path.Bounds); bezier3BorderRect.Inflate(1, 1); var bezier3NegativePath = UIBezierPath.FromRect(bezier3BorderRect); bezier3NegativePath.AppendPath(bezier3Path); bezier3NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier3BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier3Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier3BorderRect.Width), 0); bezier3NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier3NegativePath.Fill(); } context.RestoreState(); color3.SetStroke(); bezier3Path.LineWidth = 1; bezier3Path.Stroke(); //// Bezier 4 Drawing UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new PointF(31.5f, 0.5f)); bezier4Path.AddLineTo(new PointF(50.5f, 25.5f)); bezier4Path.AddLineTo(new PointF(31.5f, 22.5f)); bezier4Path.AddLineTo(new PointF(31.5f, 0.5f)); bezier4Path.ClosePath(); color4.SetFill(); bezier4Path.Fill(); ////// Bezier 4 Inner Shadow var bezier4BorderRect = bezier4Path.Bounds; bezier4BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier4BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier4BorderRect = RectangleF.Union(bezier4BorderRect, bezier4Path.Bounds); bezier4BorderRect.Inflate(1, 1); var bezier4NegativePath = UIBezierPath.FromRect(bezier4BorderRect); bezier4NegativePath.AppendPath(bezier4Path); bezier4NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier4BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier4Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier4BorderRect.Width), 0); bezier4NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier4NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezier4Path.LineWidth = 1; bezier4Path.Stroke(); //// Rectangle 2 Drawing var rectangle2Path = UIBezierPath.FromRect(new RectangleF(11.5f, 32.5f, 9, 19)); color3.SetFill(); rectangle2Path.Fill(); UIColor.Black.SetStroke(); rectangle2Path.LineWidth = 1; rectangle2Path.Stroke(); //// Bezier 7 Drawing UIBezierPath bezier7Path = new UIBezierPath(); bezier7Path.MoveTo(new PointF(20.5f, 35.5f)); bezier7Path.AddCurveToPoint(new PointF(11.5f, 35.5f), new PointF(12.5f, 35.5f), new PointF(11.5f, 35.5f)); color5.SetStroke(); bezier7Path.LineWidth = 1; bezier7Path.Stroke(); //// Bezier 8 Drawing UIBezierPath bezier8Path = new UIBezierPath(); bezier8Path.MoveTo(new PointF(20.5f, 39.5f)); bezier8Path.AddCurveToPoint(new PointF(11.5f, 39.5f), new PointF(12.5f, 39.5f), new PointF(11.5f, 39.5f)); color5.SetStroke(); bezier8Path.LineWidth = 1; bezier8Path.Stroke(); //// Bezier 9 Drawing UIBezierPath bezier9Path = new UIBezierPath(); bezier9Path.MoveTo(new PointF(20.5f, 43.5f)); bezier9Path.AddCurveToPoint(new PointF(11.5f, 43.5f), new PointF(12.5f, 43.5f), new PointF(11.5f, 43.5f)); color5.SetStroke(); bezier9Path.LineWidth = 1; bezier9Path.Stroke(); //// Bezier 10 Drawing UIBezierPath bezier10Path = new UIBezierPath(); bezier10Path.MoveTo(new PointF(20.5f, 46.5f)); bezier10Path.AddCurveToPoint(new PointF(11.5f, 46.5f), new PointF(12.5f, 46.5f), new PointF(11.5f, 46.5f)); color5.SetStroke(); bezier10Path.LineWidth = 1; bezier10Path.Stroke(); //// Bezier 11 Drawing UIBezierPath bezier11Path = new UIBezierPath(); bezier11Path.MoveTo(new PointF(18.5f, 32.5f)); bezier11Path.AddCurveToPoint(new PointF(18.5f, 51.5f), new PointF(18.5f, 51.5f), new PointF(18.5f, 51.5f)); color5.SetStroke(); bezier11Path.LineWidth = 1; bezier11Path.Stroke(); //// Bezier 12 Drawing UIBezierPath bezier12Path = new UIBezierPath(); bezier12Path.MoveTo(new PointF(14.5f, 32.5f)); bezier12Path.AddCurveToPoint(new PointF(14.5f, 51.5f), new PointF(14.5f, 51.5f), new PointF(14.5f, 51.5f)); color5.SetStroke(); bezier12Path.LineWidth = 1; bezier12Path.Stroke(); //// Rectangle 3 Drawing var rectangle3Path = UIBezierPath.FromRect(new RectangleF(38.5f, 39.5f, 6, 21)); color3.SetFill(); rectangle3Path.Fill(); UIColor.Black.SetStroke(); rectangle3Path.LineWidth = 1; rectangle3Path.Stroke(); //// Bezier 13 Drawing UIBezierPath bezier13Path = new UIBezierPath(); bezier13Path.MoveTo(new PointF(38.5f, 42.5f)); bezier13Path.AddLineTo(new PointF(44.5f, 42.5f)); color5.SetFill(); bezier13Path.Fill(); color5.SetStroke(); bezier13Path.LineWidth = 1; bezier13Path.Stroke(); //// Bezier 14 Drawing UIBezierPath bezier14Path = new UIBezierPath(); bezier14Path.MoveTo(new PointF(38.5f, 46.5f)); bezier14Path.AddLineTo(new PointF(44.5f, 46.5f)); color5.SetFill(); bezier14Path.Fill(); color5.SetStroke(); bezier14Path.LineWidth = 1; bezier14Path.Stroke(); //// Bezier 15 Drawing UIBezierPath bezier15Path = new UIBezierPath(); bezier15Path.MoveTo(new PointF(38.5f, 51.5f)); bezier15Path.AddLineTo(new PointF(44.5f, 51.5f)); color5.SetFill(); bezier15Path.Fill(); color5.SetStroke(); bezier15Path.LineWidth = 1; bezier15Path.Stroke(); //// Bezier 16 Drawing UIBezierPath bezier16Path = new UIBezierPath(); bezier16Path.MoveTo(new PointF(38.5f, 56.5f)); bezier16Path.AddLineTo(new PointF(44.5f, 56.5f)); color5.SetFill(); bezier16Path.Fill(); color5.SetStroke(); bezier16Path.LineWidth = 1; bezier16Path.Stroke(); //// Bezier 17 Drawing UIBezierPath bezier17Path = new UIBezierPath(); bezier17Path.MoveTo(new PointF(41.5f, 39.5f)); bezier17Path.AddLineTo(new PointF(41.5f, 60.5f)); color5.SetFill(); bezier17Path.Fill(); color5.SetStroke(); bezier17Path.LineWidth = 1; bezier17Path.Stroke(); //// Rectangle 8 Drawing var rectangle8Path = UIBezierPath.FromRect(new RectangleF(79.5f, 53.5f, 6, 9)); color3.SetFill(); rectangle8Path.Fill(); ////// Rectangle 8 Inner Shadow var rectangle8BorderRect = rectangle8Path.Bounds; rectangle8BorderRect.Inflate(shadow2BlurRadius, shadow2BlurRadius); rectangle8BorderRect.Offset(-shadow2Offset.Width, -shadow2Offset.Height); rectangle8BorderRect = RectangleF.Union(rectangle8BorderRect, rectangle8Path.Bounds); rectangle8BorderRect.Inflate(1, 1); var rectangle8NegativePath = UIBezierPath.FromRect(rectangle8BorderRect); rectangle8NegativePath.AppendPath(rectangle8Path); rectangle8NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadow2Offset.Width + (float)Math.Round(rectangle8BorderRect.Width); var yOffset = shadow2Offset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadow2BlurRadius, shadow2); rectangle8Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle8BorderRect.Width), 0); rectangle8NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle8NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); rectangle8Path.LineWidth = 1; rectangle8Path.Stroke(); //// Rectangle 5 Drawing var rectangle5Path = UIBezierPath.FromRect(new RectangleF(53.5f, 29.5f, 6, 7)); color3.SetFill(); rectangle5Path.Fill(); UIColor.Black.SetStroke(); rectangle5Path.LineWidth = 1; rectangle5Path.Stroke(); //// Bezier 19 Drawing UIBezierPath bezier19Path = new UIBezierPath(); bezier19Path.MoveTo(new PointF(53.5f, 31.5f)); bezier19Path.AddCurveToPoint(new PointF(59.5f, 31.5f), new PointF(59.5f, 31.5f), new PointF(59.5f, 31.5f)); color5.SetStroke(); bezier19Path.LineWidth = 1; bezier19Path.Stroke(); //// Bezier 20 Drawing UIBezierPath bezier20Path = new UIBezierPath(); bezier20Path.MoveTo(new PointF(53.5f, 35.5f)); bezier20Path.AddLineTo(new PointF(59.5f, 35.5f)); color5.SetStroke(); bezier20Path.LineWidth = 1; bezier20Path.Stroke(); //// Bezier 21 Drawing UIBezierPath bezier21Path = new UIBezierPath(); bezier21Path.MoveTo(new PointF(56.5f, 29.5f)); bezier21Path.AddLineTo(new PointF(56.5f, 36.5f)); color5.SetStroke(); bezier21Path.LineWidth = 1; bezier21Path.Stroke(); //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRect(new RectangleF(64.5f, 29.5f, 6, 7)); color3.SetFill(); rectanglePath.Fill(); UIColor.Black.SetStroke(); rectanglePath.LineWidth = 1; rectanglePath.Stroke(); //// Bezier 22 Drawing UIBezierPath bezier22Path = new UIBezierPath(); bezier22Path.MoveTo(new PointF(64.5f, 31.5f)); bezier22Path.AddCurveToPoint(new PointF(70.5f, 31.5f), new PointF(70.5f, 31.5f), new PointF(70.5f, 31.5f)); color5.SetStroke(); bezier22Path.LineWidth = 1; bezier22Path.Stroke(); //// Bezier 23 Drawing UIBezierPath bezier23Path = new UIBezierPath(); bezier23Path.MoveTo(new PointF(64.5f, 35.5f)); bezier23Path.AddLineTo(new PointF(70.5f, 35.5f)); color5.SetStroke(); bezier23Path.LineWidth = 1; bezier23Path.Stroke(); //// Bezier 24 Drawing UIBezierPath bezier24Path = new UIBezierPath(); bezier24Path.MoveTo(new PointF(67.5f, 29.5f)); bezier24Path.AddLineTo(new PointF(67.5f, 36.5f)); color5.SetStroke(); bezier24Path.LineWidth = 1; bezier24Path.Stroke(); //// Rectangle 4 Drawing var rectangle4Path = UIBezierPath.FromRect(new RectangleF(76.5f, 28.5f, 6, 7)); color3.SetFill(); rectangle4Path.Fill(); UIColor.Black.SetStroke(); rectangle4Path.LineWidth = 1; rectangle4Path.Stroke(); //// Bezier 25 Drawing UIBezierPath bezier25Path = new UIBezierPath(); bezier25Path.MoveTo(new PointF(76.5f, 30.5f)); bezier25Path.AddCurveToPoint(new PointF(82.5f, 30.5f), new PointF(82.5f, 30.5f), new PointF(82.5f, 30.5f)); color5.SetStroke(); bezier25Path.LineWidth = 1; bezier25Path.Stroke(); //// Bezier 26 Drawing UIBezierPath bezier26Path = new UIBezierPath(); bezier26Path.MoveTo(new PointF(76.5f, 34.5f)); bezier26Path.AddLineTo(new PointF(82.5f, 34.5f)); color5.SetStroke(); bezier26Path.LineWidth = 1; bezier26Path.Stroke(); //// Bezier 27 Drawing UIBezierPath bezier27Path = new UIBezierPath(); bezier27Path.MoveTo(new PointF(79.5f, 28.5f)); bezier27Path.AddLineTo(new PointF(79.5f, 35.5f)); color5.SetStroke(); bezier27Path.LineWidth = 1; bezier27Path.Stroke(); } }
public static void DrawBlueShirt(RectangleF frame, float shirtAngle, float shirtScaleFactor) { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations var blueShirtBase = UIColor.FromRGBA(0.173f, 0.435f, 0.702f, 1.000f); var blueShirtBaseRGBA = new float[4]; blueShirtBase.GetRGBA(out blueShirtBaseRGBA[0], out blueShirtBaseRGBA[1], out blueShirtBaseRGBA[2], out blueShirtBaseRGBA[3]); var blueShirtStroke = UIColor.FromRGBA((blueShirtBaseRGBA[0] * 0.7f + 0.3f), (blueShirtBaseRGBA[1] * 0.7f + 0.3f), (blueShirtBaseRGBA[2] * 0.7f + 0.3f), (blueShirtBaseRGBA[3] * 0.7f + 0.3f)); //// Shadow Declarations var blueShirtShadow = blueShirtBase.CGColor; var blueShirtShadowOffset = new SizeF(2.1f, 2.1f); var blueShirtShadowBlurRadius = 3.0f; //// shirtBezier Drawing context.SaveState(); context.TranslateCTM(frame.GetMinX() + 61.94f, frame.GetMinY() + 59.36f); context.RotateCTM(-shirtAngle * (float)Math.PI / 180.0f); context.ScaleCTM(shirtScaleFactor, shirtScaleFactor); UIBezierPath shirtBezierPath = new UIBezierPath(); shirtBezierPath.MoveTo(new PointF(-27.46f, -43.29f)); shirtBezierPath.AddCurveToPoint(new PointF(-11.8f, -30.19f), new PointF(-27.46f, -43.29f), new PointF(-15.62f, -33.38f)); shirtBezierPath.AddLineTo(new PointF(-10.9f, -30.19f)); shirtBezierPath.AddCurveToPoint(new PointF(-10.59f, -29.78f), new PointF(-10.8f, -30.05f), new PointF(-10.7f, -29.92f)); shirtBezierPath.AddCurveToPoint(new PointF(10.42f, -29.78f), new PointF(-4.79f, -22.48f), new PointF(4.62f, -22.48f)); shirtBezierPath.AddCurveToPoint(new PointF(10.74f, -30.19f), new PointF(10.53f, -29.92f), new PointF(10.63f, -30.05f)); shirtBezierPath.AddCurveToPoint(new PointF(11.8f, -30.19f), new PointF(10.74f, -30.19f), new PointF(11.13f, -30.19f)); shirtBezierPath.AddCurveToPoint(new PointF(27.46f, -43.29f), new PointF(15.62f, -33.38f), new PointF(27.46f, -43.29f)); shirtBezierPath.AddLineTo(new PointF(48.92f, -10.09f)); shirtBezierPath.AddLineTo(new PointF(32.09f, 3.99f)); shirtBezierPath.AddCurveToPoint(new PointF(27.12f, -3.69f), new PointF(32.09f, 3.99f), new PointF(30.0f, 0.76f)); shirtBezierPath.AddCurveToPoint(new PointF(27.12f, 43.29f), new PointF(27.12f, 17.36f), new PointF(27.12f, 43.29f)); shirtBezierPath.AddLineTo(new PointF(-27.46f, 43.29f)); shirtBezierPath.AddCurveToPoint(new PointF(-27.46f, -3.18f), new PointF(-27.46f, 43.29f), new PointF(-27.46f, 17.78f)); shirtBezierPath.AddCurveToPoint(new PointF(-32.09f, 3.99f), new PointF(-30.16f, 1.0f), new PointF(-32.09f, 3.99f)); shirtBezierPath.AddLineTo(new PointF(-48.92f, -10.09f)); shirtBezierPath.AddLineTo(new PointF(-27.46f, -43.29f)); shirtBezierPath.ClosePath(); context.SaveState(); context.SetShadowWithColor(blueShirtShadowOffset, blueShirtShadowBlurRadius, blueShirtShadow); blueShirtBase.SetFill(); shirtBezierPath.Fill(); context.RestoreState(); blueShirtStroke.SetStroke(); shirtBezierPath.LineWidth = 8.0f; shirtBezierPath.Stroke(); context.RestoreState(); //// Text Drawing context.SaveState(); context.TranslateCTM(frame.GetMinX() + 62.0f, frame.GetMinY() + 61.95f); context.RotateCTM(-shirtAngle * (float)Math.PI / 180.0f); context.ScaleCTM(shirtScaleFactor, shirtScaleFactor); RectangleF textRect = new RectangleF(-24.7f, -25.61f, 50.0f, 50.0f); var textPath = UIBezierPath.FromRect(textRect); UIColor.Red.SetStroke(); textPath.LineWidth = 1.0f; textPath.Stroke(); { var textContent = "?"; UIColor.White.SetFill(); var textFont = UIFont.FromName("HelveticaNeue-Bold", 36.0f); textRect.Offset(0.0f, (textRect.Height - new NSString(textContent).StringSize(textFont, textRect.Size).Height) / 2.0f); new NSString(textContent).DrawString(textRect, textFont, UILineBreakMode.WordWrap, UITextAlignment.Center); } context.RestoreState(); }
static void paintCodeRetina() { //// Color Declarations UIColor color = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 0.000f); //// Oval 2 Drawing var oval2Path = UIBezierPath.FromOval(new RectangleF(1.5f, 0.5f, 41, 8)); color.SetFill(); oval2Path.Fill(); UIColor.Black.SetStroke(); oval2Path.LineWidth = 2; oval2Path.Stroke(); //// Bezier 7 Drawing UIBezierPath bezier7Path = new UIBezierPath(); bezier7Path.MoveTo(new PointF(30.64f, 7.16f)); bezier7Path.AddCurveToPoint(new PointF(21.21f, 4.74f), new PointF(30.64f, 7.16f), new PointF(25.54f, 4.74f)); bezier7Path.AddCurveToPoint(new PointF(11.79f, 7.16f), new PointF(16.89f, 4.74f), new PointF(11.79f, 7.16f)); bezier7Path.AddLineTo(new PointF(11.79f, 4.74f)); bezier7Path.AddCurveToPoint(new PointF(21.21f, 1.1f), new PointF(11.79f, 4.74f), new PointF(16.5f, 1.48f)); bezier7Path.AddCurveToPoint(new PointF(30.64f, 4.74f), new PointF(25.93f, 0.72f), new PointF(30.64f, 4.74f)); bezier7Path.AddLineTo(new PointF(30.64f, 7.16f)); bezier7Path.ClosePath(); color.SetFill(); bezier7Path.Fill(); UIColor.Black.SetStroke(); bezier7Path.LineWidth = 1; bezier7Path.Stroke(); //// Bezier 4 Drawing UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new PointF(21.42f, 9.18f)); bezier4Path.AddLineTo(new PointF(21.42f, 43.46f)); UIColor.Black.SetStroke(); bezier4Path.LineWidth = 1; bezier4Path.Stroke(); //// Bezier 5 Drawing UIBezierPath bezier5Path = new UIBezierPath(); bezier5Path.MoveTo(new PointF(8.68f, 8.11f)); bezier5Path.AddLineTo(new PointF(8.68f, 42.39f)); UIColor.Black.SetStroke(); bezier5Path.LineWidth = 1; bezier5Path.Stroke(); //// Bezier 6 Drawing UIBezierPath bezier6Path = new UIBezierPath(); bezier6Path.MoveTo(new PointF(34.16f, 8.11f)); bezier6Path.AddLineTo(new PointF(34.16f, 42.39f)); UIColor.Black.SetStroke(); bezier6Path.LineWidth = 1; bezier6Path.Stroke(); //// Oval Drawing var ovalPath = UIBezierPath.FromOval(new RectangleF(38.5f, 0.5f, 0, 0)); UIColor.White.SetFill(); ovalPath.Fill(); UIColor.Black.SetStroke(); ovalPath.LineWidth = 1; ovalPath.Stroke(); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(0.58f, 3.82f)); bezierPath.AddLineTo(new PointF(1.22f, 40.93f)); UIColor.White.SetFill(); bezierPath.Fill(); UIColor.Black.SetStroke(); bezierPath.LineWidth = 2; bezierPath.Stroke(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(43.42f, 3.82f)); bezier2Path.AddLineTo(new PointF(43.42f, 39.18f)); UIColor.Black.SetStroke(); bezier2Path.LineWidth = 2; bezier2Path.Stroke(); //// Bezier 3 Drawing UIBezierPath bezier3Path = new UIBezierPath(); bezier3Path.MoveTo(new PointF(1.5f, 40.5f)); bezier3Path.AddCurveToPoint(new PointF(21.5f, 43.5f), new PointF(1.5f, 40.5f), new PointF(10.69f, 43.12f)); bezier3Path.AddCurveToPoint(new PointF(43.5f, 38.5f), new PointF(32.31f, 43.88f), new PointF(43.5f, 38.5f)); UIColor.Black.SetStroke(); bezier3Path.LineWidth = 2; bezier3Path.Stroke(); }
// // ShapeObjectLogo // private void DrawShapeObjectLogo(CGContext context) { UIBezierPath ShapeObjectLogo; // Shape Path ShapeObjectLogo = new UIBezierPath(); ShapeObjectLogo.MoveTo(new CGPoint(21.640106, 0.000000)); ShapeObjectLogo.AddCurveToPoint(new CGPoint(16.612139, 2.920175), new CGPoint(19.615119, 0.005031), new CGPoint(17.632132, 1.159215)); ShapeObjectLogo.AddLineTo(new CGPoint(0.752245, 30.580328)); ShapeObjectLogo.AddCurveToPoint(new CGPoint(0.752245, 36.419672), new CGPoint(-0.250748, 32.346320), new CGPoint(-0.250748, 34.654687)); ShapeObjectLogo.AddLineTo(new CGPoint(16.612139, 64.080831)); ShapeObjectLogo.AddCurveToPoint(new CGPoint(21.641106, 67.000000), new CGPoint(17.632132, 65.841791), new CGPoint(19.615119, 66.995975)); ShapeObjectLogo.AddLineTo(new CGPoint(53.359894, 67.000000)); ShapeObjectLogo.AddCurveToPoint(new CGPoint(58.387861, 64.080831), new CGPoint(55.384881, 66.995975), new CGPoint(57.367868, 65.841791)); ShapeObjectLogo.AddLineTo(new CGPoint(74.247755, 36.419672)); ShapeObjectLogo.AddCurveToPoint(new CGPoint(74.247755, 30.580328), new CGPoint(75.250748, 34.654687), new CGPoint(75.250748, 32.346320)); ShapeObjectLogo.AddLineTo(new CGPoint(58.386861, 2.920175)); ShapeObjectLogo.AddCurveToPoint(new CGPoint(53.359894, 0.000000), new CGPoint(57.367868, 1.159215), new CGPoint(55.384881, 0.004025)); ShapeObjectLogo.AddLineTo(new CGPoint(21.640106, 0.000000)); ShapeObjectLogo.ClosePath(); ShapeObjectLogo.MoveTo(new CGPoint(21.640106, 0.000000)); ShapeObjectLogo.MoveTo(new CGPoint(21.928104, 16.181713)); ShapeObjectLogo.AddCurveToPoint(new CGPoint(22.061103, 16.181713), new CGPoint(21.972313, 16.176991), new CGPoint(22.016894, 16.176991)); ShapeObjectLogo.AddLineTo(new CGPoint(27.532066, 16.181713)); ShapeObjectLogo.AddCurveToPoint(new CGPoint(28.130062, 16.537930), new CGPoint(27.778919, 16.189389), new CGPoint(28.004637, 16.323845)); ShapeObjectLogo.AddLineTo(new CGPoint(37.411001, 33.143280)); ShapeObjectLogo.AddCurveToPoint(new CGPoint(37.500000, 33.410946), new CGPoint(37.458060, 33.225659), new CGPoint(37.488317, 33.316656)); ShapeObjectLogo.AddCurveToPoint(new CGPoint(37.587999, 33.143280), new CGPoint(37.511374, 33.316728), new CGPoint(37.541289, 33.225734)); ShapeObjectLogo.AddLineTo(new CGPoint(46.846938, 16.537930)); ShapeObjectLogo.AddCurveToPoint(new CGPoint(47.466934, 16.181713), new CGPoint(46.977011, 16.317781), new CGPoint(47.212411, 16.182533)); ShapeObjectLogo.AddLineTo(new CGPoint(52.936897, 16.181713)); ShapeObjectLogo.AddCurveToPoint(new CGPoint(53.557893, 17.229233), new CGPoint(53.421894, 16.186744), new CGPoint(53.784891, 16.798552)); ShapeObjectLogo.AddLineTo(new CGPoint(44.497953, 33.500503)); ShapeObjectLogo.AddLineTo(new CGPoint(53.557893, 49.748630)); ShapeObjectLogo.AddCurveToPoint(new CGPoint(52.937897, 50.818287), new CGPoint(53.806891, 50.181323), new CGPoint(53.434894, 50.823318)); ShapeObjectLogo.AddLineTo(new CGPoint(47.466934, 50.818287)); ShapeObjectLogo.AddCurveToPoint(new CGPoint(46.846938, 50.439932), new CGPoint(47.207875, 50.812898), new CGPoint(46.971429, 50.668606)); ShapeObjectLogo.AddLineTo(new CGPoint(37.586999, 33.834582)); ShapeObjectLogo.AddCurveToPoint(new CGPoint(37.500000, 33.566916), new CGPoint(37.540639, 33.752052), new CGPoint(37.511064, 33.661063)); ShapeObjectLogo.AddCurveToPoint(new CGPoint(37.411001, 33.834582), new CGPoint(37.488317, 33.661206), new CGPoint(37.458060, 33.752204)); ShapeObjectLogo.AddLineTo(new CGPoint(28.131062, 50.439932)); ShapeObjectLogo.AddCurveToPoint(new CGPoint(27.532066, 50.818287), new CGPoint(28.010506, 50.662417), new CGPoint(27.783589, 50.805749)); ShapeObjectLogo.AddLineTo(new CGPoint(22.062103, 50.818287)); ShapeObjectLogo.AddCurveToPoint(new CGPoint(21.442107, 49.748630), new CGPoint(21.564106, 50.823318), new CGPoint(21.192109, 50.182329)); ShapeObjectLogo.AddLineTo(new CGPoint(30.500047, 33.500503)); ShapeObjectLogo.AddLineTo(new CGPoint(21.440107, 17.229233)); ShapeObjectLogo.AddCurveToPoint(new CGPoint(21.927104, 16.181713), new CGPoint(21.223109, 16.836790), new CGPoint(21.488107, 16.265233)); ShapeObjectLogo.AddLineTo(new CGPoint(21.928104, 16.181713)); ShapeObjectLogo.ClosePath(); ShapeObjectLogo.MoveTo(new CGPoint(21.928104, 16.181713)); context.SaveState(); context.TranslateCTM(3.000000f, 7.000000f); // Shape Outer Shadow context.SaveState(); context.BeginPath(); context.AddPath(ShapeObjectLogo.CGPath); context.AddRect(RectangleFExtensions.Inset(ShapeObjectLogo.Bounds, -1f, -2f)); context.EOClip(); context.TranslateCTM(-77f, 0f); GenerateShapeShadow(context, ShapeObjectLogo, 77f, 1f, 77f, 0, UIColor.FromHSBA(0.000000f, 0.000000f, 0.000000f, 0.500000f), 0f, 0, 0f, 0f); context.RestoreState(); // Shape Fill context.SaveState(); if (Active) { UIColor.FromHSBA(0.530476f, 0.849515f, 0.807843f, 1.000000f).SetFill(); } else { UIColor.FromRGB(137, 137, 137).SetFill(); } ShapeObjectLogo.Fill(); context.RestoreState(); context.RestoreState(); }
static void paintCodeNonRetina() { //// Color Declarations UIColor color = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 0.000f); //// Group { //// Oval 2 Drawing var oval2Path = UIBezierPath.FromOval(new RectangleF(0.5f, 0.5f, 21, 4)); color.SetFill(); oval2Path.Fill(); UIColor.Black.SetStroke(); oval2Path.LineWidth = 2; oval2Path.Stroke(); //// Bezier 7 Drawing UIBezierPath bezier7Path = new UIBezierPath(); bezier7Path.MoveTo(new PointF(15.32f, 3.58f)); bezier7Path.AddCurveToPoint(new PointF(10.61f, 2.37f), new PointF(15.32f, 3.58f), new PointF(12.77f, 2.37f)); bezier7Path.AddCurveToPoint(new PointF(5.89f, 3.58f), new PointF(8.45f, 2.37f), new PointF(5.89f, 3.58f)); bezier7Path.AddLineTo(new PointF(5.89f, 2.37f)); bezier7Path.AddCurveToPoint(new PointF(10.61f, 0.55f), new PointF(5.89f, 2.37f), new PointF(8.25f, 0.74f)); bezier7Path.AddCurveToPoint(new PointF(15.32f, 2.37f), new PointF(12.96f, 0.36f), new PointF(15.32f, 2.37f)); bezier7Path.AddLineTo(new PointF(15.32f, 3.58f)); bezier7Path.ClosePath(); color.SetFill(); bezier7Path.Fill(); UIColor.Black.SetStroke(); bezier7Path.LineWidth = 1; bezier7Path.Stroke(); //// Bezier 4 Drawing UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new PointF(10.71f, 4.59f)); bezier4Path.AddLineTo(new PointF(10.71f, 21.73f)); UIColor.Black.SetStroke(); bezier4Path.LineWidth = 1; bezier4Path.Stroke(); //// Bezier 5 Drawing UIBezierPath bezier5Path = new UIBezierPath(); bezier5Path.MoveTo(new PointF(4.34f, 4.05f)); bezier5Path.AddLineTo(new PointF(4.34f, 21.2f)); UIColor.Black.SetStroke(); bezier5Path.LineWidth = 1; bezier5Path.Stroke(); //// Bezier 6 Drawing UIBezierPath bezier6Path = new UIBezierPath(); bezier6Path.MoveTo(new PointF(17.08f, 4.05f)); bezier6Path.AddLineTo(new PointF(17.08f, 21.2f)); UIColor.Black.SetStroke(); bezier6Path.LineWidth = 1; bezier6Path.Stroke(); //// Oval Drawing var ovalPath = UIBezierPath.FromOval(new RectangleF(19.5f, 0.5f, 0, 0)); UIColor.White.SetFill(); ovalPath.Fill(); UIColor.Black.SetStroke(); ovalPath.LineWidth = 1; ovalPath.Stroke(); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(0.29f, 1.91f)); bezierPath.AddLineTo(new PointF(0.61f, 20.47f)); UIColor.White.SetFill(); bezierPath.Fill(); UIColor.Black.SetStroke(); bezierPath.LineWidth = 2; bezierPath.Stroke(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(21.71f, 1.91f)); bezier2Path.AddLineTo(new PointF(21.71f, 19.59f)); UIColor.Black.SetStroke(); bezier2Path.LineWidth = 2; bezier2Path.Stroke(); //// Bezier 3 Drawing UIBezierPath bezier3Path = new UIBezierPath(); bezier3Path.MoveTo(new PointF(0.75f, 20.25f)); bezier3Path.AddCurveToPoint(new PointF(10.75f, 21.75f), new PointF(0.75f, 20.25f), new PointF(5.34f, 21.56f)); bezier3Path.AddCurveToPoint(new PointF(21.75f, 19.25f), new PointF(16.16f, 21.94f), new PointF(21.75f, 19.25f)); UIColor.Black.SetStroke(); bezier3Path.LineWidth = 2; bezier3Path.Stroke(); } }
//// Drawing Methods public static void DrawSiriRemote(string pressed, string arrow) { //// General Declarations var colorSpace = CGColorSpace.CreateDeviceRGB(); var context = UIGraphics.GetCurrentContext(); //// Color Declarations var gradientColor = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); var gradientColor2 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); var gradientColor3 = UIColor.FromRGBA(0.368f, 0.368f, 0.368f, 1.000f); var gradientColor4 = UIColor.FromRGBA(0.147f, 0.147f, 0.147f, 1.000f); var strokeColor = UIColor.FromRGBA(0.521f, 0.521f, 0.521f, 1.000f); var strokeColor2 = UIColor.FromRGBA(0.264f, 0.260f, 0.260f, 1.000f); var fillColor = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); var textForeground = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); var strokeColor3 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); var fillColor2 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); var pressedColor = UIColor.FromRGBA(0.847f, 0.187f, 0.187f, 1.000f); var gradientColor5 = UIColor.FromRGBA(0.401f, 0.015f, 0.015f, 1.000f); //// Gradient Declarations var radialGradient1Colors = new CGColor [] { gradientColor.CGColor, gradientColor2.CGColor }; var radialGradient1Locations = new nfloat [] { 0.0f, 1.0f }; var radialGradient1 = new CGGradient(colorSpace, radialGradient1Colors, radialGradient1Locations); var touchGradientColors = new CGColor [] { gradientColor3.CGColor, gradientColor4.CGColor }; var touchGradientLocations = new nfloat [] { 0.0f, 1.0f }; var touchGradient = new CGGradient(colorSpace, touchGradientColors, touchGradientLocations); var pressedGradientColors = new CGColor [] { pressedColor.CGColor, gradientColor5.CGColor }; var pressedGradientLocations = new nfloat [] { 0.0f, 1.0f }; var pressedGradient = new CGGradient(colorSpace, pressedGradientColors, pressedGradientLocations); //// Variable Declarations var menuPressed = pressed == "Menu" ? pressedColor : fillColor; var homePressed = pressed == "Home" ? pressedColor : fillColor; var siriPressed = pressed == "Siri" ? pressedColor : fillColor; var volumePressed = pressed == "Volume" ? pressedColor : fillColor; var playPausePressed = pressed == "PlayPause" ? pressedColor : fillColor; var touchSurfacePressed = pressed == "Touch" ? pressedGradient : touchGradient; var upArrow = arrow == "Up" ? true : false; var downArrow = arrow == "Down" ? true : false; var leftArrow = arrow == "Left" ? true : false; var rightArrow = arrow == "Right" ? true : false; //// Page-1 { //// Intro01 { //// Siri-Remote-Render { //// Rectangle-4 Drawing var rectangle4Path = UIBezierPath.FromRoundedRect(new CGRect(1.0f, 0.0f, 253.0f, 747.0f), 40.0f); context.SaveState(); rectangle4Path.AddClip(); context.DrawRadialGradient(radialGradient1, new CGPoint(8.62f, 234.62f), 0.0f, new CGPoint(8.62f, 234.62f), 567.36f, CGGradientDrawingOptions.DrawsBeforeStartLocation | CGGradientDrawingOptions.DrawsAfterEndLocation); context.RestoreState(); strokeColor.SetStroke(); rectangle4Path.LineWidth = 3.0f; rectangle4Path.Stroke(); //// Rectangle-4-Copy Drawing UIBezierPath rectangle4CopyPath = new UIBezierPath(); rectangle4CopyPath.MoveTo(new CGPoint(254.0f, 312.0f)); rectangle4CopyPath.AddLineTo(new CGPoint(254.0f, 40.0f)); rectangle4CopyPath.AddCurveToPoint(new CGPoint(214.0f, 0.0f), new CGPoint(254.0f, 17.91f), new CGPoint(236.09f, 0.0f)); rectangle4CopyPath.AddLineTo(new CGPoint(41.0f, 0.0f)); rectangle4CopyPath.AddCurveToPoint(new CGPoint(1.0f, 40.0f), new CGPoint(18.92f, 0.0f), new CGPoint(1.0f, 17.91f)); rectangle4CopyPath.AddLineTo(new CGPoint(1.0f, 312.0f)); rectangle4CopyPath.AddLineTo(new CGPoint(254.0f, 312.0f)); rectangle4CopyPath.ClosePath(); rectangle4CopyPath.MiterLimit = 4.0f; rectangle4CopyPath.UsesEvenOddFillRule = true; context.SaveState(); rectangle4CopyPath.AddClip(); context.DrawLinearGradient(touchSurfacePressed, new CGPoint(127.5f, 0.0f), new CGPoint(127.5f, 312.0f), CGGradientDrawingOptions.DrawsBeforeStartLocation | CGGradientDrawingOptions.DrawsAfterEndLocation); context.RestoreState(); strokeColor2.SetStroke(); rectangle4CopyPath.LineWidth = 3.0f; rectangle4CopyPath.Stroke(); //// Menu-Button { //// Oval-1 Drawing var oval1Path = UIBezierPath.FromOval(new CGRect(18.0f, 214.0f, 87.0f, 87.0f)); menuPressed.SetFill(); oval1Path.Fill(); //// Label Drawing CGRect labelRect = new CGRect(31.42f, 243.0f, 71.58f, 30.0f); textForeground.SetFill(); new NSString("MENU").DrawString(labelRect, UIFont.BoldSystemFontOfSize(20.0f), UILineBreakMode.WordWrap, UITextAlignment.Left); if (upArrow) { //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(105.5f, 74.5f)); bezierPath.AddLineTo(new CGPoint(149.5f, 74.5f)); bezierPath.AddLineTo(new CGPoint(127.5f, 44.5f)); bezierPath.AddLineTo(new CGPoint(105.5f, 74.5f)); pressedColor.SetFill(); bezierPath.Fill(); } if (downArrow) { //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new CGPoint(106.0f, 180.0f)); bezier2Path.AddLineTo(new CGPoint(150.0f, 180.0f)); bezier2Path.AddLineTo(new CGPoint(128.0f, 210.0f)); bezier2Path.AddLineTo(new CGPoint(106.0f, 180.0f)); pressedColor.SetFill(); bezier2Path.Fill(); } if (rightArrow) { //// Bezier 3 Drawing context.SaveState(); context.TranslateCTM(212.0f, 129.0f); context.RotateCTM(90.0f * NMath.PI / 180.0f); UIBezierPath bezier3Path = new UIBezierPath(); bezier3Path.MoveTo(new CGPoint(-22.0f, 15.0f)); bezier3Path.AddLineTo(new CGPoint(22.0f, 15.0f)); bezier3Path.AddLineTo(new CGPoint(0.0f, -15.0f)); bezier3Path.AddLineTo(new CGPoint(-22.0f, 15.0f)); pressedColor.SetFill(); bezier3Path.Fill(); context.RestoreState(); } if (leftArrow) { //// Bezier 4 Drawing context.SaveState(); context.TranslateCTM(38.0f, 129.0f); context.RotateCTM(-90.0f * NMath.PI / 180.0f); UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new CGPoint(-22.0f, 15.0f)); bezier4Path.AddLineTo(new CGPoint(22.0f, 15.0f)); bezier4Path.AddLineTo(new CGPoint(0.0f, -15.0f)); bezier4Path.AddLineTo(new CGPoint(-22.0f, 15.0f)); pressedColor.SetFill(); bezier4Path.Fill(); context.RestoreState(); } } //// Home-Button { //// Oval-1-Copy Drawing var oval1CopyPath = UIBezierPath.FromOval(new CGRect(147.0f, 214.0f, 87.0f, 87.0f)); homePressed.SetFill(); oval1CopyPath.Fill(); //// Rectangle-1-+-Line { //// Rectangle-1 Drawing var rectangle1Path = UIBezierPath.FromRect(new CGRect(166.0f, 239.0f, 49.0f, 32.0f)); strokeColor3.SetStroke(); rectangle1Path.LineWidth = 2.0f; rectangle1Path.Stroke(); //// Line Drawing UIBezierPath linePath = new UIBezierPath(); linePath.MoveTo(new CGPoint(174.5f, 276.0f)); linePath.AddLineTo(new CGPoint(205.56f, 276.0f)); linePath.MiterLimit = 4.0f; linePath.LineCapStyle = CGLineCap.Square; linePath.UsesEvenOddFillRule = true; strokeColor3.SetStroke(); linePath.LineWidth = 2.0f; linePath.Stroke(); } } //// Volume-Button { //// Rectangle- 6 Drawing var rectangle6Path = UIBezierPath.FromRoundedRect(new CGRect(147.0f, 321.0f, 87.0f, 197.0f), 40.0f); volumePressed.SetFill(); rectangle6Path.Fill(); //// Label 2 Drawing CGRect label2Rect = new CGRect(174.96f, 329.0f, 31.08f, 71.0f); textForeground.SetFill(); new NSString("+\n").DrawString(label2Rect, UIFont.BoldSystemFontOfSize(48.0f), UILineBreakMode.WordWrap, UITextAlignment.Left); //// Label 3 Drawing CGRect label3Rect = new CGRect(179.89f, 436.0f, 21.21f, 71.0f); textForeground.SetFill(); new NSString("-").DrawString(label3Rect, UIFont.BoldSystemFontOfSize(48.0f), UILineBreakMode.WordWrap, UITextAlignment.Left); } //// Siri-Button { //// Oval-1-Copy-2 Drawing var oval1Copy2Path = UIBezierPath.FromOval(new CGRect(18.0f, 321.0f, 87.0f, 87.0f)); siriPressed.SetFill(); oval1Copy2Path.Fill(); //// Group 11 { //// Rectangle- 10 Drawing var rectangle10Path = UIBezierPath.FromRoundedRect(new CGRect(49.52f, 338.0f, 22.55f, 38.57f), 11.27f); fillColor2.SetFill(); rectangle10Path.Fill(); //// Path-2 Drawing UIBezierPath path2Path = new UIBezierPath(); path2Path.MoveTo(new CGPoint(46.0f, 363.63f)); path2Path.AddCurveToPoint(new CGPoint(61.24f, 381.48f), new CGPoint(46.0f, 363.63f), new CGPoint(45.67f, 381.58f)); path2Path.AddCurveToPoint(new CGPoint(76.81f, 363.25f), new CGPoint(76.81f, 381.38f), new CGPoint(76.81f, 363.25f)); path2Path.MiterLimit = 4.0f; path2Path.UsesEvenOddFillRule = true; strokeColor3.SetStroke(); path2Path.LineWidth = 4.0f; path2Path.Stroke(); //// Line 2 Drawing UIBezierPath line2Path = new UIBezierPath(); line2Path.MoveTo(new CGPoint(61.5f, 381.83f)); line2Path.AddLineTo(new CGPoint(61.5f, 389.55f)); line2Path.MiterLimit = 4.0f; line2Path.LineCapStyle = CGLineCap.Square; line2Path.UsesEvenOddFillRule = true; strokeColor3.SetStroke(); line2Path.LineWidth = 4.0f; line2Path.Stroke(); //// Line 3 Drawing UIBezierPath line3Path = new UIBezierPath(); line3Path.MoveTo(new CGPoint(49.88f, 390.6f)); line3Path.AddLineTo(new CGPoint(72.46f, 390.6f)); line3Path.MiterLimit = 4.0f; line3Path.LineCapStyle = CGLineCap.Square; line3Path.UsesEvenOddFillRule = true; strokeColor3.SetStroke(); line3Path.LineWidth = 4.0f; line3Path.Stroke(); } } //// Play/Pause-Button { //// Oval-1-Copy-3 Drawing var oval1Copy3Path = UIBezierPath.FromOval(new CGRect(18.0f, 428.0f, 87.0f, 87.0f)); playPausePressed.SetFill(); oval1Copy3Path.Fill(); //// Path-5-+-Line-+-Line-Copy { //// Path-5 Drawing UIBezierPath path5Path = new UIBezierPath(); path5Path.MoveTo(new CGPoint(40.98f, 457.24f)); path5Path.AddLineTo(new CGPoint(40.98f, 485.25f)); path5Path.AddLineTo(new CGPoint(59.77f, 471.25f)); path5Path.AddLineTo(new CGPoint(40.98f, 457.24f)); path5Path.ClosePath(); path5Path.MiterLimit = 4.0f; path5Path.UsesEvenOddFillRule = true; fillColor2.SetFill(); path5Path.Fill(); //// Line 4 Drawing UIBezierPath line4Path = new UIBezierPath(); line4Path.MoveTo(new CGPoint(69.18f, 457.72f)); line4Path.AddLineTo(new CGPoint(69.18f, 484.8f)); line4Path.MiterLimit = 4.0f; line4Path.LineCapStyle = CGLineCap.Square; line4Path.UsesEvenOddFillRule = true; strokeColor3.SetStroke(); line4Path.LineWidth = 4.0f; line4Path.Stroke(); //// Line-Copy Drawing UIBezierPath lineCopyPath = new UIBezierPath(); lineCopyPath.MoveTo(new CGPoint(79.61f, 457.72f)); lineCopyPath.AddLineTo(new CGPoint(79.61f, 484.8f)); lineCopyPath.MiterLimit = 4.0f; lineCopyPath.LineCapStyle = CGLineCap.Square; lineCopyPath.UsesEvenOddFillRule = true; strokeColor3.SetStroke(); lineCopyPath.LineWidth = 4.0f; lineCopyPath.Stroke(); } } //// Rectangle- 12 Drawing var rectangle12Path = UIBezierPath.FromRoundedRect(new CGRect(110.0f, 13.0f, 34.0f, 13.0f), 6.5f); fillColor.SetFill(); rectangle12Path.Fill(); strokeColor.SetStroke(); rectangle12Path.LineWidth = 1.0f; rectangle12Path.Stroke(); } } } }
public override void DrawRect (System.Drawing.RectangleF area, UIViewPrintFormatter formatter) { base.DrawRect (area, formatter); UIColor checkMarkColor = this.Color; RectangleF frame = this.Bounds; UIBezierPath checkMarkPath = new UIBezierPath (); checkMarkPath.MoveTo (new PointF (frame.GetMinX () + 0.07087F * frame.Width, frame.GetMinY () + 0.48855F * frame.Height)); checkMarkPath.AddLineTo (new PointF (frame.GetMinX() + 0.12500F * frame.Width, frame.GetMinY() + 0.45284F * frame.Height)); checkMarkPath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.21038F * frame.Width, frame.GetMinY() + 0.47898F * frame.Height), new PointF (frame.GetMinX() + 0.15489F * frame.Width, frame.GetMinY() + 0.43312F * frame.Height), new PointF (frame.GetMinX() + 0.19312F * frame.Width, frame.GetMinY() + 0.44482F * frame.Height)); checkMarkPath.AddLineTo (new PointF (frame.GetMinX() + 0.51450F * frame.Width, frame.GetMinY() + 0.79528F * frame.Height)); checkMarkPath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.49163F * frame.Width, frame.GetMinY() + 0.89286F * frame.Height), new PointF (frame.GetMinX() + 0.53176F * frame.Width, frame.GetMinY() + 0.82945F * frame.Height), new PointF (frame.GetMinX() + 0.52152F * frame.Width, frame.GetMinY() + 0.87313F * frame.Height)); checkMarkPath.AddLineTo (new PointF (frame.GetMinX() + 0.38337F * frame.Width, frame.GetMinY() + 0.96429F * frame.Height)); checkMarkPath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.07087F * frame.Width, frame.GetMinY() + 0.48855F * frame.Height), new PointF (frame.GetMinX() + 0.03074F * frame.Width, frame.GetMinY() + 0.55196F * frame.Height), new PointF (frame.GetMinX() + 0.04098F * frame.Width, frame.GetMinY() + 0.50828F * frame.Height)); checkMarkPath.ClosePath (); checkMarkPath.MoveTo (new PointF (frame.GetMinX () + 0.92048F * frame.Width, frame.GetMinY () + 0.00641F * frame.Height)); checkMarkPath.AddLineTo (new PointF (frame.GetMinX() + 0.93750F * frame.Width, frame.GetMinY() + 0.02427F * frame.Height)); checkMarkPath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.96038F * frame.Width, frame.GetMinY() + 0.12184F * frame.Height), new PointF (frame.GetMinX() + 0.96739F * frame.Width, frame.GetMinY() + 0.04399F * frame.Height), new PointF (frame.GetMinX() + 0.97764F * frame.Width, frame.GetMinY() + 0.08768F * frame.Height)); checkMarkPath.AddLineTo (new PointF (frame.GetMinX() + 0.51450F * frame.Width, frame.GetMinY() + 0.93814F * frame.Height)); checkMarkPath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.42913F * frame.Width, frame.GetMinY() + 0.96429F * frame.Height), new PointF (frame.GetMinX() + 0.49724F * frame.Width, frame.GetMinY() + 0.97230F * frame.Height), new PointF (frame.GetMinX() + 0.45902F * frame.Width, frame.GetMinY() + 0.98401F * frame.Height)); checkMarkPath.AddLineTo (new PointF (frame.GetMinX() + 0.32087F * frame.Width, frame.GetMinY() + 0.89286F * frame.Height)); checkMarkPath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.29800F * frame.Width, frame.GetMinY() + 0.79528F * frame.Height), new PointF (frame.GetMinX() + 0.29098F * frame.Width, frame.GetMinY() + 0.87313F * frame.Height), new PointF (frame.GetMinX() + 0.28074F * frame.Width, frame.GetMinY() + 0.82945F * frame.Height)); checkMarkPath.AddLineTo (new PointF (frame.GetMinX() + 0.83511F * frame.Width, frame.GetMinY() + 0.03255F * frame.Height)); checkMarkPath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.92048F * frame.Width, frame.GetMinY() + 0.00641F * frame.Height), new PointF (frame.GetMinX() + 0.85237F * frame.Width, frame.GetMinY() + 0.00161F * frame.Height), new PointF (frame.GetMinX() + 0.89059F * frame.Width, frame.GetMinY() + -0.01331F * frame.Height)); checkMarkPath.ClosePath (); checkMarkPath.MoveTo (new PointF (frame.GetMinX () + 0.37500F * frame.Width, frame.GetMinY () + 0.78572F * frame.Height)); checkMarkPath.AddLineTo (new PointF (frame.GetMinX() + 0.43750F * frame.Width, frame.GetMinY() + 0.78572F * frame.Height)); checkMarkPath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.50000F * frame.Width, frame.GetMinY() + 0.85714F * frame.Height), new PointF (frame.GetMinX() + 0.47202F * frame.Width, frame.GetMinY() + 0.78572F * frame.Height), new PointF (frame.GetMinX() + 0.50000F * frame.Width, frame.GetMinY() + 0.81769F * frame.Height)); checkMarkPath.AddLineTo (new PointF (frame.GetMinX() + 0.50000F * frame.Width, frame.GetMinY() + 0.92857F * frame.Height)); checkMarkPath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.43750F * frame.Width, frame.GetMinY() + 1.00000F * frame.Height), new PointF (frame.GetMinX() + 0.50000F * frame.Width, frame.GetMinY() + 0.96802F * frame.Height), new PointF (frame.GetMinX() + 0.47202F * frame.Width, frame.GetMinY() + 1.00000F * frame.Height)); checkMarkPath.AddLineTo (new PointF (frame.GetMinX() + 0.37500F * frame.Width, frame.GetMinY() + 1.00000F * frame.Height)); checkMarkPath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.31250F * frame.Width, frame.GetMinY() + 0.92857F * frame.Height), new PointF (frame.GetMinX() + 0.34048F * frame.Width, frame.GetMinY() + 1.00000F * frame.Height), new PointF (frame.GetMinX() + 0.31250F * frame.Width, frame.GetMinY() + 0.96802F * frame.Height)); checkMarkPath.AddLineTo (new PointF (frame.GetMinX() + 0.31250F * frame.Width, frame.GetMinY() + 0.85714F * frame.Height)); checkMarkPath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.37500F * frame.Width, frame.GetMinY() + 0.78572F * frame.Height), new PointF (frame.GetMinX() + 0.31250F * frame.Width, frame.GetMinY() + 0.81769F * frame.Height), new PointF (frame.GetMinX() + 0.34048F * frame.Width, frame.GetMinY() + 0.78572F * frame.Height)); checkMarkPath.ClosePath (); checkMarkColor.SetFill (); checkMarkPath.Fill (); }
private void DrawSharpCanvas(UIColor fillColor, nfloat width, nfloat height) { //// Frames var sharpFrame = new CGRect(0.0f, 0.0f, width, height); //// SharpSymbol Drawing var sharpSymbolPath = new UIBezierPath(); sharpSymbolPath.MoveTo(new CGPoint(sharpFrame.GetMinX() + 0.80000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.00002f * sharpFrame.Height)); sharpSymbolPath.AddCurveToPoint(new CGPoint(sharpFrame.GetMinX() + 0.80000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.20000f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.80000f * sharpFrame.Width, sharpFrame.GetMinY() + -0.00000f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.80000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.08245f * sharpFrame.Height)); sharpSymbolPath.AddLineTo(new CGPoint(sharpFrame.GetMinX() + 1.00000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.20000f * sharpFrame.Height)); sharpSymbolPath.AddLineTo(new CGPoint(sharpFrame.GetMinX() + 1.00000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.40000f * sharpFrame.Height)); sharpSymbolPath.AddLineTo(new CGPoint(sharpFrame.GetMinX() + 0.80000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.40000f * sharpFrame.Height)); sharpSymbolPath.AddCurveToPoint(new CGPoint(sharpFrame.GetMinX() + 0.80000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.60000f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.80000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.46586f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.80000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.53414f * sharpFrame.Height)); sharpSymbolPath.AddLineTo(new CGPoint(sharpFrame.GetMinX() + 1.00000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.60000f * sharpFrame.Height)); sharpSymbolPath.AddLineTo(new CGPoint(sharpFrame.GetMinX() + 1.00000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.80000f * sharpFrame.Height)); sharpSymbolPath.AddLineTo(new CGPoint(sharpFrame.GetMinX() + 0.80000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.80000f * sharpFrame.Height)); sharpSymbolPath.AddCurveToPoint(new CGPoint(sharpFrame.GetMinX() + 0.80000f * sharpFrame.Width, sharpFrame.GetMinY() + 1.00000f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.80000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.91755f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.80000f * sharpFrame.Width, sharpFrame.GetMinY() + 1.00000f * sharpFrame.Height)); sharpSymbolPath.AddLineTo(new CGPoint(sharpFrame.GetMinX() + 0.60000f * sharpFrame.Width, sharpFrame.GetMinY() + 1.00000f * sharpFrame.Height)); sharpSymbolPath.AddCurveToPoint(new CGPoint(sharpFrame.GetMinX() + 0.60000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.80000f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.60000f * sharpFrame.Width, sharpFrame.GetMinY() + 1.00000f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.60000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.91755f * sharpFrame.Height)); sharpSymbolPath.AddLineTo(new CGPoint(sharpFrame.GetMinX() + 0.40000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.80000f * sharpFrame.Height)); sharpSymbolPath.AddCurveToPoint(new CGPoint(sharpFrame.GetMinX() + 0.40000f * sharpFrame.Width, sharpFrame.GetMinY() + 1.00000f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.40000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.91755f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.40000f * sharpFrame.Width, sharpFrame.GetMinY() + 1.00000f * sharpFrame.Height)); sharpSymbolPath.AddLineTo(new CGPoint(sharpFrame.GetMinX() + 0.20000f * sharpFrame.Width, sharpFrame.GetMinY() + 1.00000f * sharpFrame.Height)); sharpSymbolPath.AddCurveToPoint(new CGPoint(sharpFrame.GetMinX() + 0.20000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.80000f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.20000f * sharpFrame.Width, sharpFrame.GetMinY() + 1.00000f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.20000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.91755f * sharpFrame.Height)); sharpSymbolPath.AddLineTo(new CGPoint(sharpFrame.GetMinX() + 0.00000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.80000f * sharpFrame.Height)); sharpSymbolPath.AddLineTo(new CGPoint(sharpFrame.GetMinX() + 0.00000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.60000f * sharpFrame.Height)); sharpSymbolPath.AddLineTo(new CGPoint(sharpFrame.GetMinX() + 0.20000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.60000f * sharpFrame.Height)); sharpSymbolPath.AddCurveToPoint(new CGPoint(sharpFrame.GetMinX() + 0.20000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.40000f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.20000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.53414f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.20000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.46586f * sharpFrame.Height)); sharpSymbolPath.AddLineTo(new CGPoint(sharpFrame.GetMinX() + 0.00000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.40000f * sharpFrame.Height)); sharpSymbolPath.AddLineTo(new CGPoint(sharpFrame.GetMinX() + 0.00000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.20000f * sharpFrame.Height)); sharpSymbolPath.AddLineTo(new CGPoint(sharpFrame.GetMinX() + 0.20000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.20000f * sharpFrame.Height)); sharpSymbolPath.AddCurveToPoint(new CGPoint(sharpFrame.GetMinX() + 0.20000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.00000f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.20000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.08245f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.20000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.00000f * sharpFrame.Height)); sharpSymbolPath.AddLineTo(new CGPoint(sharpFrame.GetMinX() + 0.40000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.00000f * sharpFrame.Height)); sharpSymbolPath.AddCurveToPoint(new CGPoint(sharpFrame.GetMinX() + 0.40000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.20000f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.40000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.00000f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.40000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.08245f * sharpFrame.Height)); sharpSymbolPath.AddLineTo(new CGPoint(sharpFrame.GetMinX() + 0.60000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.20000f * sharpFrame.Height)); sharpSymbolPath.AddCurveToPoint(new CGPoint(sharpFrame.GetMinX() + 0.60000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.00000f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.60000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.08245f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.60000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.00000f * sharpFrame.Height)); sharpSymbolPath.AddLineTo(new CGPoint(sharpFrame.GetMinX() + 0.80000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.00000f * sharpFrame.Height)); sharpSymbolPath.AddLineTo(new CGPoint(sharpFrame.GetMinX() + 0.80000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.00002f * sharpFrame.Height)); sharpSymbolPath.ClosePath(); sharpSymbolPath.MoveTo(new CGPoint(sharpFrame.GetMinX() + 0.60000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.40000f * sharpFrame.Height)); sharpSymbolPath.AddLineTo(new CGPoint(sharpFrame.GetMinX() + 0.40000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.40000f * sharpFrame.Height)); sharpSymbolPath.AddCurveToPoint(new CGPoint(sharpFrame.GetMinX() + 0.40000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.60000f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.40000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.46586f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.40000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.53414f * sharpFrame.Height)); sharpSymbolPath.AddLineTo(new CGPoint(sharpFrame.GetMinX() + 0.60000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.60000f * sharpFrame.Height)); sharpSymbolPath.AddCurveToPoint(new CGPoint(sharpFrame.GetMinX() + 0.60000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.40000f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.60000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.53414f * sharpFrame.Height), new CGPoint(sharpFrame.GetMinX() + 0.60000f * sharpFrame.Width, sharpFrame.GetMinY() + 0.46586f * sharpFrame.Height)); sharpSymbolPath.ClosePath(); fillColor.SetFill(); sharpSymbolPath.Fill(); }
static void paintCodeRetina() { //// Color Declarations UIColor color = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(19.88f, 4.59f)); bezier2Path.AddCurveToPoint(new PointF(28.6f, 6.25f), new PointF(22.84f, 4.27f), new PointF(25.87f, 4.82f)); bezier2Path.AddLineTo(new PointF(30.02f, 5.82f)); bezier2Path.AddLineTo(new PointF(31.53f, 3.5f)); bezier2Path.AddLineTo(new PointF(33.04f, 5.82f)); bezier2Path.AddLineTo(new PointF(35.61f, 6.61f)); bezier2Path.AddLineTo(new PointF(33.97f, 8.83f)); bezier2Path.AddLineTo(new PointF(34.03f, 10.88f)); bezier2Path.AddCurveToPoint(new PointF(35.44f, 13.03f), new PointF(34.55f, 11.56f), new PointF(35.02f, 12.28f)); bezier2Path.AddLineTo(new PointF(36.77f, 11.5f)); bezier2Path.AddLineTo(new PointF(38.79f, 13.82f)); bezier2Path.AddLineTo(new PointF(42.21f, 14.61f)); bezier2Path.AddLineTo(new PointF(40.03f, 16.83f)); bezier2Path.AddLineTo(new PointF(40.13f, 19.64f)); bezier2Path.AddLineTo(new PointF(37.47f, 18.9f)); bezier2Path.AddCurveToPoint(new PointF(36.87f, 27.6f), new PointF(37.95f, 21.79f), new PointF(37.75f, 24.79f)); bezier2Path.AddLineTo(new PointF(39.42f, 28.65f)); bezier2Path.AddLineTo(new PointF(37.79f, 31.61f)); bezier2Path.AddLineTo(new PointF(37.86f, 35.35f)); bezier2Path.AddLineTo(new PointF(35.34f, 34.1f)); bezier2Path.AddLineTo(new PointF(32.82f, 35.35f)); bezier2Path.AddLineTo(new PointF(32.84f, 34.53f)); bezier2Path.AddCurveToPoint(new PointF(30.74f, 36.39f), new PointF(32.18f, 35.22f), new PointF(31.48f, 35.84f)); bezier2Path.AddLineTo(new PointF(30.8f, 36.56f)); bezier2Path.AddLineTo(new PointF(32.79f, 37.26f)); bezier2Path.AddLineTo(new PointF(31.53f, 39.24f)); bezier2Path.AddLineTo(new PointF(31.58f, 41.74f)); bezier2Path.AddLineTo(new PointF(29.62f, 40.9f)); bezier2Path.AddLineTo(new PointF(27.66f, 41.74f)); bezier2Path.AddLineTo(new PointF(27.72f, 39.24f)); bezier2Path.AddLineTo(new PointF(27.18f, 38.4f)); bezier2Path.AddCurveToPoint(new PointF(21.39f, 39.5f), new PointF(25.32f, 39.15f), new PointF(23.36f, 39.52f)); bezier2Path.AddLineTo(new PointF(21.46f, 42.45f)); bezier2Path.AddLineTo(new PointF(18.66f, 41.3f)); bezier2Path.AddLineTo(new PointF(15.86f, 42.45f)); bezier2Path.AddLineTo(new PointF(15.95f, 39.02f)); bezier2Path.AddLineTo(new PointF(15.41f, 38.21f)); bezier2Path.AddCurveToPoint(new PointF(10.07f, 34.37f), new PointF(13.46f, 37.35f), new PointF(11.64f, 36.08f)); bezier2Path.AddLineTo(new PointF(10.01f, 34.31f)); bezier2Path.AddLineTo(new PointF(10.03f, 35.35f)); bezier2Path.AddLineTo(new PointF(7.23f, 34.1f)); bezier2Path.AddLineTo(new PointF(4.43f, 35.35f)); bezier2Path.AddLineTo(new PointF(4.51f, 31.61f)); bezier2Path.AddLineTo(new PointF(2.7f, 28.65f)); bezier2Path.AddLineTo(new PointF(5.55f, 27.59f)); bezier2Path.AddLineTo(new PointF(5.95f, 26.84f)); bezier2Path.AddCurveToPoint(new PointF(5.33f, 22.44f), new PointF(5.57f, 25.41f), new PointF(5.36f, 23.92f)); bezier2Path.AddLineTo(new PointF(3.67f, 22.83f)); bezier2Path.AddLineTo(new PointF(3.76f, 20.65f)); bezier2Path.AddLineTo(new PointF(1.77f, 18.92f)); bezier2Path.AddLineTo(new PointF(4.91f, 18.3f)); bezier2Path.AddLineTo(new PointF(5.9f, 17.33f)); bezier2Path.AddLineTo(new PointF(5.58f, 17.45f)); bezier2Path.AddLineTo(new PointF(5.67f, 14.02f)); bezier2Path.AddLineTo(new PointF(3.67f, 11.3f)); bezier2Path.AddLineTo(new PointF(6.81f, 10.33f)); bezier2Path.AddLineTo(new PointF(8.66f, 7.5f)); bezier2Path.AddLineTo(new PointF(10.06f, 9.64f)); bezier2Path.AddCurveToPoint(new PointF(12.57f, 7.41f), new PointF(10.85f, 8.79f), new PointF(11.68f, 8.05f)); bezier2Path.AddLineTo(new PointF(12.23f, 5.99f)); bezier2Path.AddLineTo(new PointF(16.76f, 1.5f)); bezier2Path.AddLineTo(new PointF(19.88f, 4.59f)); bezier2Path.ClosePath(); bezier2Path.MoveTo(new PointF(14.79f, 15.14f)); bezier2Path.AddCurveToPoint(new PointF(14.79f, 27.86f), new PointF(11.06f, 18.65f), new PointF(11.06f, 24.35f)); bezier2Path.AddCurveToPoint(new PointF(28.26f, 27.86f), new PointF(18.51f, 31.38f), new PointF(24.54f, 31.38f)); bezier2Path.AddCurveToPoint(new PointF(28.26f, 15.14f), new PointF(31.98f, 24.35f), new PointF(31.98f, 18.65f)); bezier2Path.AddCurveToPoint(new PointF(14.79f, 15.14f), new PointF(24.54f, 11.62f), new PointF(18.51f, 11.62f)); bezier2Path.ClosePath(); color.SetFill(); bezier2Path.Fill(); UIColor.Black.SetStroke(); bezier2Path.LineWidth = 1; bezier2Path.Stroke(); }
static void paintCodeRetina() { //// Color Declarations UIColor color = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); UIColor color2 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 0.000f); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(33.51f, 2.63f)); bezierPath.AddLineTo(new PointF(13.55f, 26.55f)); bezierPath.AddCurveToPoint(new PointF(24.53f, 7.67f), new PointF(13.55f, 26.55f), new PointF(19.54f, 13.65f)); bezierPath.AddCurveToPoint(new PointF(33.51f, 2.63f), new PointF(29.52f, 1.69f), new PointF(33.51f, 2.63f)); color.SetFill(); bezierPath.Fill(); UIColor.Black.SetStroke(); bezierPath.LineWidth = 1; bezierPath.Stroke(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(14.55f, 27.81f)); bezier2Path.AddCurveToPoint(new PointF(40.5f, 11.44f), new PointF(14.55f, 27.81f), new PointF(40.56f, 11.03f)); bezier2Path.AddCurveToPoint(new PointF(37.51f, 16.48f), new PointF(40.45f, 11.85f), new PointF(42.73f, 11.33f)); bezier2Path.AddCurveToPoint(new PointF(14.55f, 27.81f), new PointF(32.28f, 21.62f), new PointF(14.55f, 27.81f)); bezier2Path.ClosePath(); color.SetFill(); bezier2Path.Fill(); UIColor.Black.SetStroke(); bezier2Path.LineWidth = 1; bezier2Path.Stroke(); //// Oval 2 Drawing var oval2Path = UIBezierPath.FromOval(new RectangleF(9.5f, 27.5f, 9, 12)); color2.SetFill(); oval2Path.Fill(); UIColor.Black.SetStroke(); oval2Path.LineWidth = 2; oval2Path.Stroke(); //// Oval Drawing var ovalPath = UIBezierPath.FromOval(new RectangleF(3.5f, 19.5f, 10, 12)); color2.SetFill(); ovalPath.Fill(); UIColor.Black.SetStroke(); ovalPath.LineWidth = 2; ovalPath.Stroke(); }
static void paintCodeNonRetina() { //// Color Declarations UIColor color = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(10.03f, 2.93f)); bezier2Path.AddCurveToPoint(new PointF(14, 3.7f), new PointF(11.38f, 2.78f), new PointF(12.76f, 3.04f)); bezier2Path.AddLineTo(new PointF(14.65f, 3.5f)); bezier2Path.AddLineTo(new PointF(15.34f, 2.43f)); bezier2Path.AddLineTo(new PointF(16.03f, 3.5f)); bezier2Path.AddLineTo(new PointF(17.2f, 3.86f)); bezier2Path.AddLineTo(new PointF(16.45f, 4.89f)); bezier2Path.AddLineTo(new PointF(16.48f, 5.84f)); bezier2Path.AddCurveToPoint(new PointF(17.12f, 6.84f), new PointF(16.72f, 6.16f), new PointF(16.93f, 6.49f)); bezier2Path.AddLineTo(new PointF(17.73f, 6.13f)); bezier2Path.AddLineTo(new PointF(18.65f, 7.2f)); bezier2Path.AddLineTo(new PointF(20.21f, 7.57f)); bezier2Path.AddLineTo(new PointF(19.21f, 8.6f)); bezier2Path.AddLineTo(new PointF(19.26f, 9.89f)); bezier2Path.AddLineTo(new PointF(18.04f, 9.55f)); bezier2Path.AddCurveToPoint(new PointF(17.78f, 13.58f), new PointF(18.26f, 10.89f), new PointF(18.17f, 12.28f)); bezier2Path.AddLineTo(new PointF(18.93f, 14.06f)); bezier2Path.AddLineTo(new PointF(18.19f, 15.43f)); bezier2Path.AddLineTo(new PointF(18.22f, 17.17f)); bezier2Path.AddLineTo(new PointF(17.08f, 16.59f)); bezier2Path.AddLineTo(new PointF(15.93f, 17.17f)); bezier2Path.AddLineTo(new PointF(15.93f, 16.78f)); bezier2Path.AddCurveToPoint(new PointF(14.98f, 17.65f), new PointF(15.63f, 17.1f), new PointF(15.31f, 17.39f)); bezier2Path.AddLineTo(new PointF(15.01f, 17.72f)); bezier2Path.AddLineTo(new PointF(15.91f, 18.05f)); bezier2Path.AddLineTo(new PointF(15.34f, 18.97f)); bezier2Path.AddLineTo(new PointF(15.36f, 20.12f)); bezier2Path.AddLineTo(new PointF(14.47f, 19.73f)); bezier2Path.AddLineTo(new PointF(13.57f, 20.12f)); bezier2Path.AddLineTo(new PointF(13.6f, 18.97f)); bezier2Path.AddLineTo(new PointF(13.36f, 18.58f)); bezier2Path.AddCurveToPoint(new PointF(10.72f, 19.08f), new PointF(12.51f, 18.92f), new PointF(11.61f, 19.09f)); bezier2Path.AddLineTo(new PointF(10.75f, 20.45f)); bezier2Path.AddLineTo(new PointF(9.47f, 19.92f)); bezier2Path.AddLineTo(new PointF(8.2f, 20.45f)); bezier2Path.AddLineTo(new PointF(8.23f, 18.86f)); bezier2Path.AddLineTo(new PointF(7.99f, 18.49f)); bezier2Path.AddCurveToPoint(new PointF(5.55f, 16.71f), new PointF(7.1f, 18.09f), new PointF(6.27f, 17.5f)); bezier2Path.AddLineTo(new PointF(5.53f, 16.68f)); bezier2Path.AddLineTo(new PointF(5.54f, 17.17f)); bezier2Path.AddLineTo(new PointF(4.26f, 16.59f)); bezier2Path.AddLineTo(new PointF(2.98f, 17.17f)); bezier2Path.AddLineTo(new PointF(3.02f, 15.43f)); bezier2Path.AddLineTo(new PointF(2.19f, 14.06f)); bezier2Path.AddLineTo(new PointF(3.49f, 13.57f)); bezier2Path.AddLineTo(new PointF(3.68f, 13.23f)); bezier2Path.AddCurveToPoint(new PointF(3.39f, 11.19f), new PointF(3.5f, 12.56f), new PointF(3.41f, 11.88f)); bezier2Path.AddLineTo(new PointF(2.64f, 11.37f)); bezier2Path.AddLineTo(new PointF(2.68f, 10.36f)); bezier2Path.AddLineTo(new PointF(1.77f, 9.56f)); bezier2Path.AddLineTo(new PointF(3.2f, 9.27f)); bezier2Path.AddLineTo(new PointF(3.65f, 8.82f)); bezier2Path.AddLineTo(new PointF(3.51f, 8.88f)); bezier2Path.AddLineTo(new PointF(3.55f, 7.29f)); bezier2Path.AddLineTo(new PointF(2.64f, 6.04f)); bezier2Path.AddLineTo(new PointF(4.07f, 5.59f)); bezier2Path.AddLineTo(new PointF(4.91f, 4.28f)); bezier2Path.AddLineTo(new PointF(5.55f, 5.27f)); bezier2Path.AddCurveToPoint(new PointF(6.69f, 4.24f), new PointF(5.91f, 4.87f), new PointF(6.29f, 4.53f)); bezier2Path.AddLineTo(new PointF(6.54f, 3.58f)); bezier2Path.AddLineTo(new PointF(8.6f, 1.5f)); bezier2Path.AddLineTo(new PointF(10.03f, 2.93f)); bezier2Path.ClosePath(); bezier2Path.MoveTo(new PointF(7.7f, 7.81f)); bezier2Path.AddCurveToPoint(new PointF(7.7f, 13.7f), new PointF(6.01f, 9.44f), new PointF(6.01f, 12.07f)); bezier2Path.AddCurveToPoint(new PointF(13.85f, 13.7f), new PointF(9.4f, 15.33f), new PointF(12.15f, 15.33f)); bezier2Path.AddCurveToPoint(new PointF(13.85f, 7.81f), new PointF(15.54f, 12.07f), new PointF(15.54f, 9.44f)); bezier2Path.AddCurveToPoint(new PointF(7.7f, 7.81f), new PointF(12.15f, 6.18f), new PointF(9.4f, 6.18f)); bezier2Path.ClosePath(); color.SetFill(); bezier2Path.Fill(); UIColor.Black.SetStroke(); bezier2Path.LineWidth = 1; bezier2Path.Stroke(); }
void DrawFilledShape() { var bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(41.35f, 17.47f)); bezierPath.AddLineTo(new PointF(39.61f, 17.47f)); bezierPath.AddCurveToPoint(new PointF(36.99f, 14.79f), new PointF(38.18f, 17.47f), new PointF(36.99f, 16.24f)); bezierPath.AddCurveToPoint(new PointF(37.85f, 12.9f), new PointF(36.99f, 14.06f), new PointF(37.3f, 13.39f)); bezierPath.AddLineTo(new PointF(38.98f, 11.8f)); bezierPath.AddCurveToPoint(new PointF(38.98f, 7.8f), new PointF(40.09f, 10.7f), new PointF(40.09f, 8.9f)); bezierPath.AddLineTo(new PointF(36.42f, 5.27f)); bezierPath.AddCurveToPoint(new PointF(34.41f, 4.47f), new PointF(35.91f, 4.77f), new PointF(35.17f, 4.47f)); bezierPath.AddCurveToPoint(new PointF(32.4f, 5.27f), new PointF(33.65f, 4.47f), new PointF(32.92f, 4.77f)); bezierPath.AddLineTo(new PointF(31.33f, 6.35f)); bezierPath.AddCurveToPoint(new PointF(29.38f, 7.23f), new PointF(30.81f, 6.92f), new PointF(30.12f, 7.23f)); bezierPath.AddCurveToPoint(new PointF(26.68f, 4.63f), new PointF(27.91f, 7.23f), new PointF(26.68f, 6.04f)); bezierPath.AddLineTo(new PointF(26.68f, 2.88f)); bezierPath.AddCurveToPoint(new PointF(23.86f, 0), new PointF(26.68f, 1.33f), new PointF(25.42f, 0)); bezierPath.AddLineTo(new PointF(20.38f, 0)); bezierPath.AddCurveToPoint(new PointF(17.58f, 2.88f), new PointF(18.82f, 0), new PointF(17.58f, 1.32f)); bezierPath.AddLineTo(new PointF(17.58f, 4.62f)); bezierPath.AddCurveToPoint(new PointF(14.89f, 7.22f), new PointF(17.58f, 6.03f), new PointF(16.36f, 7.22f)); bezierPath.AddCurveToPoint(new PointF(12.98f, 6.37f), new PointF(14.15f, 7.22f), new PointF(13.48f, 6.91f)); bezierPath.AddLineTo(new PointF(11.87f, 5.27f)); bezierPath.AddCurveToPoint(new PointF(9.86f, 4.47f), new PointF(11.37f, 4.75f), new PointF(10.62f, 4.47f)); bezierPath.AddCurveToPoint(new PointF(7.86f, 5.27f), new PointF(9.11f, 4.47f), new PointF(8.37f, 4.77f)); bezierPath.AddLineTo(new PointF(5.28f, 7.79f)); bezierPath.AddCurveToPoint(new PointF(5.28f, 11.78f), new PointF(4.18f, 8.89f), new PointF(4.18f, 10.69f)); bezierPath.AddLineTo(new PointF(6.35f, 12.85f)); bezierPath.AddCurveToPoint(new PointF(7.25f, 14.79f), new PointF(6.93f, 13.37f), new PointF(7.25f, 14.06f)); bezierPath.AddCurveToPoint(new PointF(4.63f, 17.47f), new PointF(7.25f, 16.26f), new PointF(6.06f, 17.47f)); bezierPath.AddLineTo(new PointF(2.89f, 17.47f)); bezierPath.AddCurveToPoint(new PointF(0, 20.25f), new PointF(1.32f, 17.47f), new PointF(0, 18.7f)); bezierPath.AddLineTo(new PointF(0, 21.99f)); bezierPath.AddLineTo(new PointF(0, 23.74f)); bezierPath.AddCurveToPoint(new PointF(2.89f, 26.52f), new PointF(0, 25.28f), new PointF(1.32f, 26.52f)); bezierPath.AddLineTo(new PointF(4.63f, 26.52f)); bezierPath.AddCurveToPoint(new PointF(7.25f, 29.2f), new PointF(6.06f, 26.52f), new PointF(7.25f, 27.74f)); bezierPath.AddCurveToPoint(new PointF(6.35f, 31.14f), new PointF(7.25f, 29.93f), new PointF(6.93f, 30.62f)); bezierPath.AddLineTo(new PointF(5.28f, 32.2f)); bezierPath.AddCurveToPoint(new PointF(5.28f, 36.19f), new PointF(4.18f, 33.3f), new PointF(4.18f, 35.1f)); bezierPath.AddLineTo(new PointF(7.83f, 38.73f)); bezierPath.AddCurveToPoint(new PointF(9.84f, 39.53f), new PointF(8.34f, 39.25f), new PointF(9.08f, 39.53f)); bezierPath.AddCurveToPoint(new PointF(11.85f, 38.73f), new PointF(10.6f, 39.53f), new PointF(11.33f, 39.23f)); bezierPath.AddLineTo(new PointF(12.96f, 37.63f)); bezierPath.AddCurveToPoint(new PointF(14.87f, 36.78f), new PointF(13.44f, 37.09f), new PointF(14.13f, 36.78f)); bezierPath.AddCurveToPoint(new PointF(17.56f, 39.38f), new PointF(16.33f, 36.78f), new PointF(17.56f, 37.97f)); bezierPath.AddLineTo(new PointF(17.56f, 41.12f)); bezierPath.AddCurveToPoint(new PointF(20.37f, 44), new PointF(17.56f, 42.67f), new PointF(18.8f, 44)); bezierPath.AddLineTo(new PointF(23.86f, 44)); bezierPath.AddCurveToPoint(new PointF(26.66f, 41.12f), new PointF(25.42f, 44), new PointF(26.66f, 42.68f)); bezierPath.AddLineTo(new PointF(26.66f, 39.38f)); bezierPath.AddCurveToPoint(new PointF(29.35f, 36.78f), new PointF(26.66f, 37.97f), new PointF(27.88f, 36.78f)); bezierPath.AddCurveToPoint(new PointF(31.3f, 37.67f), new PointF(30.09f, 36.78f), new PointF(30.77f, 37.1f)); bezierPath.AddLineTo(new PointF(32.38f, 38.74f)); bezierPath.AddCurveToPoint(new PointF(34.39f, 39.54f), new PointF(32.9f, 39.25f), new PointF(33.63f, 39.54f)); bezierPath.AddCurveToPoint(new PointF(36.39f, 38.74f), new PointF(35.14f, 39.54f), new PointF(35.88f, 39.25f)); bezierPath.AddLineTo(new PointF(38.95f, 36.2f)); bezierPath.AddCurveToPoint(new PointF(38.95f, 32.2f), new PointF(40.05f, 35.1f), new PointF(40.05f, 33.3f)); bezierPath.AddLineTo(new PointF(37.83f, 31.1f)); bezierPath.AddCurveToPoint(new PointF(36.97f, 29.21f), new PointF(37.28f, 30.61f), new PointF(36.97f, 29.93f)); bezierPath.AddCurveToPoint(new PointF(39.58f, 26.53f), new PointF(36.97f, 27.74f), new PointF(38.16f, 26.53f)); bezierPath.AddLineTo(new PointF(41.33f, 26.53f)); bezierPath.AddCurveToPoint(new PointF(44, 23.75f), new PointF(42.89f, 26.53f), new PointF(44, 25.3f)); bezierPath.AddLineTo(new PointF(44, 21.99f)); bezierPath.AddLineTo(new PointF(44, 20.25f)); bezierPath.AddCurveToPoint(new PointF(41.35f, 17.47f), new PointF(44.02f, 18.7f), new PointF(42.91f, 17.47f)); bezierPath.ClosePath(); bezierPath.MoveTo(new PointF(31.29f, 21.99f)); bezierPath.AddLineTo(new PointF(31.29f, 21.99f)); bezierPath.AddCurveToPoint(new PointF(22.11f, 31.16f), new PointF(31.29f, 27.05f), new PointF(27.2f, 31.16f)); bezierPath.AddCurveToPoint(new PointF(12.94f, 21.99f), new PointF(17.03f, 31.16f), new PointF(12.94f, 27.05f)); bezierPath.AddLineTo(new PointF(12.94f, 21.99f)); bezierPath.AddLineTo(new PointF(12.94f, 21.99f)); bezierPath.AddCurveToPoint(new PointF(22.11f, 12.83f), new PointF(12.94f, 16.94f), new PointF(17.03f, 12.83f)); bezierPath.AddCurveToPoint(new PointF(31.29f, 21.99f), new PointF(27.2f, 12.83f), new PointF(31.29f, 16.94f)); bezierPath.AddLineTo(new PointF(31.29f, 21.99f)); bezierPath.ClosePath(); bezierPath.MiterLimit = 4; DefaultFillColor.SetColor (); bezierPath.Fill (); }
public override void TouchesMoved (MonoTouch.Foundation.NSSet touches, UIEvent evt) { if (!Enabled) return; Editing = true; var touch = touches.AnyObject as UITouch; var p = touch.LocationInView (this); ctr++; pts [ctr] = p; if (ctr == 4) { pts[3] = new PointF((pts[2].X + pts[4].X)/2.0f, (pts[2].Y + pts[4].Y)/2.0f); // move the endpoint to the middle of the line joining the second control point of the first Bezier segment and the first control point of the second Bezier segment var path = new UIBezierPath (); path.LineWidth = lineThickness; path.MoveTo(pts[0]); path.AddCurveToPoint(pts[3], pts[1], pts[2]); // add a cubic Bezier from pt[0] to pt[3], with control points pt[1] and pt[2] paths.Last().Add (path); this.SetNeedsDisplay(); // replace points and get ready to handle the next segment pts[0] = pts[3]; pts[1] = pts[4]; ctr = 1; } }
public override void Draw(RectangleF rect) { base.Draw(rect); // ------------- START PAINTCODE ---------------- //// General Declarations var colorSpace = CGColorSpace.CreateDeviceRGB(); var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor gold = UIColor.FromRGBA(1.00f, 0.95f, 0.57f, 1.00f); UIColor brown = UIColor.FromRGBA(0.79f, 0.75f, 0.18f, 1.00f); UIColor lightBrown = UIColor.FromRGBA(0.69f, 0.57f, 0.23f, 1.00f); UIColor darkishBlue = UIColor.FromRGBA(0.20f, 0.39f, 0.98f, 1.00f); UIColor bottomColorDown = UIColor.FromRGBA(0.21f, 0.21f, 0.21f, 1.00f); //// Gradient Declarations var newGradientColors = new CGColor [] { UIColor.Black.CGColor, UIColor.White.CGColor }; var newGradientLocations = new float [] { 0, 1 }; var newGradient = new CGGradient(colorSpace, newGradientColors, newGradientLocations); var calendarGradientColors = new CGColor [] { UIColor.DarkGray.CGColor, UIColor.FromRGBA(0.72f, 0.72f, 0.72f, 1.00f).CGColor, UIColor.White.CGColor }; var calendarGradientLocations = new float [] { 0, 0.26f, 0.26f }; var calendarGradient = new CGGradient(colorSpace, calendarGradientColors, calendarGradientLocations); //// Shadow Declarations var shadow = UIColor.DarkGray.CGColor; var shadowOffset = new SizeF(2, 2); var shadowBlurRadius = 2; //// Abstracted Graphic Attributes var monthContent = "MAR"; var dayContent = "24"; var dayFont = UIFont.FromName("Helvetica-Bold", 24); var textContent = "News Headline"; //// Oval 11 Drawing var oval11Path = UIBezierPath.FromOval(new RectangleF(256.5f, 46.5f, 13, 14)); lightBrown.SetFill(); oval11Path.Fill(); UIColor.Black.SetStroke(); oval11Path.LineWidth = 1; oval11Path.Stroke(); //// Oval 12 Drawing var oval12Path = UIBezierPath.FromOval(new RectangleF(280.5f, 46.5f, 13, 14)); lightBrown.SetFill(); oval12Path.Fill(); UIColor.Black.SetStroke(); oval12Path.LineWidth = 1; oval12Path.Stroke(); //// Rounded Rectangle Drawing var roundedRectanglePath = UIBezierPath.FromRoundedRect(new RectangleF(8.5f, 60.5f, 37, 36), 4); context.SaveState(); context.SetShadowWithColor(shadowOffset, shadowBlurRadius, shadow); context.BeginTransparencyLayer(null); roundedRectanglePath.AddClip(); context.DrawLinearGradient(calendarGradient, new PointF(27, 96.5f), new PointF(27, 60.5f), 0); context.EndTransparencyLayer(); context.RestoreState(); UIColor.DarkGray.SetStroke(); roundedRectanglePath.LineWidth = 1; roundedRectanglePath.Stroke(); //// Rounded Rectangle 3 Drawing UIBezierPath roundedRectangle3Path = new UIBezierPath(); roundedRectangle3Path.MoveTo(new PointF(9, 91.2f)); roundedRectangle3Path.AddCurveToPoint(new PointF(12.56f, 95), new PointF(9, 93.3f), new PointF(10.32f, 95)); roundedRectangle3Path.AddLineTo(new PointF(40.94f, 95)); roundedRectangle3Path.AddCurveToPoint(new PointF(45, 91.2f), new PointF(43.18f, 95), new PointF(45, 93.3f)); roundedRectangle3Path.AddLineTo(new PointF(45, 87)); roundedRectangle3Path.AddCurveToPoint(new PointF(43.42f, 85.5f), new PointF(45, 84.9f), new PointF(45.66f, 85.5f)); roundedRectangle3Path.AddLineTo(new PointF(10.94f, 85.5f)); roundedRectangle3Path.AddCurveToPoint(new PointF(9, 87), new PointF(8.7f, 85.5f), new PointF(9, 84.9f)); roundedRectangle3Path.AddLineTo(new PointF(9, 91.2f)); roundedRectangle3Path.ClosePath(); UIColor.Red.SetFill(); roundedRectangle3Path.Fill(); //// Month Drawing var monthRect = new RectangleF(10, 84, 34, 15); UIColor.White.SetFill(); new NSString(monthContent).DrawString( monthRect, UIFont.FromName("Helvetica-Bold", 9), UILineBreakMode.WordWrap, UITextAlignment.Center ); //// Day Drawing var dayRect = new RectangleF(0, 58, 54, 31); UIColor.Black.SetFill(); new NSString(dayContent).DrawString(dayRect, dayFont, UILineBreakMode.WordWrap, UITextAlignment.Center); //// Text Drawing var textRect = new RectangleF(54, 60, 75, 38); UIColor.Black.SetFill(); new NSString(textContent).DrawString( textRect, UIFont.FromName("Helvetica", 16), UILineBreakMode.WordWrap, UITextAlignment.Left ); //// Star Drawing UIBezierPath starPath = new UIBezierPath(); starPath.MoveTo(new PointF(31, 14.5f)); starPath.AddLineTo(new PointF(26.24f, 21.45f)); starPath.AddLineTo(new PointF(18.16f, 23.83f)); starPath.AddLineTo(new PointF(23.3f, 30.5f)); starPath.AddLineTo(new PointF(23.06f, 38.92f)); starPath.AddLineTo(new PointF(31, 36.1f)); starPath.AddLineTo(new PointF(38.94f, 38.92f)); starPath.AddLineTo(new PointF(38.7f, 30.5f)); starPath.AddLineTo(new PointF(43.84f, 23.83f)); starPath.AddLineTo(new PointF(35.76f, 21.45f)); starPath.ClosePath(); gold.SetFill(); starPath.Fill(); brown.SetStroke(); starPath.LineWidth = 1; starPath.Stroke(); //// Blue blob Drawing UIBezierPath blueBlobPath = new UIBezierPath(); blueBlobPath.MoveTo(new PointF(256.5f, 16.5f)); blueBlobPath.AddCurveToPoint(new PointF(240.5f, 41.5f), new PointF(235.5f, 37.5f), new PointF(217.53f, 41.55f)); blueBlobPath.AddCurveToPoint(new PointF(265.5f, 30.5f), new PointF(263.47f, 41.45f), new PointF(265.5f, 30.5f)); blueBlobPath.AddCurveToPoint(new PointF(256.5f, 16.5f), new PointF(265.5f, 30.5f), new PointF(277.5f, -4.5f)); blueBlobPath.ClosePath(); blueBlobPath.MiterLimit = 2; blueBlobPath.LineJoinStyle = CGLineJoin.Round; darkishBlue.SetFill(); blueBlobPath.Fill(); bottomColorDown.SetStroke(); blueBlobPath.LineWidth = 1; blueBlobPath.Stroke(); //// Button Drawing var buttonPath = UIBezierPath.FromRoundedRect(new RectangleF(54.5f, 10.5f, 163, 31), 4); context.SaveState(); buttonPath.AddClip(); context.DrawRadialGradient(newGradient, new PointF(100.39f, 55.13f), 7.84f, new PointF(136, 26), 86.67f, CGGradientDrawingOptions.DrawsBeforeStartLocation | CGGradientDrawingOptions.DrawsAfterEndLocation); context.RestoreState(); UIColor.Black.SetStroke(); buttonPath.LineWidth = 1; buttonPath.Stroke(); //// Smiley face Drawing var smileyFacePath = UIBezierPath.FromOval(new RectangleF(159.5f, 49.5f, 47, 47)); gold.SetFill(); smileyFacePath.Fill(); UIColor.Black.SetStroke(); smileyFacePath.LineWidth = 1; smileyFacePath.Stroke(); //// Oval 2 Drawing var oval2Path = UIBezierPath.FromOval(new RectangleF(169.5f, 64.5f, 8, 8)); UIColor.Black.SetFill(); oval2Path.Fill(); UIColor.Black.SetStroke(); oval2Path.LineWidth = 1; oval2Path.Stroke(); //// Oval 3 Drawing var oval3Path = UIBezierPath.FromOval(new RectangleF(188.5f, 64.5f, 8, 8)); UIColor.Black.SetFill(); oval3Path.Fill(); UIColor.Black.SetStroke(); oval3Path.LineWidth = 1; oval3Path.Stroke(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(172.5f, 80.5f)); bezier2Path.AddCurveToPoint(new PointF(185.5f, 85.5f), new PointF(177.75f, 85), new PointF(182.04f, 86.03f)); bezier2Path.AddCurveToPoint(new PointF(194.5f, 79.5f), new PointF(191.27f, 84.62f), new PointF(194.5f, 79.5f)); UIColor.Black.SetStroke(); bezier2Path.LineWidth = 2; bezier2Path.Stroke(); //// Oval 5 Drawing var oval5Path = UIBezierPath.FromOval(new RectangleF(256.5f, 52.5f, 36, 33)); lightBrown.SetFill(); oval5Path.Fill(); UIColor.Black.SetStroke(); oval5Path.LineWidth = 1; oval5Path.Stroke(); //// Oval 6 Drawing var oval6Path = UIBezierPath.FromOval(new RectangleF(262.5f, 59.5f, 10, 19)); UIColor.White.SetFill(); oval6Path.Fill(); UIColor.Black.SetStroke(); oval6Path.LineWidth = 1; oval6Path.Stroke(); //// Oval 7 Drawing var oval7Path = UIBezierPath.FromOval(new RectangleF(275.5f, 59.5f, 10, 19)); UIColor.White.SetFill(); oval7Path.Fill(); UIColor.Black.SetStroke(); oval7Path.LineWidth = 1; oval7Path.Stroke(); //// Oval 9 Drawing var oval9Path = UIBezierPath.FromOval(new RectangleF(264.5f, 68.5f, 6, 5)); UIColor.Black.SetFill(); oval9Path.Fill(); UIColor.Black.SetStroke(); oval9Path.LineWidth = 1; oval9Path.Stroke(); //// Oval 10 Drawing var oval10Path = UIBezierPath.FromOval(new RectangleF(277.5f, 68.5f, 6, 5)); UIColor.Black.SetFill(); oval10Path.Fill(); UIColor.Black.SetStroke(); oval10Path.LineWidth = 1; oval10Path.Stroke(); //// Oval 4 Drawing var oval4Path = UIBezierPath.FromOval(new RectangleF(250.5f, 70.5f, 47, 24)); lightBrown.SetFill(); oval4Path.Fill(); UIColor.Black.SetStroke(); oval4Path.LineWidth = 1; oval4Path.Stroke(); //// Oval 8 Drawing var oval8Path = UIBezierPath.FromOval(new RectangleF(267.5f, 77.5f, 9, 4)); UIColor.Black.SetFill(); oval8Path.Fill(); UIColor.Black.SetStroke(); oval8Path.LineWidth = 1; oval8Path.Stroke(); //// Bezier 5 Drawing UIBezierPath bezier5Path = new UIBezierPath(); bezier5Path.MoveTo(new PointF(270.5f, 81.5f)); bezier5Path.AddCurveToPoint(new PointF(267.5f, 88.5f), new PointF(269.5f, 85.5f), new PointF(267.5f, 88.5f)); UIColor.Black.SetStroke(); bezier5Path.LineWidth = 1; bezier5Path.Stroke(); //// Bezier 6 Drawing UIBezierPath bezier6Path = new UIBezierPath(); bezier6Path.MoveTo(new PointF(272.5f, 81.5f)); bezier6Path.AddLineTo(new PointF(274.5f, 87.5f)); UIColor.Black.SetStroke(); bezier6Path.LineWidth = 1; bezier6Path.Stroke(); // ------------- END PAINTCODE ---------------- }
void DrawCrayon(CGContext context, Crayon crayon) { // I <3 Paintcode //// Color Declarations var gradientColor = UIColor.FromRGBA(crayon.R / 255f, crayon.G / 255f, crayon.B / 255f, 1.00f); var gradientColor2 = UIColor.FromRGBA(crayon.R / 255f, crayon.G / 255f, crayon.B / 255f, 0.69f); var gradientColor3 = UIColor.FromRGBA(crayon.R / 255f, crayon.G / 255f, crayon.B / 255f, 0.37f); //// Gradient Declarations var gradientColors = new CGColor [] { gradientColor.CGColor, gradientColor2.CGColor, gradientColor3.CGColor, gradientColor2.CGColor, gradientColor.CGColor }; var gradientLocations = new float [] {0, 0.37f, 0.66f, 1, 1}; var gradient = new CGGradient(colorSpace, gradientColors, gradientLocations); //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRoundedRect(new RectangleF(0.5f, 20.5f, 25, 100), UIRectCorner.TopLeft | UIRectCorner.TopRight, new SizeF(8, 8)); context.SaveState(); rectanglePath.AddClip(); context.DrawLinearGradient(gradient, new PointF(0.5f, 70.5f), new PointF(25.5f, 70.5f), 0); context.RestoreState(); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(3.5f, 24.5f)); bezierPath.AddCurveToPoint(new PointF(12, 0.09f), new PointF(6.5f, 17.57f), new PointF(9.79f, -4.27f)); bezierPath.AddCurveToPoint(new PointF(22.5f, 24.5f), new PointF(16.3f, 8.57f), new PointF(22.5f, 24.5f)); context.SaveState(); bezierPath.AddClip(); context.DrawLinearGradient(gradient, new PointF(3.5f, 12.01f), new PointF(22.5f, 12.01f), 0); context.RestoreState(); }
private void DrawCancelPictureButton(CGRect frame) { var color2 = UIColor.Red; var bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(frame.GetMinX() + 0.73928f * frame.Width, frame.GetMinY() + 0.14291f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.85711f * frame.Width, frame.GetMinY() + 0.26074f * frame.Height), new CGPoint(frame.GetMinX() + 0.73926f * frame.Width, frame.GetMinY() + 0.14289f * frame.Height), new CGPoint(frame.GetMinX() + 0.85711f * frame.Width, frame.GetMinY() + 0.26074f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.61785f * frame.Width, frame.GetMinY() + 0.50000f * frame.Height), new CGPoint(frame.GetMinX() + 0.85711f * frame.Width, frame.GetMinY() + 0.26074f * frame.Height), new CGPoint(frame.GetMinX() + 0.74457f * frame.Width, frame.GetMinY() + 0.37328f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.85355f * frame.Width, frame.GetMinY() + 0.73570f * frame.Height), new CGPoint(frame.GetMinX() + 0.74311f * frame.Width, frame.GetMinY() + 0.62526f * frame.Height), new CGPoint(frame.GetMinX() + 0.85355f * frame.Width, frame.GetMinY() + 0.73570f * frame.Height)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.73570f * frame.Width, frame.GetMinY() + 0.85355f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.50000f * frame.Width, frame.GetMinY() + 0.61785f * frame.Height), new CGPoint(frame.GetMinX() + 0.73570f * frame.Width, frame.GetMinY() + 0.85355f * frame.Height), new CGPoint(frame.GetMinX() + 0.62526f * frame.Width, frame.GetMinY() + 0.74311f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.26785f * frame.Width, frame.GetMinY() + 0.85000f * frame.Height), new CGPoint(frame.GetMinX() + 0.37621f * frame.Width, frame.GetMinY() + 0.74164f * frame.Height), new CGPoint(frame.GetMinX() + 0.26785f * frame.Width, frame.GetMinY() + 0.85000f * frame.Height)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.15000f * frame.Width, frame.GetMinY() + 0.73215f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.38215f * frame.Width, frame.GetMinY() + 0.50000f * frame.Height), new CGPoint(frame.GetMinX() + 0.15000f * frame.Width, frame.GetMinY() + 0.73215f * frame.Height), new CGPoint(frame.GetMinX() + 0.25836f * frame.Width, frame.GetMinY() + 0.62379f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.14645f * frame.Width, frame.GetMinY() + 0.26430f * frame.Height), new CGPoint(frame.GetMinX() + 0.25689f * frame.Width, frame.GetMinY() + 0.37474f * frame.Height), new CGPoint(frame.GetMinX() + 0.14645f * frame.Width, frame.GetMinY() + 0.26430f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.22060f * frame.Width, frame.GetMinY() + 0.19014f * frame.Height), new CGPoint(frame.GetMinX() + 0.14645f * frame.Width, frame.GetMinY() + 0.26430f * frame.Height), new CGPoint(frame.GetMinX() + 0.18706f * frame.Width, frame.GetMinY() + 0.22369f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.26430f * frame.Width, frame.GetMinY() + 0.14645f * frame.Height), new CGPoint(frame.GetMinX() + 0.24420f * frame.Width, frame.GetMinY() + 0.16655f * frame.Height), new CGPoint(frame.GetMinX() + 0.26430f * frame.Width, frame.GetMinY() + 0.14645f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.50000f * frame.Width, frame.GetMinY() + 0.38215f * frame.Height), new CGPoint(frame.GetMinX() + 0.26430f * frame.Width, frame.GetMinY() + 0.14645f * frame.Height), new CGPoint(frame.GetMinX() + 0.37474f * frame.Width, frame.GetMinY() + 0.25689f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.73926f * frame.Width, frame.GetMinY() + 0.14289f * frame.Height), new CGPoint(frame.GetMinX() + 0.62672f * frame.Width, frame.GetMinY() + 0.25543f * frame.Height), new CGPoint(frame.GetMinX() + 0.73926f * frame.Width, frame.GetMinY() + 0.14289f * frame.Height)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.73928f * frame.Width, frame.GetMinY() + 0.14291f * frame.Height)); bezierPath.ClosePath(); color2.SetFill(); bezierPath.Fill(); UIColor.Black.SetStroke(); bezierPath.LineWidth = 1.0f; bezierPath.Stroke(); }
static void paintCodeNonRetina() { //// Group { //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(3.41f, 1.03f)); bezierPath.AddCurveToPoint(new PointF(21.62f, 1.03f), new PointF(21.62f, 1.03f), new PointF(21.62f, 1.03f)); UIColor.Black.SetStroke(); bezierPath.LineWidth = 1; bezierPath.Stroke(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(3.41f, 5.16f)); bezier2Path.AddCurveToPoint(new PointF(21.62f, 5.16f), new PointF(21.62f, 5.16f), new PointF(21.62f, 5.16f)); UIColor.Black.SetStroke(); bezier2Path.LineWidth = 1; bezier2Path.Stroke(); //// Bezier 3 Drawing UIBezierPath bezier3Path = new UIBezierPath(); bezier3Path.MoveTo(new PointF(3.41f, 9.28f)); bezier3Path.AddCurveToPoint(new PointF(21.62f, 9.28f), new PointF(21.62f, 9.28f), new PointF(21.62f, 9.28f)); UIColor.Black.SetStroke(); bezier3Path.LineWidth = 1; bezier3Path.Stroke(); //// Bezier 4 Drawing UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new PointF(3.41f, 13.41f)); bezier4Path.AddCurveToPoint(new PointF(21.62f, 13.41f), new PointF(21.62f, 13.41f), new PointF(21.62f, 13.41f)); UIColor.Black.SetStroke(); bezier4Path.LineWidth = 1; bezier4Path.Stroke(); //// Bezier 5 Drawing UIBezierPath bezier5Path = new UIBezierPath(); bezier5Path.MoveTo(new PointF(3.41f, 16.84f)); bezier5Path.AddCurveToPoint(new PointF(21.62f, 16.84f), new PointF(4.16f, 16.84f), new PointF(21.62f, 16.84f)); UIColor.Black.SetStroke(); bezier5Path.LineWidth = 1; bezier5Path.Stroke(); //// Bezier 6 Drawing UIBezierPath bezier6Path = new UIBezierPath(); bezier6Path.MoveTo(new PointF(3.41f, 20.97f)); bezier6Path.AddCurveToPoint(new PointF(21.62f, 20.97f), new PointF(21.62f, 20.97f), new PointF(21.62f, 20.97f)); UIColor.Black.SetStroke(); bezier6Path.LineWidth = 1; bezier6Path.Stroke(); //// Oval Drawing var ovalPath = UIBezierPath.FromOval(new RectangleF(0.5f, 0.5f, 1, 1)); UIColor.Black.SetStroke(); ovalPath.LineWidth = 1; ovalPath.Stroke(); //// Oval 2 Drawing var oval2Path = UIBezierPath.FromOval(new RectangleF(0.5f, 4.5f, 1, 1)); UIColor.Black.SetStroke(); oval2Path.LineWidth = 1; oval2Path.Stroke(); //// Oval 3 Drawing var oval3Path = UIBezierPath.FromOval(new RectangleF(0.5f, 8.5f, 1, 1)); UIColor.Black.SetStroke(); oval3Path.LineWidth = 1; oval3Path.Stroke(); //// Oval 4 Drawing var oval4Path = UIBezierPath.FromOval(new RectangleF(0.5f, 12.5f, 1, 1)); UIColor.Black.SetStroke(); oval4Path.LineWidth = 1; oval4Path.Stroke(); //// Oval 5 Drawing var oval5Path = UIBezierPath.FromOval(new RectangleF(0.5f, 16.5f, 1, 1)); UIColor.Black.SetStroke(); oval5Path.LineWidth = 1; oval5Path.Stroke(); //// Oval 6 Drawing var oval6Path = UIBezierPath.FromOval(new RectangleF(0.5f, 20.5f, 1, 1)); UIColor.Black.SetStroke(); oval6Path.LineWidth = 1; oval6Path.Stroke(); } }
/// <summary> /// Uses core Graphic api to draw the baseballer icon. /// </summary> /// <param name="frame">The frame.</param> /// <param name="view">The view.</param> /// <param name="iconColor">The icon color.</param> public static void DrawBaseballer(CGRect frame, UIView view, UIColor iconColor) { using (CGColorSpace.CreateDeviceRGB()) { using (var context = UIGraphics.GetCurrentContext()) { var bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(frame.GetMinX() + 0.57998f * frame.Width, frame.GetMinY() + 0.27533f * frame.Height)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.57998f * frame.Width, frame.GetMinY() + 0.27533f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.55745f * frame.Width, frame.GetMinY() + 0.22078f * frame.Height), new CGPoint(frame.GetMinX() + 0.57998f * frame.Width, frame.GetMinY() + 0.27533f * frame.Height), new CGPoint(frame.GetMinX() + 0.57754f * frame.Width, frame.GetMinY() + 0.23055f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.51756f * frame.Width, frame.GetMinY() + 0.20938f * frame.Height), new CGPoint(frame.GetMinX() + 0.53737f * frame.Width, frame.GetMinY() + 0.21101f * frame.Height), new CGPoint(frame.GetMinX() + 0.53004f * frame.Width, frame.GetMinY() + 0.20938f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.46599f * frame.Width, frame.GetMinY() + 0.22322f * frame.Height), new CGPoint(frame.GetMinX() + 0.50534f * frame.Width, frame.GetMinY() + 0.20938f * frame.Height), new CGPoint(frame.GetMinX() + 0.47983f * frame.Width, frame.GetMinY() + 0.21074f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.44835f * frame.Width, frame.GetMinY() + 0.26311f * frame.Height), new CGPoint(frame.GetMinX() + 0.45215f * frame.Width, frame.GetMinY() + 0.23543f * frame.Height), new CGPoint(frame.GetMinX() + 0.44835f * frame.Width, frame.GetMinY() + 0.26311f * frame.Height)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.42881f * frame.Width, frame.GetMinY() + 0.27343f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.42772f * frame.Width, frame.GetMinY() + 0.29215f * frame.Height), new CGPoint(frame.GetMinX() + 0.42881f * frame.Width, frame.GetMinY() + 0.27343f * frame.Height), new CGPoint(frame.GetMinX() + 0.42582f * frame.Width, frame.GetMinY() + 0.27994f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.44238f * frame.Width, frame.GetMinY() + 0.31468f * frame.Height), new CGPoint(frame.GetMinX() + 0.42962f * frame.Width, frame.GetMinY() + 0.30436f * frame.Height), new CGPoint(frame.GetMinX() + 0.44238f * frame.Width, frame.GetMinY() + 0.31468f * frame.Height)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.45405f * frame.Width, frame.GetMinY() + 0.32146f * frame.Height)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.45350f * frame.Width, frame.GetMinY() + 0.32445f * frame.Height)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.45703f * frame.Width, frame.GetMinY() + 0.33340f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.43993f * frame.Width, frame.GetMinY() + 0.36542f * frame.Height), new CGPoint(frame.GetMinX() + 0.45703f * frame.Width, frame.GetMinY() + 0.33340f * frame.Height), new CGPoint(frame.GetMinX() + 0.44373f * frame.Width, frame.GetMinY() + 0.36000f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.43342f * frame.Width, frame.GetMinY() + 0.41102f * frame.Height), new CGPoint(frame.GetMinX() + 0.43613f * frame.Width, frame.GetMinY() + 0.37085f * frame.Height), new CGPoint(frame.GetMinX() + 0.43315f * frame.Width, frame.GetMinY() + 0.39039f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.46192f * frame.Width, frame.GetMinY() + 0.45634f * frame.Height), new CGPoint(frame.GetMinX() + 0.43396f * frame.Width, frame.GetMinY() + 0.43164f * frame.Height), new CGPoint(frame.GetMinX() + 0.45350f * frame.Width, frame.GetMinY() + 0.44982f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.46979f * frame.Width, frame.GetMinY() + 0.47316f * frame.Height), new CGPoint(frame.GetMinX() + 0.47033f * frame.Width, frame.GetMinY() + 0.46285f * frame.Height), new CGPoint(frame.GetMinX() + 0.46979f * frame.Width, frame.GetMinY() + 0.47316f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.46083f * frame.Width, frame.GetMinY() + 0.48402f * frame.Height), new CGPoint(frame.GetMinX() + 0.46979f * frame.Width, frame.GetMinY() + 0.47316f * frame.Height), new CGPoint(frame.GetMinX() + 0.46925f * frame.Width, frame.GetMinY() + 0.47805f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.45405f * frame.Width, frame.GetMinY() + 0.50111f * frame.Height), new CGPoint(frame.GetMinX() + 0.45242f * frame.Width, frame.GetMinY() + 0.48999f * frame.Height), new CGPoint(frame.GetMinX() + 0.45893f * frame.Width, frame.GetMinY() + 0.49732f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.45161f * frame.Width, frame.GetMinY() + 0.51685f * frame.Height), new CGPoint(frame.GetMinX() + 0.44916f * frame.Width, frame.GetMinY() + 0.50491f * frame.Height), new CGPoint(frame.GetMinX() + 0.45269f * frame.Width, frame.GetMinY() + 0.51088f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.45025f * frame.Width, frame.GetMinY() + 0.53015f * frame.Height), new CGPoint(frame.GetMinX() + 0.45052f * frame.Width, frame.GetMinY() + 0.52283f * frame.Height), new CGPoint(frame.GetMinX() + 0.44862f * frame.Width, frame.GetMinY() + 0.52527f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.44591f * frame.Width, frame.GetMinY() + 0.53992f * frame.Height), new CGPoint(frame.GetMinX() + 0.45161f * frame.Width, frame.GetMinY() + 0.53504f * frame.Height), new CGPoint(frame.GetMinX() + 0.45161f * frame.Width, frame.GetMinY() + 0.53802f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.44536f * frame.Width, frame.GetMinY() + 0.55132f * frame.Height), new CGPoint(frame.GetMinX() + 0.43993f * frame.Width, frame.GetMinY() + 0.54182f * frame.Height), new CGPoint(frame.GetMinX() + 0.44536f * frame.Width, frame.GetMinY() + 0.55132f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.41632f * frame.Width, frame.GetMinY() + 0.62106f * frame.Height), new CGPoint(frame.GetMinX() + 0.44536f * frame.Width, frame.GetMinY() + 0.55132f * frame.Height), new CGPoint(frame.GetMinX() + 0.43016f * frame.Width, frame.GetMinY() + 0.59990f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.39135f * frame.Width, frame.GetMinY() + 0.69135f * frame.Height), new CGPoint(frame.GetMinX() + 0.40248f * frame.Width, frame.GetMinY() + 0.64223f * frame.Height), new CGPoint(frame.GetMinX() + 0.39678f * frame.Width, frame.GetMinY() + 0.68050f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.37670f * frame.Width, frame.GetMinY() + 0.70411f * frame.Height), new CGPoint(frame.GetMinX() + 0.38592f * frame.Width, frame.GetMinY() + 0.70221f * frame.Height), new CGPoint(frame.GetMinX() + 0.38592f * frame.Width, frame.GetMinY() + 0.69922f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.36883f * frame.Width, frame.GetMinY() + 0.71496f * frame.Height), new CGPoint(frame.GetMinX() + 0.36747f * frame.Width, frame.GetMinY() + 0.70899f * frame.Height), new CGPoint(frame.GetMinX() + 0.37534f * frame.Width, frame.GetMinY() + 0.70899f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.35064f * frame.Width, frame.GetMinY() + 0.71741f * frame.Height), new CGPoint(frame.GetMinX() + 0.36231f * frame.Width, frame.GetMinY() + 0.72093f * frame.Height), new CGPoint(frame.GetMinX() + 0.36095f * frame.Width, frame.GetMinY() + 0.71496f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.28089f * frame.Width, frame.GetMinY() + 0.76517f * frame.Height), new CGPoint(frame.GetMinX() + 0.34033f * frame.Width, frame.GetMinY() + 0.71985f * frame.Height), new CGPoint(frame.GetMinX() + 0.29907f * frame.Width, frame.GetMinY() + 0.74780f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.23719f * frame.Width, frame.GetMinY() + 0.79719f * frame.Height), new CGPoint(frame.GetMinX() + 0.26270f * frame.Width, frame.GetMinY() + 0.78227f * frame.Height), new CGPoint(frame.GetMinX() + 0.24316f * frame.Width, frame.GetMinY() + 0.79122f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.22145f * frame.Width, frame.GetMinY() + 0.80642f * frame.Height), new CGPoint(frame.GetMinX() + 0.23122f * frame.Width, frame.GetMinY() + 0.80316f * frame.Height), new CGPoint(frame.GetMinX() + 0.23041f * frame.Width, frame.GetMinY() + 0.79855f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.21059f * frame.Width, frame.GetMinY() + 0.81429f * frame.Height), new CGPoint(frame.GetMinX() + 0.21249f * frame.Width, frame.GetMinY() + 0.81429f * frame.Height), new CGPoint(frame.GetMinX() + 0.21466f * frame.Width, frame.GetMinY() + 0.81293f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.19919f * frame.Width, frame.GetMinY() + 0.81429f * frame.Height), new CGPoint(frame.GetMinX() + 0.20679f * frame.Width, frame.GetMinY() + 0.81565f * frame.Height), new CGPoint(frame.GetMinX() + 0.20625f * frame.Width, frame.GetMinY() + 0.81429f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.17857f * frame.Width, frame.GetMinY() + 0.82216f * frame.Height), new CGPoint(frame.GetMinX() + 0.19241f * frame.Width, frame.GetMinY() + 0.81429f * frame.Height), new CGPoint(frame.GetMinX() + 0.18481f * frame.Width, frame.GetMinY() + 0.81619f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.16473f * frame.Width, frame.GetMinY() + 0.85744f * frame.Height), new CGPoint(frame.GetMinX() + 0.17205f * frame.Width, frame.GetMinY() + 0.82813f * frame.Height), new CGPoint(frame.GetMinX() + 0.17070f * frame.Width, frame.GetMinY() + 0.84685f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.14220f * frame.Width, frame.GetMinY() + 0.91741f * frame.Height), new CGPoint(frame.GetMinX() + 0.15875f * frame.Width, frame.GetMinY() + 0.86829f * frame.Height), new CGPoint(frame.GetMinX() + 0.14301f * frame.Width, frame.GetMinY() + 0.90357f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.15305f * frame.Width, frame.GetMinY() + 0.96273f * frame.Height), new CGPoint(frame.GetMinX() + 0.14111f * frame.Width, frame.GetMinY() + 0.93125f * frame.Height), new CGPoint(frame.GetMinX() + 0.14763f * frame.Width, frame.GetMinY() + 0.95812f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.17504f * frame.Width, frame.GetMinY() + 0.96083f * frame.Height), new CGPoint(frame.GetMinX() + 0.15848f * frame.Width, frame.GetMinY() + 0.96708f * frame.Height), new CGPoint(frame.GetMinX() + 0.17260f * frame.Width, frame.GetMinY() + 0.96463f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.22226f * frame.Width, frame.GetMinY() + 0.88919f * frame.Height), new CGPoint(frame.GetMinX() + 0.17748f * frame.Width, frame.GetMinY() + 0.95703f * frame.Height), new CGPoint(frame.GetMinX() + 0.21005f * frame.Width, frame.GetMinY() + 0.90493f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.24642f * frame.Width, frame.GetMinY() + 0.86504f * frame.Height), new CGPoint(frame.GetMinX() + 0.23448f * frame.Width, frame.GetMinY() + 0.87345f * frame.Height), new CGPoint(frame.GetMinX() + 0.24533f * frame.Width, frame.GetMinY() + 0.87101f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.25728f * frame.Width, frame.GetMinY() + 0.85662f * frame.Height), new CGPoint(frame.GetMinX() + 0.24751f * frame.Width, frame.GetMinY() + 0.85907f * frame.Height), new CGPoint(frame.GetMinX() + 0.25185f * frame.Width, frame.GetMinY() + 0.85907f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.26623f * frame.Width, frame.GetMinY() + 0.84875f * frame.Height), new CGPoint(frame.GetMinX() + 0.26270f * frame.Width, frame.GetMinY() + 0.85418f * frame.Height), new CGPoint(frame.GetMinX() + 0.26569f * frame.Width, frame.GetMinY() + 0.85228f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.27465f * frame.Width, frame.GetMinY() + 0.84278f * frame.Height), new CGPoint(frame.GetMinX() + 0.26678f * frame.Width, frame.GetMinY() + 0.84523f * frame.Height), new CGPoint(frame.GetMinX() + 0.27057f * frame.Width, frame.GetMinY() + 0.84333f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.28985f * frame.Width, frame.GetMinY() + 0.83546f * frame.Height), new CGPoint(frame.GetMinX() + 0.27845f * frame.Width, frame.GetMinY() + 0.84224f * frame.Height), new CGPoint(frame.GetMinX() + 0.28550f * frame.Width, frame.GetMinY() + 0.84143f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.30613f * frame.Width, frame.GetMinY() + 0.83193f * frame.Height), new CGPoint(frame.GetMinX() + 0.29419f * frame.Width, frame.GetMinY() + 0.82949f * frame.Height), new CGPoint(frame.GetMinX() + 0.29880f * frame.Width, frame.GetMinY() + 0.83247f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.31536f * frame.Width, frame.GetMinY() + 0.82270f * frame.Height), new CGPoint(frame.GetMinX() + 0.31346f * frame.Width, frame.GetMinY() + 0.83139f * frame.Height), new CGPoint(frame.GetMinX() + 0.30912f * frame.Width, frame.GetMinY() + 0.82650f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.37670f * frame.Width, frame.GetMinY() + 0.78199f * frame.Height), new CGPoint(frame.GetMinX() + 0.32187f * frame.Width, frame.GetMinY() + 0.81890f * frame.Height), new CGPoint(frame.GetMinX() + 0.37127f * frame.Width, frame.GetMinY() + 0.78769f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.44509f * frame.Width, frame.GetMinY() + 0.74699f * frame.Height), new CGPoint(frame.GetMinX() + 0.38212f * frame.Width, frame.GetMinY() + 0.77602f * frame.Height), new CGPoint(frame.GetMinX() + 0.43071f * frame.Width, frame.GetMinY() + 0.75350f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.48336f * frame.Width, frame.GetMinY() + 0.70275f * frame.Height), new CGPoint(frame.GetMinX() + 0.45948f * frame.Width, frame.GetMinY() + 0.74047f * frame.Height), new CGPoint(frame.GetMinX() + 0.48336f * frame.Width, frame.GetMinY() + 0.70275f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.53493f * frame.Width, frame.GetMinY() + 0.62378f * frame.Height), new CGPoint(frame.GetMinX() + 0.48336f * frame.Width, frame.GetMinY() + 0.70275f * frame.Height), new CGPoint(frame.GetMinX() + 0.53194f * frame.Width, frame.GetMinY() + 0.63056f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.56044f * frame.Width, frame.GetMinY() + 0.62025f * frame.Height), new CGPoint(frame.GetMinX() + 0.53791f * frame.Width, frame.GetMinY() + 0.61699f * frame.Height), new CGPoint(frame.GetMinX() + 0.55257f * frame.Width, frame.GetMinY() + 0.61998f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.58297f * frame.Width, frame.GetMinY() + 0.61727f * frame.Height), new CGPoint(frame.GetMinX() + 0.56831f * frame.Width, frame.GetMinY() + 0.62079f * frame.Height), new CGPoint(frame.GetMinX() + 0.58297f * frame.Width, frame.GetMinY() + 0.61727f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.59382f * frame.Width, frame.GetMinY() + 0.62568f * frame.Height), new CGPoint(frame.GetMinX() + 0.58297f * frame.Width, frame.GetMinY() + 0.61727f * frame.Height), new CGPoint(frame.GetMinX() + 0.58785f * frame.Width, frame.GetMinY() + 0.62106f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.66846f * frame.Width, frame.GetMinY() + 0.70085f * frame.Height), new CGPoint(frame.GetMinX() + 0.59979f * frame.Width, frame.GetMinY() + 0.63002f * frame.Height), new CGPoint(frame.GetMinX() + 0.66466f * frame.Width, frame.GetMinY() + 0.69162f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.68176f * frame.Width, frame.GetMinY() + 0.71605f * frame.Height), new CGPoint(frame.GetMinX() + 0.67226f * frame.Width, frame.GetMinY() + 0.71008f * frame.Height), new CGPoint(frame.GetMinX() + 0.68176f * frame.Width, frame.GetMinY() + 0.71605f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.69397f * frame.Width, frame.GetMinY() + 0.72636f * frame.Height), new CGPoint(frame.GetMinX() + 0.68176f * frame.Width, frame.GetMinY() + 0.71605f * frame.Height), new CGPoint(frame.GetMinX() + 0.68610f * frame.Width, frame.GetMinY() + 0.72745f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.70293f * frame.Width, frame.GetMinY() + 0.74753f * frame.Height), new CGPoint(frame.GetMinX() + 0.70184f * frame.Width, frame.GetMinY() + 0.72528f * frame.Height), new CGPoint(frame.GetMinX() + 0.69832f * frame.Width, frame.GetMinY() + 0.74699f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.71433f * frame.Width, frame.GetMinY() + 0.78335f * frame.Height), new CGPoint(frame.GetMinX() + 0.70727f * frame.Width, frame.GetMinY() + 0.74807f * frame.Height), new CGPoint(frame.GetMinX() + 0.71189f * frame.Width, frame.GetMinY() + 0.77467f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.73061f * frame.Width, frame.GetMinY() + 0.82080f * frame.Height), new CGPoint(frame.GetMinX() + 0.71677f * frame.Width, frame.GetMinY() + 0.79231f * frame.Height), new CGPoint(frame.GetMinX() + 0.72166f * frame.Width, frame.GetMinY() + 0.81619f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.74636f * frame.Width, frame.GetMinY() + 0.86558f * frame.Height), new CGPoint(frame.GetMinX() + 0.73957f * frame.Width, frame.GetMinY() + 0.82514f * frame.Height), new CGPoint(frame.GetMinX() + 0.74446f * frame.Width, frame.GetMinY() + 0.85825f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.74880f * frame.Width, frame.GetMinY() + 0.88729f * frame.Height), new CGPoint(frame.GetMinX() + 0.74826f * frame.Width, frame.GetMinY() + 0.87291f * frame.Height), new CGPoint(frame.GetMinX() + 0.74826f * frame.Width, frame.GetMinY() + 0.87996f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.75911f * frame.Width, frame.GetMinY() + 0.89950f * frame.Height), new CGPoint(frame.GetMinX() + 0.74934f * frame.Width, frame.GetMinY() + 0.89462f * frame.Height), new CGPoint(frame.GetMinX() + 0.75531f * frame.Width, frame.GetMinY() + 0.89814f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.76210f * frame.Width, frame.GetMinY() + 0.91524f * frame.Height), new CGPoint(frame.GetMinX() + 0.76291f * frame.Width, frame.GetMinY() + 0.90086f * frame.Height), new CGPoint(frame.GetMinX() + 0.76210f * frame.Width, frame.GetMinY() + 0.90981f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.77594f * frame.Width, frame.GetMinY() + 0.95052f * frame.Height), new CGPoint(frame.GetMinX() + 0.76210f * frame.Width, frame.GetMinY() + 0.92067f * frame.Height), new CGPoint(frame.GetMinX() + 0.77350f * frame.Width, frame.GetMinY() + 0.94754f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.78191f * frame.Width, frame.GetMinY() + 0.97060f * frame.Height), new CGPoint(frame.GetMinX() + 0.77838f * frame.Width, frame.GetMinY() + 0.95351f * frame.Height), new CGPoint(frame.GetMinX() + 0.77838f * frame.Width, frame.GetMinY() + 0.96518f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.82968f * frame.Width, frame.GetMinY() + 0.97169f * frame.Height), new CGPoint(frame.GetMinX() + 0.78544f * frame.Width, frame.GetMinY() + 0.97603f * frame.Height), new CGPoint(frame.GetMinX() + 0.82724f * frame.Width, frame.GetMinY() + 0.97169f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.83999f * frame.Width, frame.GetMinY() + 0.94699f * frame.Height), new CGPoint(frame.GetMinX() + 0.83212f * frame.Width, frame.GetMinY() + 0.97169f * frame.Height), new CGPoint(frame.GetMinX() + 0.83945f * frame.Width, frame.GetMinY() + 0.95948f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.81095f * frame.Width, frame.GetMinY() + 0.88648f * frame.Height), new CGPoint(frame.GetMinX() + 0.84053f * frame.Width, frame.GetMinY() + 0.93478f * frame.Height), new CGPoint(frame.GetMinX() + 0.81394f * frame.Width, frame.GetMinY() + 0.89000f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.80742f * frame.Width, frame.GetMinY() + 0.87426f * frame.Height), new CGPoint(frame.GetMinX() + 0.80797f * frame.Width, frame.GetMinY() + 0.88295f * frame.Height), new CGPoint(frame.GetMinX() + 0.81339f * frame.Width, frame.GetMinY() + 0.87752f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.80607f * frame.Width, frame.GetMinY() + 0.86042f * frame.Height), new CGPoint(frame.GetMinX() + 0.80145f * frame.Width, frame.GetMinY() + 0.87074f * frame.Height), new CGPoint(frame.GetMinX() + 0.80742f * frame.Width, frame.GetMinY() + 0.86639f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.80227f * frame.Width, frame.GetMinY() + 0.85255f * frame.Height), new CGPoint(frame.GetMinX() + 0.80471f * frame.Width, frame.GetMinY() + 0.85445f * frame.Height), new CGPoint(frame.GetMinX() + 0.80172f * frame.Width, frame.GetMinY() + 0.85689f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.79792f * frame.Width, frame.GetMinY() + 0.83573f * frame.Height), new CGPoint(frame.GetMinX() + 0.80281f * frame.Width, frame.GetMinY() + 0.84821f * frame.Height), new CGPoint(frame.GetMinX() + 0.80335f * frame.Width, frame.GetMinY() + 0.83871f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.79602f * frame.Width, frame.GetMinY() + 0.82243f * frame.Height), new CGPoint(frame.GetMinX() + 0.79250f * frame.Width, frame.GetMinY() + 0.83274f * frame.Height), new CGPoint(frame.GetMinX() + 0.79738f * frame.Width, frame.GetMinY() + 0.83084f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.78082f * frame.Width, frame.GetMinY() + 0.76245f * frame.Height), new CGPoint(frame.GetMinX() + 0.79467f * frame.Width, frame.GetMinY() + 0.81402f * frame.Height), new CGPoint(frame.GetMinX() + 0.78327f * frame.Width, frame.GetMinY() + 0.77955f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.76400f * frame.Width, frame.GetMinY() + 0.71686f * frame.Height), new CGPoint(frame.GetMinX() + 0.77838f * frame.Width, frame.GetMinY() + 0.74536f * frame.Height), new CGPoint(frame.GetMinX() + 0.76997f * frame.Width, frame.GetMinY() + 0.72365f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.75667f * frame.Width, frame.GetMinY() + 0.70112f * frame.Height), new CGPoint(frame.GetMinX() + 0.75803f * frame.Width, frame.GetMinY() + 0.71008f * frame.Height), new CGPoint(frame.GetMinX() + 0.76345f * frame.Width, frame.GetMinY() + 0.70655f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.74880f * frame.Width, frame.GetMinY() + 0.68348f * frame.Height), new CGPoint(frame.GetMinX() + 0.74988f * frame.Width, frame.GetMinY() + 0.69569f * frame.Height), new CGPoint(frame.GetMinX() + 0.74826f * frame.Width, frame.GetMinY() + 0.69135f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.74283f * frame.Width, frame.GetMinY() + 0.67426f * frame.Height), new CGPoint(frame.GetMinX() + 0.74934f * frame.Width, frame.GetMinY() + 0.67561f * frame.Height), new CGPoint(frame.GetMinX() + 0.74744f * frame.Width, frame.GetMinY() + 0.67507f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.73251f * frame.Width, frame.GetMinY() + 0.65173f * frame.Height), new CGPoint(frame.GetMinX() + 0.73848f * frame.Width, frame.GetMinY() + 0.67317f * frame.Height), new CGPoint(frame.GetMinX() + 0.73604f * frame.Width, frame.GetMinY() + 0.66150f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.72166f * frame.Width, frame.GetMinY() + 0.60261f * frame.Height), new CGPoint(frame.GetMinX() + 0.72899f * frame.Width, frame.GetMinY() + 0.64196f * frame.Height), new CGPoint(frame.GetMinX() + 0.73116f * frame.Width, frame.GetMinY() + 0.62079f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.69452f * frame.Width, frame.GetMinY() + 0.55485f * frame.Height), new CGPoint(frame.GetMinX() + 0.71243f * frame.Width, frame.GetMinY() + 0.58443f * frame.Height), new CGPoint(frame.GetMinX() + 0.69452f * frame.Width, frame.GetMinY() + 0.56028f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.68963f * frame.Width, frame.GetMinY() + 0.54155f * frame.Height), new CGPoint(frame.GetMinX() + 0.69452f * frame.Width, frame.GetMinY() + 0.54942f * frame.Height), new CGPoint(frame.GetMinX() + 0.69262f * frame.Width, frame.GetMinY() + 0.54508f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.68773f * frame.Width, frame.GetMinY() + 0.52771f * frame.Height), new CGPoint(frame.GetMinX() + 0.68665f * frame.Width, frame.GetMinY() + 0.53802f * frame.Height), new CGPoint(frame.GetMinX() + 0.68529f * frame.Width, frame.GetMinY() + 0.53558f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.68176f * frame.Width, frame.GetMinY() + 0.51496f * frame.Height), new CGPoint(frame.GetMinX() + 0.69017f * frame.Width, frame.GetMinY() + 0.51984f * frame.Height), new CGPoint(frame.GetMinX() + 0.68583f * frame.Width, frame.GetMinY() + 0.51740f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.67497f * frame.Width, frame.GetMinY() + 0.50654f * frame.Height), new CGPoint(frame.GetMinX() + 0.67796f * frame.Width, frame.GetMinY() + 0.51251f * frame.Height), new CGPoint(frame.GetMinX() + 0.67687f * frame.Width, frame.GetMinY() + 0.51007f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.66656f * frame.Width, frame.GetMinY() + 0.50220f * frame.Height), new CGPoint(frame.GetMinX() + 0.67308f * frame.Width, frame.GetMinY() + 0.50301f * frame.Height), new CGPoint(frame.GetMinX() + 0.66656f * frame.Width, frame.GetMinY() + 0.50220f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.67145f * frame.Width, frame.GetMinY() + 0.49243f * frame.Height), new CGPoint(frame.GetMinX() + 0.66656f * frame.Width, frame.GetMinY() + 0.50220f * frame.Height), new CGPoint(frame.GetMinX() + 0.66656f * frame.Width, frame.GetMinY() + 0.50220f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.67145f * frame.Width, frame.GetMinY() + 0.47723f * frame.Height), new CGPoint(frame.GetMinX() + 0.67633f * frame.Width, frame.GetMinY() + 0.48266f * frame.Height), new CGPoint(frame.GetMinX() + 0.67145f * frame.Width, frame.GetMinY() + 0.47723f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.70103f * frame.Width, frame.GetMinY() + 0.45009f * frame.Height), new CGPoint(frame.GetMinX() + 0.67145f * frame.Width, frame.GetMinY() + 0.47723f * frame.Height), new CGPoint(frame.GetMinX() + 0.69017f * frame.Width, frame.GetMinY() + 0.46204f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.71162f * frame.Width, frame.GetMinY() + 0.43924f * frame.Height), new CGPoint(frame.GetMinX() + 0.71189f * frame.Width, frame.GetMinY() + 0.43843f * frame.Height), new CGPoint(frame.GetMinX() + 0.70999f * frame.Width, frame.GetMinY() + 0.44087f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.72111f * frame.Width, frame.GetMinY() + 0.43598f * frame.Height), new CGPoint(frame.GetMinX() + 0.71324f * frame.Width, frame.GetMinY() + 0.43788f * frame.Height), new CGPoint(frame.GetMinX() + 0.71677f * frame.Width, frame.GetMinY() + 0.43788f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.73387f * frame.Width, frame.GetMinY() + 0.42703f * frame.Height), new CGPoint(frame.GetMinX() + 0.72546f * frame.Width, frame.GetMinY() + 0.43408f * frame.Height), new CGPoint(frame.GetMinX() + 0.73170f * frame.Width, frame.GetMinY() + 0.42757f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.74337f * frame.Width, frame.GetMinY() + 0.41970f * frame.Height), new CGPoint(frame.GetMinX() + 0.73604f * frame.Width, frame.GetMinY() + 0.42648f * frame.Height), new CGPoint(frame.GetMinX() + 0.74147f * frame.Width, frame.GetMinY() + 0.42431f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.74717f * frame.Width, frame.GetMinY() + 0.40450f * frame.Height), new CGPoint(frame.GetMinX() + 0.74527f * frame.Width, frame.GetMinY() + 0.41509f * frame.Height), new CGPoint(frame.GetMinX() + 0.74391f * frame.Width, frame.GetMinY() + 0.40722f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.76074f * frame.Width, frame.GetMinY() + 0.38741f * frame.Height), new CGPoint(frame.GetMinX() + 0.75070f * frame.Width, frame.GetMinY() + 0.40179f * frame.Height), new CGPoint(frame.GetMinX() + 0.75993f * frame.Width, frame.GetMinY() + 0.39148f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.75585f * frame.Width, frame.GetMinY() + 0.37845f * frame.Height), new CGPoint(frame.GetMinX() + 0.76155f * frame.Width, frame.GetMinY() + 0.38334f * frame.Height), new CGPoint(frame.GetMinX() + 0.75585f * frame.Width, frame.GetMinY() + 0.37845f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.75477f * frame.Width, frame.GetMinY() + 0.37167f * frame.Height), new CGPoint(frame.GetMinX() + 0.75585f * frame.Width, frame.GetMinY() + 0.37845f * frame.Height), new CGPoint(frame.GetMinX() + 0.75721f * frame.Width, frame.GetMinY() + 0.37519f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.74826f * frame.Width, frame.GetMinY() + 0.36787f * frame.Height), new CGPoint(frame.GetMinX() + 0.75260f * frame.Width, frame.GetMinY() + 0.36787f * frame.Height), new CGPoint(frame.GetMinX() + 0.74826f * frame.Width, frame.GetMinY() + 0.36787f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.74771f * frame.Width, frame.GetMinY() + 0.36135f * frame.Height), new CGPoint(frame.GetMinX() + 0.74826f * frame.Width, frame.GetMinY() + 0.36787f * frame.Height), new CGPoint(frame.GetMinX() + 0.74826f * frame.Width, frame.GetMinY() + 0.36271f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.74744f * frame.Width, frame.GetMinY() + 0.35810f * frame.Height), new CGPoint(frame.GetMinX() + 0.74717f * frame.Width, frame.GetMinY() + 0.36000f * frame.Height), new CGPoint(frame.GetMinX() + 0.74744f * frame.Width, frame.GetMinY() + 0.35810f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.75830f * frame.Width, frame.GetMinY() + 0.34968f * frame.Height), new CGPoint(frame.GetMinX() + 0.74744f * frame.Width, frame.GetMinY() + 0.35810f * frame.Height), new CGPoint(frame.GetMinX() + 0.75287f * frame.Width, frame.GetMinY() + 0.35375f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.77160f * frame.Width, frame.GetMinY() + 0.33883f * frame.Height), new CGPoint(frame.GetMinX() + 0.76373f * frame.Width, frame.GetMinY() + 0.34588f * frame.Height), new CGPoint(frame.GetMinX() + 0.76915f * frame.Width, frame.GetMinY() + 0.34833f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.79901f * frame.Width, frame.GetMinY() + 0.32065f * frame.Height), new CGPoint(frame.GetMinX() + 0.77404f * frame.Width, frame.GetMinY() + 0.32960f * frame.Height), new CGPoint(frame.GetMinX() + 0.79358f * frame.Width, frame.GetMinY() + 0.33530f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.81041f * frame.Width, frame.GetMinY() + 0.28428f * frame.Height), new CGPoint(frame.GetMinX() + 0.80444f * frame.Width, frame.GetMinY() + 0.30599f * frame.Height), new CGPoint(frame.GetMinX() + 0.80878f * frame.Width, frame.GetMinY() + 0.28727f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.79765f * frame.Width, frame.GetMinY() + 0.26257f * frame.Height), new CGPoint(frame.GetMinX() + 0.81177f * frame.Width, frame.GetMinY() + 0.28130f * frame.Height), new CGPoint(frame.GetMinX() + 0.80552f * frame.Width, frame.GetMinY() + 0.26800f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.75640f * frame.Width, frame.GetMinY() + 0.25226f * frame.Height), new CGPoint(frame.GetMinX() + 0.78978f * frame.Width, frame.GetMinY() + 0.25714f * frame.Height), new CGPoint(frame.GetMinX() + 0.76264f * frame.Width, frame.GetMinY() + 0.25280f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.73387f * frame.Width, frame.GetMinY() + 0.25877f * frame.Height), new CGPoint(frame.GetMinX() + 0.74988f * frame.Width, frame.GetMinY() + 0.25172f * frame.Height), new CGPoint(frame.GetMinX() + 0.73848f * frame.Width, frame.GetMinY() + 0.25579f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.72519f * frame.Width, frame.GetMinY() + 0.25931f * frame.Height), new CGPoint(frame.GetMinX() + 0.72926f * frame.Width, frame.GetMinY() + 0.26176f * frame.Height), new CGPoint(frame.GetMinX() + 0.72763f * frame.Width, frame.GetMinY() + 0.26013f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.70564f * frame.Width, frame.GetMinY() + 0.26583f * frame.Height), new CGPoint(frame.GetMinX() + 0.72274f * frame.Width, frame.GetMinY() + 0.25850f * frame.Height), new CGPoint(frame.GetMinX() + 0.71487f * frame.Width, frame.GetMinY() + 0.26094f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.69506f * frame.Width, frame.GetMinY() + 0.26637f * frame.Height), new CGPoint(frame.GetMinX() + 0.69642f * frame.Width, frame.GetMinY() + 0.27044f * frame.Height), new CGPoint(frame.GetMinX() + 0.70293f * frame.Width, frame.GetMinY() + 0.26827f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.67742f * frame.Width, frame.GetMinY() + 0.27315f * frame.Height), new CGPoint(frame.GetMinX() + 0.68719f * frame.Width, frame.GetMinY() + 0.26447f * frame.Height), new CGPoint(frame.GetMinX() + 0.68339f * frame.Width, frame.GetMinY() + 0.27126f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.66928f * frame.Width, frame.GetMinY() + 0.27234f * frame.Height), new CGPoint(frame.GetMinX() + 0.67552f * frame.Width, frame.GetMinY() + 0.27370f * frame.Height), new CGPoint(frame.GetMinX() + 0.67280f * frame.Width, frame.GetMinY() + 0.27343f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.49720f * frame.Width, frame.GetMinY() + 0.01344f * frame.Height), new CGPoint(frame.GetMinX() + 0.61554f * frame.Width, frame.GetMinY() + 0.18930f * frame.Height), new CGPoint(frame.GetMinX() + 0.50182f * frame.Width, frame.GetMinY() + 0.01399f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.47359f * frame.Width, frame.GetMinY() + 0.03027f * frame.Height), new CGPoint(frame.GetMinX() + 0.49123f * frame.Width, frame.GetMinY() + 0.01236f * frame.Height), new CGPoint(frame.GetMinX() + 0.47766f * frame.Width, frame.GetMinY() + 0.01941f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.64295f * frame.Width, frame.GetMinY() + 0.26556f * frame.Height), new CGPoint(frame.GetMinX() + 0.47088f * frame.Width, frame.GetMinY() + 0.03814f * frame.Height), new CGPoint(frame.GetMinX() + 0.58052f * frame.Width, frame.GetMinY() + 0.18360f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.64078f * frame.Width, frame.GetMinY() + 0.26528f * frame.Height), new CGPoint(frame.GetMinX() + 0.64213f * frame.Width, frame.GetMinY() + 0.26556f * frame.Height), new CGPoint(frame.GetMinX() + 0.64159f * frame.Width, frame.GetMinY() + 0.26528f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.61309f * frame.Width, frame.GetMinY() + 0.27126f * frame.Height), new CGPoint(frame.GetMinX() + 0.62911f * frame.Width, frame.GetMinY() + 0.26447f * frame.Height), new CGPoint(frame.GetMinX() + 0.62395f * frame.Width, frame.GetMinY() + 0.27641f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.57998f * frame.Width, frame.GetMinY() + 0.27533f * frame.Height), new CGPoint(frame.GetMinX() + 0.60169f * frame.Width, frame.GetMinY() + 0.26583f * frame.Height), new CGPoint(frame.GetMinX() + 0.59708f * frame.Width, frame.GetMinY() + 0.28157f * frame.Height)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.57998f * frame.Width, frame.GetMinY() + 0.27533f * frame.Height)); bezierPath.ClosePath(); bezierPath.MoveTo(new CGPoint(frame.GetMinX() + 0.69180f * frame.Width, frame.GetMinY() + 0.36407f * frame.Height)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.69180f * frame.Width, frame.GetMinY() + 0.36407f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.68285f * frame.Width, frame.GetMinY() + 0.36787f * frame.Height), new CGPoint(frame.GetMinX() + 0.69180f * frame.Width, frame.GetMinY() + 0.36407f * frame.Height), new CGPoint(frame.GetMinX() + 0.68529f * frame.Width, frame.GetMinY() + 0.36787f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.68122f * frame.Width, frame.GetMinY() + 0.38659f * frame.Height), new CGPoint(frame.GetMinX() + 0.68067f * frame.Width, frame.GetMinY() + 0.36787f * frame.Height), new CGPoint(frame.GetMinX() + 0.68257f * frame.Width, frame.GetMinY() + 0.37926f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.67850f * frame.Width, frame.GetMinY() + 0.41292f * frame.Height), new CGPoint(frame.GetMinX() + 0.67986f * frame.Width, frame.GetMinY() + 0.39392f * frame.Height), new CGPoint(frame.GetMinX() + 0.67850f * frame.Width, frame.GetMinY() + 0.41292f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.70266f * frame.Width, frame.GetMinY() + 0.40125f * frame.Height), new CGPoint(frame.GetMinX() + 0.67850f * frame.Width, frame.GetMinY() + 0.41292f * frame.Height), new CGPoint(frame.GetMinX() + 0.69886f * frame.Width, frame.GetMinY() + 0.40613f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.69859f * frame.Width, frame.GetMinY() + 0.38171f * frame.Height), new CGPoint(frame.GetMinX() + 0.70646f * frame.Width, frame.GetMinY() + 0.39663f * frame.Height), new CGPoint(frame.GetMinX() + 0.70076f * frame.Width, frame.GetMinY() + 0.39012f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.69804f * frame.Width, frame.GetMinY() + 0.37519f * frame.Height), new CGPoint(frame.GetMinX() + 0.69642f * frame.Width, frame.GetMinY() + 0.37302f * frame.Height), new CGPoint(frame.GetMinX() + 0.69804f * frame.Width, frame.GetMinY() + 0.37519f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.69180f * frame.Width, frame.GetMinY() + 0.36407f * frame.Height), new CGPoint(frame.GetMinX() + 0.69804f * frame.Width, frame.GetMinY() + 0.37519f * frame.Height), new CGPoint(frame.GetMinX() + 0.69397f * frame.Width, frame.GetMinY() + 0.37221f * frame.Height)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.69180f * frame.Width, frame.GetMinY() + 0.36407f * frame.Height)); bezierPath.ClosePath(); bezierPath.MiterLimit = 4.0f; iconColor.SetFill(); UIColor.Green.SetStroke(); bezierPath.LineWidth = 5; context.AddPath(bezierPath.CGPath); context.DrawPath(CGPathDrawingMode.Fill); } } }
private void DrawFourWinged(CGRect rect) { //// Rectangle 2 Drawing UIBezierPath rectangle2Path = new UIBezierPath(); rectangle2Path.MoveTo(new CGPoint(rect.GetMinX() + 36.0f, rect.GetMinY() + 35.0f)); rectangle2Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 51.0f, rect.GetMinY() + 22.0f), new CGPoint(rect.GetMinX() + 35.55f, rect.GetMinY() + 30.32f), new CGPoint(rect.GetMinX() + 38.68f, rect.GetMinY() + 22.0f)); rectangle2Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 65.0f, rect.GetMinY() + 33.0f), new CGPoint(rect.GetMinX() + 62.87f, rect.GetMinY() + 22.0f), new CGPoint(rect.GetMinX() + 64.9f, rect.GetMinY() + 28.88f)); rectangle2Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.60000f * rect.Width, rect.GetMinY() + 0.44000f * rect.Height), new CGPoint(rect.GetMinX() + 65.14f, rect.GetMinY() + 38.95f), new CGPoint(rect.GetMinX() + 0.59613f * rect.Width, rect.GetMinY() + 0.42938f * rect.Height)); rectangle2Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.60000f * rect.Width, rect.GetMinY() + 0.48344f * rect.Height), new CGPoint(rect.GetMinX() + 0.60712f * rect.Width, rect.GetMinY() + 0.46251f * rect.Height), new CGPoint(rect.GetMinX() + 0.60000f * rect.Width, rect.GetMinY() + 0.44163f * rect.Height)); rectangle2Path.AddLineTo(new CGPoint(rect.GetMinX() + 0.60000f * rect.Width, rect.GetMinY() + 0.69242f * rect.Height)); rectangle2Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.59378f * rect.Width, rect.GetMinY() + 0.76814f * rect.Height), new CGPoint(rect.GetMinX() + 0.60000f * rect.Width, rect.GetMinY() + 0.72837f * rect.Height), new CGPoint(rect.GetMinX() + 0.60000f * rect.Width, rect.GetMinY() + 0.74928f * rect.Height)); rectangle2Path.AddLineTo(new CGPoint(rect.GetMinX() + 0.59288f * rect.Width, rect.GetMinY() + 0.77179f * rect.Height)); rectangle2Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.50975f * rect.Width, rect.GetMinY() + 0.83000f * rect.Height), new CGPoint(rect.GetMinX() + 0.58016f * rect.Width, rect.GetMinY() + 0.80674f * rect.Height), new CGPoint(rect.GetMinX() + 0.54694f * rect.Width, rect.GetMinY() + 0.83000f * rect.Height)); rectangle2Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.50500f * rect.Width, rect.GetMinY() + 0.83000f * rect.Height), new CGPoint(rect.GetMinX() + 0.50500f * rect.Width, rect.GetMinY() + 0.83000f * rect.Height), new CGPoint(rect.GetMinX() + 0.50500f * rect.Width, rect.GetMinY() + 0.83000f * rect.Height)); rectangle2Path.AddLineTo(new CGPoint(rect.GetMinX() + 0.50500f * rect.Width, rect.GetMinY() + 0.83000f * rect.Height)); rectangle2Path.AddLineTo(new CGPoint(rect.GetMinX() + 0.50500f * rect.Width, rect.GetMinY() + 0.83000f * rect.Height)); rectangle2Path.AddLineTo(new CGPoint(rect.GetMinX() + 0.50025f * rect.Width, rect.GetMinY() + 0.83000f * rect.Height)); rectangle2Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.41712f * rect.Width, rect.GetMinY() + 0.77179f * rect.Height), new CGPoint(rect.GetMinX() + 0.46306f * rect.Width, rect.GetMinY() + 0.83000f * rect.Height), new CGPoint(rect.GetMinX() + 0.42984f * rect.Width, rect.GetMinY() + 0.80674f * rect.Height)); rectangle2Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.41000f * rect.Width, rect.GetMinY() + 0.68656f * rect.Height), new CGPoint(rect.GetMinX() + 0.41000f * rect.Width, rect.GetMinY() + 0.74928f * rect.Height), new CGPoint(rect.GetMinX() + 0.41000f * rect.Width, rect.GetMinY() + 0.72837f * rect.Height)); rectangle2Path.AddLineTo(new CGPoint(rect.GetMinX() + 0.41000f * rect.Width, rect.GetMinY() + 0.69242f * rect.Height)); rectangle2Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 0.42000f * rect.Width, rect.GetMinY() + 0.44000f * rect.Height), new CGPoint(rect.GetMinX() + 0.41000f * rect.Width, rect.GetMinY() + 0.44163f * rect.Height), new CGPoint(rect.GetMinX() + 0.42000f * rect.Width, rect.GetMinY() + 0.44000f * rect.Height)); rectangle2Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 36.0f, rect.GetMinY() + 35.0f), new CGPoint(rect.GetMinX() + 0.42340f * rect.Width, rect.GetMinY() + 0.43067f * rect.Height), new CGPoint(rect.GetMinX() + 36.55f, rect.GetMinY() + 40.72f)); rectangle2Path.ClosePath(); UIColor.Gray.SetFill(); rectangle2Path.Fill(); //// Oval 2 Drawing var oval2Path = UIBezierPath.FromOval(new CGRect(rect.GetMinX() + NMath.Floor(rect.Width * 0.12000f + 0.5f), rect.GetMinY() + NMath.Floor(rect.Height * 0.40000f + 0.5f), NMath.Floor(rect.Width * 0.45000f + 0.5f) - NMath.Floor(rect.Width * 0.12000f + 0.5f), NMath.Floor(rect.Height * 0.61000f + 0.5f) - NMath.Floor(rect.Height * 0.40000f + 0.5f))); UIColor.Gray.SetFill(); oval2Path.Fill(); //// Oval 3 Drawing var oval3Path = UIBezierPath.FromOval(new CGRect(rect.GetMinX() + NMath.Floor(rect.Width * 0.21000f + 0.5f), rect.GetMinY() + NMath.Floor(rect.Height * 0.55000f + 0.5f), NMath.Floor(rect.Width * 0.45000f + 0.5f) - NMath.Floor(rect.Width * 0.21000f + 0.5f), NMath.Floor(rect.Height * 0.73000f + 0.5f) - NMath.Floor(rect.Height * 0.55000f + 0.5f))); UIColor.Gray.SetFill(); oval3Path.Fill(); //// Oval 4 Drawing var oval4Path = UIBezierPath.FromOval(new CGRect(rect.GetMinX() + NMath.Floor(rect.Width * 0.55000f + 0.5f), rect.GetMinY() + NMath.Floor(rect.Height * 0.40000f + 0.5f), NMath.Floor(rect.Width * 0.88000f + 0.5f) - NMath.Floor(rect.Width * 0.55000f + 0.5f), NMath.Floor(rect.Height * 0.61000f + 0.5f) - NMath.Floor(rect.Height * 0.40000f + 0.5f))); UIColor.Gray.SetFill(); oval4Path.Fill(); //// Oval 5 Drawing var oval5Path = UIBezierPath.FromOval(new CGRect(rect.GetMinX() + NMath.Floor(rect.Width * 0.55000f + 0.5f), rect.GetMinY() + NMath.Floor(rect.Height * 0.55000f + 0.5f), NMath.Floor(rect.Width * 0.79000f + 0.5f) - NMath.Floor(rect.Width * 0.55000f + 0.5f), NMath.Floor(rect.Height * 0.73000f + 0.5f) - NMath.Floor(rect.Height * 0.55000f + 0.5f))); UIColor.Gray.SetFill(); oval5Path.Fill(); }
public override void Draw(CGRect rect) { base.Draw(rect); //// General Declarations var colorSpace = CGColorSpace.CreateDeviceRGB(); var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor symbolShadow = UIColor.FromRGBA(0.496f, 0.496f, 0.496f, 1.000f); UIColor symbolONColor = UIColor.FromRGBA(0.798f, 0.949f, 1.000f, 1.000f); UIColor backGroundColorTop = UIColor.FromRGBA(0.769f, 0.813f, 0.827f, 1.000f); var backGroundColorTopHSBA = new nfloat[4]; backGroundColorTop.GetHSBA(out backGroundColorTopHSBA[0], out backGroundColorTopHSBA[1], out backGroundColorTopHSBA[2], out backGroundColorTopHSBA[3]); UIColor backGroundColorBottom = UIColor.FromHSBA(backGroundColorTopHSBA[0], 0.154f, backGroundColorTopHSBA[2], backGroundColorTopHSBA[3]); UIColor smallShadowColor = UIColor.FromRGBA(0.296f, 0.296f, 0.296f, 1.000f); UIColor testColor = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); UIColor baseColor2 = UIColor.FromRGBA(0.260f, 0.451f, 0.745f, 1.000f); var baseColor2RGBA = new nfloat[4]; baseColor2.GetRGBA(out baseColor2RGBA[0], out baseColor2RGBA[1], out baseColor2RGBA[2], out baseColor2RGBA[3]); var baseColor2HSBA = new nfloat[4]; baseColor2.GetHSBA(out baseColor2HSBA[0], out baseColor2HSBA[1], out baseColor2HSBA[2], out baseColor2HSBA[3]); UIColor bottomColor2 = UIColor.FromHSBA(baseColor2HSBA[0], baseColor2HSBA[1], 0.8f, baseColor2HSBA[3]); var bottomColor2RGBA = new nfloat[4]; bottomColor2.GetRGBA(out bottomColor2RGBA[0], out bottomColor2RGBA[1], out bottomColor2RGBA[2], out bottomColor2RGBA[3]); UIColor bottomOutColor2 = UIColor.FromRGBA((bottomColor2RGBA[0] * 0.9f), (bottomColor2RGBA[1] * 0.9f), (bottomColor2RGBA[2] * 0.9f), (bottomColor2RGBA[3] * 0.9f + 0.1f)); UIColor topColor2 = UIColor.FromRGBA((baseColor2RGBA[0] * 0.2f + 0.8f), (baseColor2RGBA[1] * 0.2f + 0.8f), (baseColor2RGBA[2] * 0.2f + 0.8f), (baseColor2RGBA[3] * 0.2f + 0.8f)); var topColor2RGBA = new nfloat[4]; topColor2.GetRGBA(out topColor2RGBA[0], out topColor2RGBA[1], out topColor2RGBA[2], out topColor2RGBA[3]); UIColor topOutColor2 = UIColor.FromRGBA((topColor2RGBA[0] * 0 + 1), (topColor2RGBA[1] * 0 + 1), (topColor2RGBA[2] * 0 + 1), (topColor2RGBA[3] * 0 + 1)); //// Gradient Declarations var backgroundGradientColors = new CGColor[] { backGroundColorTop.CGColor, backGroundColorBottom.CGColor }; var backgroundGradientLocations = new nfloat[] { 0, 1 }; var backgroundGradient = new CGGradient(colorSpace, backgroundGradientColors, backgroundGradientLocations); var buttonOutGradient2Colors = new CGColor[] { bottomOutColor2.CGColor, UIColor.FromRGBA(0.625f, 0.718f, 0.860f, 1.000f).CGColor, topOutColor2.CGColor }; var buttonOutGradient2Locations = new nfloat[] { 0, 0.69f, 1 }; var buttonOutGradient2 = new CGGradient(colorSpace, buttonOutGradient2Colors, buttonOutGradient2Locations); var buttonGradient2Colors = new CGColor[] { bottomColor2.CGColor, topColor2.CGColor }; var buttonGradient2Locations = new nfloat[] { 0, 1 }; var buttonGradient2 = new CGGradient(colorSpace, buttonGradient2Colors, buttonGradient2Locations); //// Shadow Declarations var shadow = symbolShadow.CGColor; var shadowOffset = new SizeF(0.1f, 210.1f); var shadowBlurRadius = 15; var glow = symbolONColor.CGColor; var glowOffset = new SizeF(0.1f, -0.1f); var glowBlurRadius = 7.5f; var smallShadow = smallShadowColor.CGColor; var smallShadowOffset = new SizeF(0.1f, 3.1f); var smallShadowBlurRadius = 5.5f; //// Frames var frame = new CGRect(0, 0, 120, 130); //// Subframes var symbol = new CGRect(frame.GetMinX() + 39, frame.GetMinY() + 35, frame.Width - 77, frame.Height - 85); //// BackgroundGroup { context.SaveState(); context.SetAlpha(0.38f); context.BeginTransparencyLayer(); //// background Drawing var backgroundPath = UIBezierPath.FromRect(new RectangleF(-60, -56, 250, 240)); context.SaveState(); backgroundPath.AddClip(); context.DrawLinearGradient(backgroundGradient, new PointF(65, -56), new PointF(65, 184), 0); context.RestoreState(); context.EndTransparencyLayer(); context.RestoreState(); } //// GroupShadow { context.SaveState(); context.SetAlpha(0.75f); context.SetBlendMode(CGBlendMode.Multiply); context.BeginTransparencyLayer(); //// LongShadow Drawing UIBezierPath longShadowPath = new UIBezierPath(); longShadowPath.MoveTo(new PointF(58.79f, -91.94f)); longShadowPath.AddCurveToPoint(new PointF(94.83f, -171.47f), new PointF(105.69f, -91.51f), new PointF(108.82f, -151.54f)); longShadowPath.AddCurveToPoint(new PointF(58.79f, -191.24f), new PointF(91.21f, -176.63f), new PointF(83.49f, -191.41f)); longShadowPath.AddCurveToPoint(new PointF(23.82f, -171.47f), new PointF(34.73f, -191.08f), new PointF(26.78f, -176.84f)); longShadowPath.AddCurveToPoint(new PointF(58.79f, -91.94f), new PointF(11.99f, -149.99f), new PointF(15.59f, -92.33f)); longShadowPath.ClosePath(); context.SaveState(); context.SetShadow(shadowOffset, shadowBlurRadius, shadow); baseColor2.SetFill(); longShadowPath.Fill(); context.RestoreState(); context.EndTransparencyLayer(); context.RestoreState(); } //// outerRing Drawing var outerRingRect = new CGRect(frame.GetMinX() + 15.5f, frame.GetMinY() + 13.5f, frame.Width - 31, frame.Height - 41); var outerRingPath = UIBezierPath.FromOval(outerRingRect); context.SaveState(); context.SetShadow(smallShadowOffset, smallShadowBlurRadius, smallShadow); context.BeginTransparencyLayer(null); outerRingPath.AddClip(); context.DrawLinearGradient(buttonOutGradient2, new CGPoint(outerRingRect.GetMidX(), outerRingRect.GetMaxY()), new CGPoint(outerRingRect.GetMidX(), outerRingRect.GetMinY()), 0); context.EndTransparencyLayer(); context.RestoreState(); //// innerRing Drawing var innerRingRect = new CGRect(frame.GetMinX() + 18.5f, frame.GetMinY() + 16.5f, frame.Width - 37, frame.Height - 47); var innerRingPath = UIBezierPath.FromOval(innerRingRect); context.SaveState(); innerRingPath.AddClip(); context.DrawLinearGradient(buttonGradient2, new CGPoint(innerRingRect.GetMidX(), innerRingRect.GetMaxY()), new CGPoint(innerRingRect.GetMidX(), innerRingRect.GetMinY()), 0); context.RestoreState(); //// Symbol { //// symbolON Drawing UIBezierPath symbolONPath = new UIBezierPath(); symbolONPath.MoveTo(new CGPoint(symbol.GetMinX() + 0.50194f * symbol.Width, symbol.GetMinY() + 0.04446f * symbol.Height)); symbolONPath.AddLineTo(new CGPoint(symbol.GetMinX() + 0.49855f * symbol.Width, symbol.GetMinY() + 0.04445f * symbol.Height)); symbolONPath.AddLineTo(new CGPoint(symbol.GetMinX() + 0.50194f * symbol.Width, symbol.GetMinY() + 0.04446f * symbol.Height)); symbolONPath.ClosePath(); symbolONPath.MoveTo(new CGPoint(symbol.GetMinX() + 0.85355f * symbol.Width, symbol.GetMinY() + 0.18438f * symbol.Height)); symbolONPath.AddCurveToPoint(new CGPoint(symbol.GetMinX() + 0.85355f * symbol.Width, symbol.GetMinY() + 0.86006f * symbol.Height), new CGPoint(symbol.GetMinX() + 1.04882f * symbol.Width, symbol.GetMinY() + 0.37097f * symbol.Height), new CGPoint(symbol.GetMinX() + 1.04882f * symbol.Width, symbol.GetMinY() + 0.67348f * symbol.Height)); symbolONPath.AddCurveToPoint(new CGPoint(symbol.GetMinX() + 0.14645f * symbol.Width, symbol.GetMinY() + 0.86006f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.65829f * symbol.Width, symbol.GetMinY() + 1.04665f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.34171f * symbol.Width, symbol.GetMinY() + 1.04665f * symbol.Height)); symbolONPath.AddCurveToPoint(new CGPoint(symbol.GetMinX() + 0.14645f * symbol.Width, symbol.GetMinY() + 0.18438f * symbol.Height), new CGPoint(symbol.GetMinX() + -0.04882f * symbol.Width, symbol.GetMinY() + 0.67348f * symbol.Height), new CGPoint(symbol.GetMinX() + -0.04882f * symbol.Width, symbol.GetMinY() + 0.37097f * symbol.Height)); symbolONPath.AddCurveToPoint(new CGPoint(symbol.GetMinX() + 0.25581f * symbol.Width, symbol.GetMinY() + 0.18889f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.17353f * symbol.Width, symbol.GetMinY() + 0.16157f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.22375f * symbol.Width, symbol.GetMinY() + 0.16086f * symbol.Height)); symbolONPath.AddCurveToPoint(new CGPoint(symbol.GetMinX() + 0.26156f * symbol.Width, symbol.GetMinY() + 0.29438f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.28788f * symbol.Width, symbol.GetMinY() + 0.21692f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.28490f * symbol.Width, symbol.GetMinY() + 0.27238f * symbol.Height)); symbolONPath.AddCurveToPoint(new CGPoint(symbol.GetMinX() + 0.26156f * symbol.Width, symbol.GetMinY() + 0.75007f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.12987f * symbol.Width, symbol.GetMinY() + 0.42021f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.12987f * symbol.Width, symbol.GetMinY() + 0.62423f * symbol.Height)); symbolONPath.AddCurveToPoint(new CGPoint(symbol.GetMinX() + 0.73844f * symbol.Width, symbol.GetMinY() + 0.75007f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.39325f * symbol.Width, symbol.GetMinY() + 0.87590f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.60675f * symbol.Width, symbol.GetMinY() + 0.87590f * symbol.Height)); symbolONPath.AddCurveToPoint(new CGPoint(symbol.GetMinX() + 0.73844f * symbol.Width, symbol.GetMinY() + 0.29438f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.87013f * symbol.Width, symbol.GetMinY() + 0.62423f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.87013f * symbol.Width, symbol.GetMinY() + 0.42021f * symbol.Height)); symbolONPath.AddCurveToPoint(new CGPoint(symbol.GetMinX() + 0.73844f * symbol.Width, symbol.GetMinY() + 0.18438f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.70569f * symbol.Width, symbol.GetMinY() + 0.26272f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.70967f * symbol.Width, symbol.GetMinY() + 0.21188f * symbol.Height)); symbolONPath.AddCurveToPoint(new CGPoint(symbol.GetMinX() + 0.85355f * symbol.Width, symbol.GetMinY() + 0.18438f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.76722f * symbol.Width, symbol.GetMinY() + 0.15688f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.83173f * symbol.Width, symbol.GetMinY() + 0.15986f * symbol.Height)); symbolONPath.ClosePath(); symbolONPath.MoveTo(new CGPoint(symbol.GetMinX() + 0.41860f * symbol.Width, symbol.GetMinY() + 0.52222f * symbol.Height)); symbolONPath.AddCurveToPoint(new CGPoint(symbol.GetMinX() + 0.50000f * symbol.Width, symbol.GetMinY() + 0.60000f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.41860f * symbol.Width, symbol.GetMinY() + 0.56518f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.45505f * symbol.Width, symbol.GetMinY() + 0.60000f * symbol.Height)); symbolONPath.AddCurveToPoint(new CGPoint(symbol.GetMinX() + 0.58140f * symbol.Width, symbol.GetMinY() + 0.52222f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.54495f * symbol.Width, symbol.GetMinY() + 0.60000f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.58140f * symbol.Width, symbol.GetMinY() + 0.56518f * symbol.Height)); symbolONPath.AddLineTo(new CGPoint(symbol.GetMinX() + 0.58140f * symbol.Width, symbol.GetMinY() + 0.07778f * symbol.Height)); symbolONPath.AddCurveToPoint(new CGPoint(symbol.GetMinX() + 0.50000f * symbol.Width, symbol.GetMinY() + 0.00000f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.58140f * symbol.Width, symbol.GetMinY() + 0.03482f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.54495f * symbol.Width, symbol.GetMinY() + 0.00000f * symbol.Height)); symbolONPath.AddCurveToPoint(new CGPoint(symbol.GetMinX() + 0.41860f * symbol.Width, symbol.GetMinY() + 0.07778f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.45505f * symbol.Width, symbol.GetMinY() + 0.00000f * symbol.Height), new CGPoint(symbol.GetMinX() + 0.41860f * symbol.Width, symbol.GetMinY() + 0.03482f * symbol.Height)); symbolONPath.AddLineTo(new CGPoint(symbol.GetMinX() + 0.41860f * symbol.Width, symbol.GetMinY() + 0.52222f * symbol.Height)); symbolONPath.ClosePath(); context.SaveState(); context.SetShadow(glowOffset, glowBlurRadius, glow); testColor.SetFill(); symbolONPath.Fill(); context.RestoreState(); } }
static void paintCodeRetina() { //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(11.5f, 9.5f)); bezierPath.AddCurveToPoint(new PointF(35.5f, 9.5f), new PointF(35.5f, 9.5f), new PointF(35.5f, 9.5f)); UIColor.Black.SetStroke(); bezierPath.LineWidth = 1; bezierPath.Stroke(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(11.5f, 15.5f)); bezier2Path.AddCurveToPoint(new PointF(35.5f, 15.5f), new PointF(35.5f, 15.5f), new PointF(35.5f, 15.5f)); UIColor.Black.SetStroke(); bezier2Path.LineWidth = 1; bezier2Path.Stroke(); //// Bezier 3 Drawing UIBezierPath bezier3Path = new UIBezierPath(); bezier3Path.MoveTo(new PointF(11.5f, 21.5f)); bezier3Path.AddCurveToPoint(new PointF(35.5f, 21.5f), new PointF(35.5f, 21.5f), new PointF(35.5f, 21.5f)); UIColor.Black.SetStroke(); bezier3Path.LineWidth = 1; bezier3Path.Stroke(); //// Bezier 4 Drawing UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new PointF(11.5f, 27.5f)); bezier4Path.AddCurveToPoint(new PointF(35.5f, 27.5f), new PointF(35.5f, 27.5f), new PointF(35.5f, 27.5f)); UIColor.Black.SetStroke(); bezier4Path.LineWidth = 1; bezier4Path.Stroke(); //// Bezier 5 Drawing UIBezierPath bezier5Path = new UIBezierPath(); bezier5Path.MoveTo(new PointF(11.5f, 32.5f)); bezier5Path.AddCurveToPoint(new PointF(35.5f, 32.5f), new PointF(12.48f, 32.5f), new PointF(35.5f, 32.5f)); UIColor.Black.SetStroke(); bezier5Path.LineWidth = 1; bezier5Path.Stroke(); //// Bezier 6 Drawing UIBezierPath bezier6Path = new UIBezierPath(); bezier6Path.MoveTo(new PointF(11.5f, 38.5f)); bezier6Path.AddCurveToPoint(new PointF(35.5f, 38.5f), new PointF(35.5f, 38.5f), new PointF(35.5f, 38.5f)); UIColor.Black.SetStroke(); bezier6Path.LineWidth = 1; bezier6Path.Stroke(); //// Oval Drawing var ovalPath = UIBezierPath.FromOval(new RectangleF(7.5f, 8.5f, 2, 2)); UIColor.Black.SetStroke(); ovalPath.LineWidth = 1; ovalPath.Stroke(); //// Oval 2 Drawing var oval2Path = UIBezierPath.FromOval(new RectangleF(7.5f, 14.5f, 2, 2)); UIColor.Black.SetStroke(); oval2Path.LineWidth = 1; oval2Path.Stroke(); //// Oval 3 Drawing var oval3Path = UIBezierPath.FromOval(new RectangleF(7.5f, 20.5f, 2, 2)); UIColor.Black.SetStroke(); oval3Path.LineWidth = 1; oval3Path.Stroke(); //// Oval 4 Drawing var oval4Path = UIBezierPath.FromOval(new RectangleF(7.5f, 25.5f, 2, 2)); UIColor.Black.SetStroke(); oval4Path.LineWidth = 1; oval4Path.Stroke(); //// Oval 5 Drawing var oval5Path = UIBezierPath.FromOval(new RectangleF(7.5f, 31.5f, 2, 2)); UIColor.Black.SetStroke(); oval5Path.LineWidth = 1; oval5Path.Stroke(); //// Oval 6 Drawing var oval6Path = UIBezierPath.FromOval(new RectangleF(7.5f, 37.5f, 2, 2)); UIColor.Black.SetStroke(); oval6Path.LineWidth = 1; oval6Path.Stroke(); }
static void paintCodeNonRetina() { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor color3 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); UIColor color4 = UIColor.FromRGBA(0.429f, 0.000f, 0.000f, 1.000f); UIColor color5 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); UIColor color6 = UIColor.FromRGBA(0.456f, 0.456f, 0.456f, 1.000f); //// Shadow Declarations var shadow = UIColor.Black.CGColor; var shadowOffset = new SizeF(0.1f, -1.1f); var shadowBlurRadius = 8.5f; var shadow2 = color6.CGColor; var shadow2Offset = new SizeF(0.1f, -0.1f); var shadow2BlurRadius = 3.5f; //// Abstracted Attributes //var textContent = "Hello, World!"; //// Group { //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(16.77f, 10.57f)); bezier2Path.AddLineTo(new PointF(16.77f, 32.23f)); bezier2Path.AddLineTo(new PointF(25, 32.23f)); bezier2Path.AddLineTo(new PointF(24.03f, 12.12f)); bezier2Path.AddLineTo(new PointF(16.77f, 10.57f)); bezier2Path.ClosePath(); color4.SetFill(); bezier2Path.Fill(); ////// Bezier 2 Inner Shadow var bezier2BorderRect = bezier2Path.Bounds; bezier2BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier2BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier2BorderRect = RectangleF.Union(bezier2BorderRect, bezier2Path.Bounds); bezier2BorderRect.Inflate(1, 1); var bezier2NegativePath = UIBezierPath.FromRect(bezier2BorderRect); bezier2NegativePath.AppendPath(bezier2Path); bezier2NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier2BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier2Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier2BorderRect.Width), 0); bezier2NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier2NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezier2Path.LineWidth = 1; bezier2Path.Stroke(); //// Bezier 18 Drawing UIBezierPath bezier18Path = new UIBezierPath(); bezier18Path.MoveTo(new PointF(24.03f, 32.21f)); bezier18Path.AddLineTo(new PointF(24.03f, 13.19f)); bezier18Path.AddLineTo(new PointF(47.76f, 11.6f)); bezier18Path.AddLineTo(new PointF(47.76f, 32.74f)); bezier18Path.AddLineTo(new PointF(24.03f, 32.21f)); bezier18Path.ClosePath(); color4.SetFill(); bezier18Path.Fill(); ////// Bezier 18 Inner Shadow var bezier18BorderRect = bezier18Path.Bounds; bezier18BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier18BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier18BorderRect = RectangleF.Union(bezier18BorderRect, bezier18Path.Bounds); bezier18BorderRect.Inflate(1, 1); var bezier18NegativePath = UIBezierPath.FromRect(bezier18BorderRect); bezier18NegativePath.AppendPath(bezier18Path); bezier18NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier18BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier18Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier18BorderRect.Width), 0); bezier18NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier18NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezier18Path.LineWidth = 1; bezier18Path.Stroke(); //// Bezier 6 Drawing UIBezierPath bezier6Path = new UIBezierPath(); bezier6Path.MoveTo(new PointF(42.43f, 2.84f)); bezier6Path.AddLineTo(new PointF(47.27f, 5.57f)); bezier6Path.AddLineTo(new PointF(47.27f, 10.57f)); bezier6Path.AddLineTo(new PointF(42.43f, 2.84f)); bezier6Path.ClosePath(); color4.SetFill(); bezier6Path.Fill(); ////// Bezier 6 Inner Shadow var bezier6BorderRect = bezier6Path.Bounds; bezier6BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier6BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier6BorderRect = RectangleF.Union(bezier6BorderRect, bezier6Path.Bounds); bezier6BorderRect.Inflate(1, 1); var bezier6NegativePath = UIBezierPath.FromRect(bezier6BorderRect); bezier6NegativePath.AppendPath(bezier6Path); bezier6NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier6BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier6Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier6BorderRect.Width), 0); bezier6NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier6NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezier6Path.LineWidth = 1; bezier6Path.Stroke(); //// Bezier 5 Drawing UIBezierPath bezier5Path = new UIBezierPath(); bezier5Path.MoveTo(new PointF(23.06f, 13.15f)); bezier5Path.AddLineTo(new PointF(47.76f, 11.35f)); bezier5Path.AddLineTo(new PointF(42.07f, 2.84f)); bezier5Path.AddLineTo(new PointF(19.67f, 6.96f)); bezier5Path.AddLineTo(new PointF(23.06f, 13.15f)); bezier5Path.ClosePath(); color4.SetFill(); bezier5Path.Fill(); ////// Bezier 5 Inner Shadow var bezier5BorderRect = bezier5Path.Bounds; bezier5BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier5BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier5BorderRect = RectangleF.Union(bezier5BorderRect, bezier5Path.Bounds); bezier5BorderRect.Inflate(1, 1); var bezier5NegativePath = UIBezierPath.FromRect(bezier5BorderRect); bezier5NegativePath.AppendPath(bezier5Path); bezier5NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier5BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier5Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier5BorderRect.Width), 0); bezier5NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier5NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezier5Path.LineWidth = 1; bezier5Path.Stroke(); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(4.66f, 13.66f)); bezierPath.AddLineTo(new PointF(4.66f, 32.23f)); bezierPath.AddLineTo(new PointF(16.28f, 32.23f)); bezierPath.AddLineTo(new PointF(16.28f, 11.6f)); bezierPath.AddLineTo(new PointF(4.66f, 13.66f)); bezierPath.ClosePath(); color4.SetFill(); bezierPath.Fill(); ////// Bezier Inner Shadow var bezierBorderRect = bezierPath.Bounds; bezierBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezierBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezierBorderRect = RectangleF.Union(bezierBorderRect, bezierPath.Bounds); bezierBorderRect.Inflate(1, 1); var bezierNegativePath = UIBezierPath.FromRect(bezierBorderRect); bezierNegativePath.AppendPath(bezierPath); bezierNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezierBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezierPath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezierBorderRect.Width), 0); bezierNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezierNegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezierPath.LineWidth = 1; bezierPath.Stroke(); //// Text Drawing // var textRect = new RectangleF(17, 12, 0, 0); // UIColor.Black.SetFill(); // new NSString(textContent).DrawString(textRect, UIFont.FromName("Helvetica", 12), UILineBreakMode.WordWrap, UITextAlignment.Center); //// Bezier 3 Drawing UIBezierPath bezier3Path = new UIBezierPath(); bezier3Path.MoveTo(new PointF(16.77f, 11.09f)); bezier3Path.AddLineTo(new PointF(2.24f, 13.66f)); bezier3Path.AddLineTo(new PointF(16.77f, 0.26f)); bezier3Path.AddLineTo(new PointF(16.77f, 11.09f)); color4.SetFill(); bezier3Path.Fill(); ////// Bezier 3 Inner Shadow var bezier3BorderRect = bezier3Path.Bounds; bezier3BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier3BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier3BorderRect = RectangleF.Union(bezier3BorderRect, bezier3Path.Bounds); bezier3BorderRect.Inflate(1, 1); var bezier3NegativePath = UIBezierPath.FromRect(bezier3BorderRect); bezier3NegativePath.AppendPath(bezier3Path); bezier3NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier3BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier3Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier3BorderRect.Width), 0); bezier3NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier3NegativePath.Fill(); } context.RestoreState(); color3.SetStroke(); bezier3Path.LineWidth = 1; bezier3Path.Stroke(); //// Bezier 4 Drawing UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new PointF(16.28f, 0.26f)); bezier4Path.AddLineTo(new PointF(25.48f, 13.15f)); bezier4Path.AddLineTo(new PointF(16.28f, 11.6f)); bezier4Path.AddLineTo(new PointF(16.28f, 0.26f)); bezier4Path.ClosePath(); color4.SetFill(); bezier4Path.Fill(); ////// Bezier 4 Inner Shadow var bezier4BorderRect = bezier4Path.Bounds; bezier4BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier4BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier4BorderRect = RectangleF.Union(bezier4BorderRect, bezier4Path.Bounds); bezier4BorderRect.Inflate(1, 1); var bezier4NegativePath = UIBezierPath.FromRect(bezier4BorderRect); bezier4NegativePath.AppendPath(bezier4Path); bezier4NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier4BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier4Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier4BorderRect.Width), 0); bezier4NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier4NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezier4Path.LineWidth = 1; bezier4Path.Stroke(); //// Rectangle 2 Drawing var rectangle2Path = UIBezierPath.FromRect(new RectangleF(6.5f, 16.5f, 4, 10)); color3.SetFill(); rectangle2Path.Fill(); UIColor.Black.SetStroke(); rectangle2Path.LineWidth = 1; rectangle2Path.Stroke(); //// Bezier 7 Drawing UIBezierPath bezier7Path = new UIBezierPath(); bezier7Path.MoveTo(new PointF(10.96f, 18.3f)); bezier7Path.AddCurveToPoint(new PointF(6.6f, 18.3f), new PointF(7.08f, 18.3f), new PointF(6.6f, 18.3f)); color5.SetStroke(); bezier7Path.LineWidth = 1; bezier7Path.Stroke(); //// Bezier 8 Drawing UIBezierPath bezier8Path = new UIBezierPath(); bezier8Path.MoveTo(new PointF(10.96f, 20.37f)); bezier8Path.AddCurveToPoint(new PointF(6.6f, 20.37f), new PointF(7.08f, 20.37f), new PointF(6.6f, 20.37f)); color5.SetStroke(); bezier8Path.LineWidth = 1; bezier8Path.Stroke(); //// Bezier 9 Drawing UIBezierPath bezier9Path = new UIBezierPath(); bezier9Path.MoveTo(new PointF(10.96f, 22.43f)); bezier9Path.AddCurveToPoint(new PointF(6.6f, 22.43f), new PointF(7.08f, 22.43f), new PointF(6.6f, 22.43f)); color5.SetStroke(); bezier9Path.LineWidth = 1; bezier9Path.Stroke(); //// Bezier 10 Drawing UIBezierPath bezier10Path = new UIBezierPath(); bezier10Path.MoveTo(new PointF(10.96f, 23.98f)); bezier10Path.AddCurveToPoint(new PointF(6.6f, 23.98f), new PointF(7.08f, 23.98f), new PointF(6.6f, 23.98f)); color5.SetStroke(); bezier10Path.LineWidth = 1; bezier10Path.Stroke(); //// Bezier 11 Drawing UIBezierPath bezier11Path = new UIBezierPath(); bezier11Path.MoveTo(new PointF(9.99f, 16.76f)); bezier11Path.AddCurveToPoint(new PointF(9.99f, 26.55f), new PointF(9.99f, 26.55f), new PointF(9.99f, 26.55f)); color5.SetStroke(); bezier11Path.LineWidth = 1; bezier11Path.Stroke(); //// Bezier 12 Drawing UIBezierPath bezier12Path = new UIBezierPath(); bezier12Path.MoveTo(new PointF(8.05f, 16.76f)); bezier12Path.AddCurveToPoint(new PointF(8.05f, 26.55f), new PointF(8.05f, 26.55f), new PointF(8.05f, 26.55f)); color5.SetStroke(); bezier12Path.LineWidth = 1; bezier12Path.Stroke(); //// Rectangle 3 Drawing var rectangle3Path = UIBezierPath.FromRect(new RectangleF(19.5f, 20.5f, 3, 11)); color3.SetFill(); rectangle3Path.Fill(); UIColor.Black.SetStroke(); rectangle3Path.LineWidth = 1; rectangle3Path.Stroke(); //// Bezier 13 Drawing UIBezierPath bezier13Path = new UIBezierPath(); bezier13Path.MoveTo(new PointF(19.67f, 21.91f)); bezier13Path.AddLineTo(new PointF(22.58f, 21.91f)); color5.SetFill(); bezier13Path.Fill(); color5.SetStroke(); bezier13Path.LineWidth = 1; bezier13Path.Stroke(); //// Bezier 14 Drawing UIBezierPath bezier14Path = new UIBezierPath(); bezier14Path.MoveTo(new PointF(19.67f, 23.98f)); bezier14Path.AddLineTo(new PointF(22.58f, 23.98f)); color5.SetFill(); bezier14Path.Fill(); color5.SetStroke(); bezier14Path.LineWidth = 1; bezier14Path.Stroke(); //// Bezier 15 Drawing UIBezierPath bezier15Path = new UIBezierPath(); bezier15Path.MoveTo(new PointF(19.67f, 26.55f)); bezier15Path.AddLineTo(new PointF(22.58f, 26.55f)); color5.SetFill(); bezier15Path.Fill(); color5.SetStroke(); bezier15Path.LineWidth = 1; bezier15Path.Stroke(); //// Bezier 16 Drawing UIBezierPath bezier16Path = new UIBezierPath(); bezier16Path.MoveTo(new PointF(19.67f, 29.13f)); bezier16Path.AddLineTo(new PointF(22.58f, 29.13f)); color5.SetFill(); bezier16Path.Fill(); color5.SetStroke(); bezier16Path.LineWidth = 1; bezier16Path.Stroke(); //// Bezier 17 Drawing UIBezierPath bezier17Path = new UIBezierPath(); bezier17Path.MoveTo(new PointF(21.13f, 20.37f)); bezier17Path.AddLineTo(new PointF(21.13f, 31.2f)); color5.SetFill(); bezier17Path.Fill(); color5.SetStroke(); bezier17Path.LineWidth = 1; bezier17Path.Stroke(); //// Rectangle 8 Drawing var rectangle8Path = UIBezierPath.FromRect(new RectangleF(39.5f, 27.5f, 3, 5)); color3.SetFill(); rectangle8Path.Fill(); ////// Rectangle 8 Inner Shadow var rectangle8BorderRect = rectangle8Path.Bounds; rectangle8BorderRect.Inflate(shadow2BlurRadius, shadow2BlurRadius); rectangle8BorderRect.Offset(-shadow2Offset.Width, -shadow2Offset.Height); rectangle8BorderRect = RectangleF.Union(rectangle8BorderRect, rectangle8Path.Bounds); rectangle8BorderRect.Inflate(1, 1); var rectangle8NegativePath = UIBezierPath.FromRect(rectangle8BorderRect); rectangle8NegativePath.AppendPath(rectangle8Path); rectangle8NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadow2Offset.Width + (float)Math.Round(rectangle8BorderRect.Width); var yOffset = shadow2Offset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadow2BlurRadius, shadow2); rectangle8Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle8BorderRect.Width), 0); rectangle8NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle8NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); rectangle8Path.LineWidth = 1; rectangle8Path.Stroke(); //// Rectangle 5 Drawing var rectangle5Path = UIBezierPath.FromRect(new RectangleF(26.5f, 15.5f, 3, 3)); color3.SetFill(); rectangle5Path.Fill(); UIColor.Black.SetStroke(); rectangle5Path.LineWidth = 1; rectangle5Path.Stroke(); //// Bezier 19 Drawing UIBezierPath bezier19Path = new UIBezierPath(); bezier19Path.MoveTo(new PointF(26.94f, 16.24f)); bezier19Path.AddCurveToPoint(new PointF(29.84f, 16.24f), new PointF(29.84f, 16.24f), new PointF(29.84f, 16.24f)); color5.SetStroke(); bezier19Path.LineWidth = 1; bezier19Path.Stroke(); //// Bezier 20 Drawing UIBezierPath bezier20Path = new UIBezierPath(); bezier20Path.MoveTo(new PointF(26.94f, 18.3f)); bezier20Path.AddLineTo(new PointF(29.84f, 18.3f)); color5.SetStroke(); bezier20Path.LineWidth = 1; bezier20Path.Stroke(); //// Bezier 21 Drawing UIBezierPath bezier21Path = new UIBezierPath(); bezier21Path.MoveTo(new PointF(28.39f, 15.21f)); bezier21Path.AddLineTo(new PointF(28.39f, 18.82f)); color5.SetStroke(); bezier21Path.LineWidth = 1; bezier21Path.Stroke(); //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRect(new RectangleF(32.5f, 15.5f, 3, 3)); color3.SetFill(); rectanglePath.Fill(); UIColor.Black.SetStroke(); rectanglePath.LineWidth = 1; rectanglePath.Stroke(); //// Bezier 22 Drawing UIBezierPath bezier22Path = new UIBezierPath(); bezier22Path.MoveTo(new PointF(32.26f, 16.24f)); bezier22Path.AddCurveToPoint(new PointF(35.17f, 16.24f), new PointF(35.17f, 16.24f), new PointF(35.17f, 16.24f)); color5.SetStroke(); bezier22Path.LineWidth = 1; bezier22Path.Stroke(); //// Bezier 23 Drawing UIBezierPath bezier23Path = new UIBezierPath(); bezier23Path.MoveTo(new PointF(32.26f, 18.3f)); bezier23Path.AddLineTo(new PointF(35.17f, 18.3f)); color5.SetStroke(); bezier23Path.LineWidth = 1; bezier23Path.Stroke(); //// Bezier 24 Drawing UIBezierPath bezier24Path = new UIBezierPath(); bezier24Path.MoveTo(new PointF(33.72f, 15.21f)); bezier24Path.AddLineTo(new PointF(33.72f, 18.82f)); color5.SetStroke(); bezier24Path.LineWidth = 1; bezier24Path.Stroke(); //// Rectangle 4 Drawing var rectangle4Path = UIBezierPath.FromRect(new RectangleF(38.5f, 14.5f, 2, 4)); color3.SetFill(); rectangle4Path.Fill(); UIColor.Black.SetStroke(); rectangle4Path.LineWidth = 1; rectangle4Path.Stroke(); //// Bezier 25 Drawing UIBezierPath bezier25Path = new UIBezierPath(); bezier25Path.MoveTo(new PointF(38.07f, 15.73f)); bezier25Path.AddCurveToPoint(new PointF(40.98f, 15.73f), new PointF(40.98f, 15.73f), new PointF(40.98f, 15.73f)); color5.SetStroke(); bezier25Path.LineWidth = 1; bezier25Path.Stroke(); //// Bezier 26 Drawing UIBezierPath bezier26Path = new UIBezierPath(); bezier26Path.MoveTo(new PointF(38.07f, 17.79f)); bezier26Path.AddLineTo(new PointF(40.98f, 17.79f)); color5.SetStroke(); bezier26Path.LineWidth = 1; bezier26Path.Stroke(); //// Bezier 27 Drawing UIBezierPath bezier27Path = new UIBezierPath(); bezier27Path.MoveTo(new PointF(39.53f, 14.7f)); bezier27Path.AddLineTo(new PointF(39.53f, 18.3f)); color5.SetStroke(); bezier27Path.LineWidth = 1; bezier27Path.Stroke(); } }
void DrawControl(CGRect frame, string name, string country, string abv, string ibu, string srm) { BackgroundColor = UIColor.Clear; Layer.BackgroundColor = UIColor.Clear.CGColor; //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations var fillColor = UIColor.FromRGBA(0.110f, 0.122f, 0.153f, 1.000f); var textForeground = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); var fillColor2 = UIColor.FromRGBA(0.773f, 0.816f, 0.871f, 1.000f); var textForeground2 = UIColor.FromRGBA(0.773f, 0.816f, 0.871f, 1.000f); var fillColor3 = UIColor.FromRGBA(0.169f, 0.188f, 0.231f, 1.000f); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(frame.GetMinX() + 0.00145f * frame.Width, frame.GetMinY() + 0.04170f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.01299f * frame.Width, frame.GetMinY() + 0.00467f * frame.Height), new CGPoint(frame.GetMinX() + 0.00145f * frame.Width, frame.GetMinY() + 0.02125f * frame.Height), new CGPoint(frame.GetMinX() + 0.00664f * frame.Width, frame.GetMinY() + 0.00467f * frame.Height)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.98701f * frame.Width, frame.GetMinY() + 0.00467f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.99855f * frame.Width, frame.GetMinY() + 0.04170f * frame.Height), new CGPoint(frame.GetMinX() + 0.99338f * frame.Width, frame.GetMinY() + 0.00467f * frame.Height), new CGPoint(frame.GetMinX() + 0.99855f * frame.Width, frame.GetMinY() + 0.02125f * frame.Height)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.99855f * frame.Width, frame.GetMinY() + 0.95830f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.98701f * frame.Width, frame.GetMinY() + 0.99533f * frame.Height), new CGPoint(frame.GetMinX() + 0.99855f * frame.Width, frame.GetMinY() + 0.97875f * frame.Height), new CGPoint(frame.GetMinX() + 0.99336f * frame.Width, frame.GetMinY() + 0.99533f * frame.Height)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.01299f * frame.Width, frame.GetMinY() + 0.99533f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.00145f * frame.Width, frame.GetMinY() + 0.95830f * frame.Height), new CGPoint(frame.GetMinX() + 0.00662f * frame.Width, frame.GetMinY() + 0.99533f * frame.Height), new CGPoint(frame.GetMinX() + 0.00145f * frame.Width, frame.GetMinY() + 0.97875f * frame.Height)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.00145f * frame.Width, frame.GetMinY() + 0.04170f * frame.Height)); bezierPath.ClosePath(); bezierPath.LineJoinStyle = CGLineJoin.Round; bezierPath.UsesEvenOddFillRule = true; fillColor.SetFill(); bezierPath.Fill(); fillColor3.SetStroke(); bezierPath.LineWidth = 0.5f; bezierPath.Stroke(); //// lblName Drawing CGRect lblNameRect = new CGRect(frame.GetMinX() + 13.25f, frame.GetMinY() + 9.45f, frame.Width - 23.25f, NMath.Floor((frame.Height - 9.45f) * 0.31777f + 9.39f) - 8.89f); textForeground.SetFill(); var lblNameStyle = new NSMutableParagraphStyle(); lblNameStyle.Alignment = UITextAlignment.Left; var lblNameFontAttributes = new UIStringAttributes() { Font = UIFont.FromName("Avenir-Heavy", 18.0f), ForegroundColor = textForeground, ParagraphStyle = lblNameStyle }; var lblNameTextHeight = new NSString(name).GetBoundingRect(new CGSize(lblNameRect.Width, nfloat.MaxValue), NSStringDrawingOptions.UsesLineFragmentOrigin, lblNameFontAttributes, null).Height; context.SaveState(); context.ClipToRect(lblNameRect); new NSString(name).DrawString(new CGRect(lblNameRect.GetMinX(), lblNameRect.GetMinY() + (lblNameRect.Height - lblNameTextHeight) / 2.0f, lblNameRect.Width, lblNameTextHeight), UIFont.FromName("Avenir-Heavy", 18.0f), UILineBreakMode.WordWrap, UITextAlignment.Left); context.RestoreState(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new CGPoint(frame.GetMinX() + 18.25f, frame.GetMinY() + 39.0f)); bezier2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 15.0f, frame.GetMinY() + 42.08f), new CGPoint(frame.GetMinX() + 16.46f, frame.GetMinY() + 39.0f), new CGPoint(frame.GetMinX() + 15.0f, frame.GetMinY() + 40.38f)); bezier2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 18.26f, frame.GetMinY() + 46.96f), new CGPoint(frame.GetMinX() + 15.0f, frame.GetMinY() + 44.42f), new CGPoint(frame.GetMinX() + 17.63f, frame.GetMinY() + 46.96f)); bezier2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 21.5f, frame.GetMinY() + 42.08f), new CGPoint(frame.GetMinX() + 18.89f, frame.GetMinY() + 46.96f), new CGPoint(frame.GetMinX() + 21.5f, frame.GetMinY() + 44.42f)); bezier2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 18.25f, frame.GetMinY() + 39.0f), new CGPoint(frame.GetMinX() + 21.5f, frame.GetMinY() + 40.38f), new CGPoint(frame.GetMinX() + 20.05f, frame.GetMinY() + 39.0f)); bezier2Path.ClosePath(); bezier2Path.MoveTo(new CGPoint(frame.GetMinX() + 18.25f, frame.GetMinY() + 43.98f)); bezier2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 20.0f, frame.GetMinY() + 42.23f), new CGPoint(frame.GetMinX() + 19.22f, frame.GetMinY() + 43.98f), new CGPoint(frame.GetMinX() + 20.0f, frame.GetMinY() + 43.2f)); bezier2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 18.25f, frame.GetMinY() + 40.49f), new CGPoint(frame.GetMinX() + 20.0f, frame.GetMinY() + 41.27f), new CGPoint(frame.GetMinX() + 19.22f, frame.GetMinY() + 40.49f)); bezier2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 16.5f, frame.GetMinY() + 42.23f), new CGPoint(frame.GetMinX() + 17.28f, frame.GetMinY() + 40.49f), new CGPoint(frame.GetMinX() + 16.5f, frame.GetMinY() + 41.27f)); bezier2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 18.25f, frame.GetMinY() + 43.98f), new CGPoint(frame.GetMinX() + 16.5f, frame.GetMinY() + 43.2f), new CGPoint(frame.GetMinX() + 17.28f, frame.GetMinY() + 43.98f)); bezier2Path.ClosePath(); bezier2Path.UsesEvenOddFillRule = true; fillColor2.SetFill(); bezier2Path.Fill(); //// lblCountry Drawing CGRect lblCountryRect = new CGRect(frame.GetMinX() + 24.0f, frame.GetMinY() + 31.0f, frame.Width - 34.0f, NMath.Floor((frame.Height - 31.0f) * 0.30263f + 0.5f)); textForeground2.SetFill(); var lblCountryStyle = new NSMutableParagraphStyle(); lblCountryStyle.Alignment = UITextAlignment.Left; var lblCountryFontAttributes = new UIStringAttributes() { Font = UIFont.FromName("Avenir-Medium", 13.0f), ForegroundColor = textForeground2, ParagraphStyle = lblCountryStyle }; var lblCountryTextHeight = new NSString(country).GetBoundingRect(new CGSize(lblCountryRect.Width, nfloat.MaxValue), NSStringDrawingOptions.UsesLineFragmentOrigin, lblCountryFontAttributes, null).Height; context.SaveState(); context.ClipToRect(lblCountryRect); new NSString(country).DrawString(new CGRect(lblCountryRect.GetMinX(), lblCountryRect.GetMinY() + (lblCountryRect.Height - lblCountryTextHeight) / 2.0f, lblCountryRect.Width, lblCountryTextHeight), UIFont.FromName("Avenir-Medium", 13.0f), UILineBreakMode.WordWrap, UITextAlignment.Left); context.RestoreState(); //// Rectangle 3 Drawing var rectangle3Path = UIBezierPath.FromRect(new CGRect(frame.GetMinX(), frame.GetMinY() + NMath.Floor((frame.Height - 40.0f) * 0.98507f + 0.5f), frame.Width, frame.Height - 40.0f - NMath.Floor((frame.Height - 40.0f) * 0.98507f + 0.5f))); fillColor3.SetFill(); rectangle3Path.Fill(); //// Rectangle 4 Drawing var rectangle4Path = UIBezierPath.FromRect(new CGRect(frame.GetMinX() + 114.3f, frame.GetMinY() + NMath.Floor((frame.Height) * 0.62804f + 0.5f), NMath.Floor((frame.Width - 114.3f) * 0.00433f + 0.5f), frame.Height - NMath.Floor((frame.Height) * 0.62804f + 0.5f))); fillColor3.SetFill(); rectangle4Path.Fill(); //// Rectangle 5 Drawing var rectangle5Path = UIBezierPath.FromRect(new CGRect(frame.GetMinX() + NMath.Floor((frame.Width - 114.25f) * 0.99567f - 0.25f) + 0.75f, frame.GetMinY() + NMath.Floor((frame.Height) * 0.62804f + 0.5f), frame.Width - 115.0f - NMath.Floor((frame.Width - 114.25f) * 0.99567f - 0.25f), frame.Height - NMath.Floor((frame.Height) * 0.62804f + 0.5f))); fillColor3.SetFill(); rectangle5Path.Fill(); //// lblAbv Drawing CGRect lblAbvRect = new CGRect(frame.GetMinX() + NMath.Floor(frame.Width * -0.00000f - 0.5f) + 1.0f, frame.GetMinY() + NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f) + 0.81f, NMath.Floor(frame.Width * 0.16812f - 0.5f) - NMath.Floor(frame.Width * -0.00000f - 0.5f), frame.Height - 12.63f - NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f)); textForeground2.SetFill(); var lblAbvStyle = new NSMutableParagraphStyle(); lblAbvStyle.Alignment = UITextAlignment.Right; var lblAbvFontAttributes = new UIStringAttributes() { Font = UIFont.FromName("Avenir-Heavy", 12.0f), ForegroundColor = textForeground2, ParagraphStyle = lblAbvStyle }; var lblAbvTextHeight = new NSString(abv).GetBoundingRect(new CGSize(lblAbvRect.Width, nfloat.MaxValue), NSStringDrawingOptions.UsesLineFragmentOrigin, lblAbvFontAttributes, null).Height; context.SaveState(); context.ClipToRect(lblAbvRect); new NSString(abv).DrawString(new CGRect(lblAbvRect.GetMinX(), lblAbvRect.GetMinY() + (lblAbvRect.Height - lblAbvTextHeight) / 2.0f, lblAbvRect.Width, lblAbvTextHeight), UIFont.FromName("Avenir-Heavy", 12.0f), UILineBreakMode.WordWrap, UITextAlignment.Right); context.RestoreState(); //// Label 4 Drawing CGRect label4Rect = new CGRect(frame.GetMinX() + NMath.Floor((frame.Width - 231.0f) * 0.52961f + 0.12f) + 0.38f, frame.GetMinY() + NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f) + 0.81f, frame.Width - 231.38f - NMath.Floor((frame.Width - 231.0f) * 0.52961f + 0.12f), frame.Height - 12.63f - NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f)); { var textContent = "ABV"; textForeground.SetFill(); var label4Style = new NSMutableParagraphStyle(); label4Style.Alignment = UITextAlignment.Left; var label4FontAttributes = new UIStringAttributes() { Font = UIFont.FromName("Avenir-Heavy", 12.0f), ForegroundColor = textForeground, ParagraphStyle = label4Style }; var label4TextHeight = new NSString(textContent).GetBoundingRect(new CGSize(label4Rect.Width, nfloat.MaxValue), NSStringDrawingOptions.UsesLineFragmentOrigin, label4FontAttributes, null).Height; context.SaveState(); context.ClipToRect(label4Rect); new NSString(textContent).DrawString(new CGRect(label4Rect.GetMinX(), label4Rect.GetMinY() + (label4Rect.Height - label4TextHeight) / 2.0f, label4Rect.Width, label4TextHeight), UIFont.FromName("Avenir-Heavy", 12.0f), UILineBreakMode.WordWrap, UITextAlignment.Left); context.RestoreState(); } //// lblIbu Drawing CGRect lblIbuRect = new CGRect(frame.GetMinX() + NMath.Floor(frame.Width * 0.33623f + 0.5f), frame.GetMinY() + NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f) + 0.81f, NMath.Floor(frame.Width * 0.49855f + 0.5f) - NMath.Floor(frame.Width * 0.33623f + 0.5f), frame.Height - 12.63f - NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f)); textForeground2.SetFill(); var lblIbuStyle = new NSMutableParagraphStyle(); lblIbuStyle.Alignment = UITextAlignment.Right; var lblIbuFontAttributes = new UIStringAttributes() { Font = UIFont.FromName("Avenir-Heavy", 12.0f), ForegroundColor = textForeground2, ParagraphStyle = lblIbuStyle }; var lblIbuTextHeight = new NSString(ibu).GetBoundingRect(new CGSize(lblIbuRect.Width, nfloat.MaxValue), NSStringDrawingOptions.UsesLineFragmentOrigin, lblIbuFontAttributes, null).Height; context.SaveState(); context.ClipToRect(lblIbuRect); new NSString(ibu).DrawString(new CGRect(lblIbuRect.GetMinX(), lblIbuRect.GetMinY() + (lblIbuRect.Height - lblIbuTextHeight) / 2.0f, lblIbuRect.Width, lblIbuTextHeight), UIFont.FromName("Avenir-Heavy", 12.0f), UILineBreakMode.WordWrap, UITextAlignment.Right); context.RestoreState(); //// Label 6 Drawing CGRect label6Rect = new CGRect(frame.GetMinX() + NMath.Floor(frame.Width * 0.50435f + 0.5f), frame.GetMinY() + NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f) + 0.81f, NMath.Floor(frame.Width * 0.66667f + 0.5f) - NMath.Floor(frame.Width * 0.50435f + 0.5f), frame.Height - 12.63f - NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f)); { var textContent = "IBU"; textForeground.SetFill(); var label6Style = new NSMutableParagraphStyle(); label6Style.Alignment = UITextAlignment.Left; var label6FontAttributes = new UIStringAttributes() { Font = UIFont.FromName("Avenir-Heavy", 12.0f), ForegroundColor = textForeground, ParagraphStyle = label6Style }; var label6TextHeight = new NSString(textContent).GetBoundingRect(new CGSize(label6Rect.Width, nfloat.MaxValue), NSStringDrawingOptions.UsesLineFragmentOrigin, label6FontAttributes, null).Height; context.SaveState(); context.ClipToRect(label6Rect); new NSString(textContent).DrawString(new CGRect(label6Rect.GetMinX(), label6Rect.GetMinY() + (label6Rect.Height - label6TextHeight) / 2.0f, label6Rect.Width, label6TextHeight), UIFont.FromName("Avenir-Heavy", 12.0f), UILineBreakMode.WordWrap, UITextAlignment.Left); context.RestoreState(); } //// lblSrm Drawing CGRect lblSrmRect = new CGRect(frame.GetMinX() + NMath.Floor(frame.Width * 0.66957f + 0.5f), frame.GetMinY() + NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f) + 0.81f, NMath.Floor(frame.Width * 0.83478f + 0.5f) - NMath.Floor(frame.Width * 0.66957f + 0.5f), frame.Height - 12.63f - NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f)); textForeground2.SetFill(); var lblSrmStyle = new NSMutableParagraphStyle(); lblSrmStyle.Alignment = UITextAlignment.Right; var lblSrmFontAttributes = new UIStringAttributes() { Font = UIFont.FromName("Avenir-Heavy", 12.0f), ForegroundColor = textForeground2, ParagraphStyle = lblSrmStyle }; var lblSrmTextHeight = new NSString(srm).GetBoundingRect(new CGSize(lblSrmRect.Width, nfloat.MaxValue), NSStringDrawingOptions.UsesLineFragmentOrigin, lblSrmFontAttributes, null).Height; context.SaveState(); context.ClipToRect(lblSrmRect); new NSString(srm).DrawString(new CGRect(lblSrmRect.GetMinX(), lblSrmRect.GetMinY() + (lblSrmRect.Height - lblSrmTextHeight) / 2.0f, lblSrmRect.Width, lblSrmTextHeight), UIFont.FromName("Avenir-Heavy", 12.0f), UILineBreakMode.WordWrap, UITextAlignment.Right); context.RestoreState(); //// Label 8 Drawing CGRect label8Rect = new CGRect(frame.GetMinX() + NMath.Floor(frame.Width * 0.83460f - 0.44f) + 0.94f, frame.GetMinY() + NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f) + 0.81f, NMath.Floor(frame.Width * 1.00000f - 0.5f) - NMath.Floor(frame.Width * 0.83460f - 0.44f) + 0.06f, frame.Height - 12.63f - NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f)); { var textContent = "SRM"; textForeground.SetFill(); var label8Style = new NSMutableParagraphStyle(); label8Style.Alignment = UITextAlignment.Left; var label8FontAttributes = new UIStringAttributes() { Font = UIFont.FromName("Avenir-Heavy", 12.0f), ForegroundColor = textForeground, ParagraphStyle = label8Style }; var label8TextHeight = new NSString(textContent).GetBoundingRect(new CGSize(label8Rect.Width, nfloat.MaxValue), NSStringDrawingOptions.UsesLineFragmentOrigin, label8FontAttributes, null).Height; context.SaveState(); context.ClipToRect(label8Rect); new NSString(textContent).DrawString(new CGRect(label8Rect.GetMinX(), label8Rect.GetMinY() + (label8Rect.Height - label8TextHeight) / 2.0f, label8Rect.Width, label8TextHeight), UIFont.FromName("Avenir-Heavy", 12.0f), UILineBreakMode.WordWrap, UITextAlignment.Left); context.RestoreState(); } }
void DrawBeerLoader(CGRect frame, float percentage) { var fillColor4 = UIColor.FromRGBA(0.963f, 0.836f, 0.300f, 1.000f); var fillColor9 = UIColor.FromRGBA(0.833f, 0.723f, 0.260f, 1.000f); var expression = 450.0f - 360.0f / 100.0f * percentage; var expression2 = 180.0f - 360.0f / 100.0f * percentage; CGRect background = new CGRect(frame.GetMinX() + NMath.Floor(frame.Width * 0.00017f + 0.41f) + 0.09f, frame.GetMinY() + NMath.Floor(frame.Height * 0.00016f + 0.23f) + 0.27f, NMath.Floor(frame.Width * 0.99950f - 0.24f) - NMath.Floor(frame.Width * 0.00017f + 0.41f) + 0.65f, NMath.Floor(frame.Height * 0.98998f - 0.42f) - NMath.Floor(frame.Height * 0.00016f + 0.23f) + 0.65f); CGRect beer = new CGRect(frame.GetMinX() + NMath.Floor(frame.Width * 0.33565f - 0.05f) + 0.55f, frame.GetMinY() + NMath.Floor(frame.Height * 0.22329f + 0.0f) + 0.5f, NMath.Floor(frame.Width * 0.71844f - 0.4f) - NMath.Floor(frame.Width * 0.33565f - 0.05f) + 0.35f, NMath.Floor(frame.Height * 0.72339f - 0.05f) - NMath.Floor(frame.Height * 0.22329f + 0.0f) + 0.05f); { UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(background.GetMinX() + 0.94794f * background.Width, background.GetMinY() + 0.58913f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.96205f * background.Width, background.GetMinY() + 0.69140f * background.Height), new CGPoint(background.GetMinX() + 0.94178f * background.Width, background.GetMinY() + 0.62023f * background.Height), new CGPoint(background.GetMinX() + 0.97392f * background.Width, background.GetMinY() + 0.66278f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.87973f * background.Width, background.GetMinY() + 0.75370f * background.Height), new CGPoint(background.GetMinX() + 0.94998f * background.Width, background.GetMinY() + 0.72052f * background.Height), new CGPoint(background.GetMinX() + 0.89706f * background.Width, background.GetMinY() + 0.72781f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.85355f * background.Width, background.GetMinY() + 0.85355f * background.Height), new CGPoint(background.GetMinX() + 0.86227f * background.Width, background.GetMinY() + 0.77977f * background.Height), new CGPoint(background.GetMinX() + 0.87567f * background.Width, background.GetMinY() + 0.83144f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.75369f * background.Width, background.GetMinY() + 0.87973f * background.Height), new CGPoint(background.GetMinX() + 0.83144f * background.Width, background.GetMinY() + 0.87567f * background.Height), new CGPoint(background.GetMinX() + 0.77977f * background.Width, background.GetMinY() + 0.86227f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.69139f * background.Width, background.GetMinY() + 0.96205f * background.Height), new CGPoint(background.GetMinX() + 0.72781f * background.Width, background.GetMinY() + 0.89706f * background.Height), new CGPoint(background.GetMinX() + 0.72051f * background.Width, background.GetMinY() + 0.94998f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.63742f * background.Width, background.GetMinY() + 0.95593f * background.Height), new CGPoint(background.GetMinX() + 0.67609f * background.Width, background.GetMinY() + 0.96840f * background.Height), new CGPoint(background.GetMinX() + 0.65681f * background.Width, background.GetMinY() + 0.96216f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.58913f * background.Width, background.GetMinY() + 0.94793f * background.Height), new CGPoint(background.GetMinX() + 0.62055f * background.Width, background.GetMinY() + 0.95050f * background.Height), new CGPoint(background.GetMinX() + 0.60360f * background.Width, background.GetMinY() + 0.94507f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.50000f * background.Width, background.GetMinY() + 1.00000f * background.Height), new CGPoint(background.GetMinX() + 0.55894f * background.Width, background.GetMinY() + 0.95391f * background.Height), new CGPoint(background.GetMinX() + 0.53194f * background.Width, background.GetMinY() + 1.00000f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.41087f * background.Width, background.GetMinY() + 0.94793f * background.Height), new CGPoint(background.GetMinX() + 0.46806f * background.Width, background.GetMinY() + 1.00000f * background.Height), new CGPoint(background.GetMinX() + 0.44106f * background.Width, background.GetMinY() + 0.95391f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.36258f * background.Width, background.GetMinY() + 0.95593f * background.Height), new CGPoint(background.GetMinX() + 0.39640f * background.Width, background.GetMinY() + 0.94507f * background.Height), new CGPoint(background.GetMinX() + 0.37945f * background.Width, background.GetMinY() + 0.95050f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.30861f * background.Width, background.GetMinY() + 0.96205f * background.Height), new CGPoint(background.GetMinX() + 0.34319f * background.Width, background.GetMinY() + 0.96216f * background.Height), new CGPoint(background.GetMinX() + 0.32391f * background.Width, background.GetMinY() + 0.96840f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.24631f * background.Width, background.GetMinY() + 0.87973f * background.Height), new CGPoint(background.GetMinX() + 0.27949f * background.Width, background.GetMinY() + 0.94998f * background.Height), new CGPoint(background.GetMinX() + 0.27219f * background.Width, background.GetMinY() + 0.89705f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.14645f * background.Width, background.GetMinY() + 0.85355f * background.Height), new CGPoint(background.GetMinX() + 0.22023f * background.Width, background.GetMinY() + 0.86227f * background.Height), new CGPoint(background.GetMinX() + 0.16856f * background.Width, background.GetMinY() + 0.87567f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.12027f * background.Width, background.GetMinY() + 0.75369f * background.Height), new CGPoint(background.GetMinX() + 0.12433f * background.Width, background.GetMinY() + 0.83144f * background.Height), new CGPoint(background.GetMinX() + 0.13773f * background.Width, background.GetMinY() + 0.77977f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.03795f * background.Width, background.GetMinY() + 0.69139f * background.Height), new CGPoint(background.GetMinX() + 0.10294f * background.Width, background.GetMinY() + 0.72781f * background.Height), new CGPoint(background.GetMinX() + 0.05002f * background.Width, background.GetMinY() + 0.72051f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.05207f * background.Width, background.GetMinY() + 0.58913f * background.Height), new CGPoint(background.GetMinX() + 0.02608f * background.Width, background.GetMinY() + 0.66277f * background.Height), new CGPoint(background.GetMinX() + 0.05822f * background.Width, background.GetMinY() + 0.62023f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.00000f * background.Width, background.GetMinY() + 0.50000f * background.Height), new CGPoint(background.GetMinX() + 0.04609f * background.Width, background.GetMinY() + 0.55894f * background.Height), new CGPoint(background.GetMinX() + 0.00000f * background.Width, background.GetMinY() + 0.53194f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.05207f * background.Width, background.GetMinY() + 0.41087f * background.Height), new CGPoint(background.GetMinX() + 0.00000f * background.Width, background.GetMinY() + 0.46806f * background.Height), new CGPoint(background.GetMinX() + 0.04609f * background.Width, background.GetMinY() + 0.44106f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.03795f * background.Width, background.GetMinY() + 0.30861f * background.Height), new CGPoint(background.GetMinX() + 0.05822f * background.Width, background.GetMinY() + 0.37976f * background.Height), new CGPoint(background.GetMinX() + 0.02608f * background.Width, background.GetMinY() + 0.33723f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.12027f * background.Width, background.GetMinY() + 0.24631f * background.Height), new CGPoint(background.GetMinX() + 0.05002f * background.Width, background.GetMinY() + 0.27949f * background.Height), new CGPoint(background.GetMinX() + 0.10294f * background.Width, background.GetMinY() + 0.27219f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.14645f * background.Width, background.GetMinY() + 0.14644f * background.Height), new CGPoint(background.GetMinX() + 0.13773f * background.Width, background.GetMinY() + 0.22023f * background.Height), new CGPoint(background.GetMinX() + 0.12433f * background.Width, background.GetMinY() + 0.16856f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.24631f * background.Width, background.GetMinY() + 0.12027f * background.Height), new CGPoint(background.GetMinX() + 0.16856f * background.Width, background.GetMinY() + 0.12433f * background.Height), new CGPoint(background.GetMinX() + 0.22023f * background.Width, background.GetMinY() + 0.13773f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.30861f * background.Width, background.GetMinY() + 0.03795f * background.Height), new CGPoint(background.GetMinX() + 0.27219f * background.Width, background.GetMinY() + 0.10294f * background.Height), new CGPoint(background.GetMinX() + 0.27949f * background.Width, background.GetMinY() + 0.05002f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.36258f * background.Width, background.GetMinY() + 0.04407f * background.Height), new CGPoint(background.GetMinX() + 0.32391f * background.Width, background.GetMinY() + 0.03160f * background.Height), new CGPoint(background.GetMinX() + 0.34319f * background.Width, background.GetMinY() + 0.03784f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.41087f * background.Width, background.GetMinY() + 0.05206f * background.Height), new CGPoint(background.GetMinX() + 0.37945f * background.Width, background.GetMinY() + 0.04950f * background.Height), new CGPoint(background.GetMinX() + 0.39640f * background.Width, background.GetMinY() + 0.05493f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.50000f * background.Width, background.GetMinY() + 0.00000f * background.Height), new CGPoint(background.GetMinX() + 0.44106f * background.Width, background.GetMinY() + 0.04609f * background.Height), new CGPoint(background.GetMinX() + 0.46806f * background.Width, background.GetMinY() + 0.00000f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.58913f * background.Width, background.GetMinY() + 0.05206f * background.Height), new CGPoint(background.GetMinX() + 0.53194f * background.Width, background.GetMinY() + 0.00000f * background.Height), new CGPoint(background.GetMinX() + 0.55894f * background.Width, background.GetMinY() + 0.04609f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.63742f * background.Width, background.GetMinY() + 0.04407f * background.Height), new CGPoint(background.GetMinX() + 0.60360f * background.Width, background.GetMinY() + 0.05493f * background.Height), new CGPoint(background.GetMinX() + 0.62055f * background.Width, background.GetMinY() + 0.04950f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.69140f * background.Width, background.GetMinY() + 0.03795f * background.Height), new CGPoint(background.GetMinX() + 0.65681f * background.Width, background.GetMinY() + 0.03784f * background.Height), new CGPoint(background.GetMinX() + 0.67609f * background.Width, background.GetMinY() + 0.03160f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.75369f * background.Width, background.GetMinY() + 0.12027f * background.Height), new CGPoint(background.GetMinX() + 0.72051f * background.Width, background.GetMinY() + 0.05002f * background.Height), new CGPoint(background.GetMinX() + 0.72781f * background.Width, background.GetMinY() + 0.10294f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.85356f * background.Width, background.GetMinY() + 0.14645f * background.Height), new CGPoint(background.GetMinX() + 0.77977f * background.Width, background.GetMinY() + 0.13773f * background.Height), new CGPoint(background.GetMinX() + 0.83144f * background.Width, background.GetMinY() + 0.12433f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.87973f * background.Width, background.GetMinY() + 0.24631f * background.Height), new CGPoint(background.GetMinX() + 0.87567f * background.Width, background.GetMinY() + 0.16856f * background.Height), new CGPoint(background.GetMinX() + 0.86227f * background.Width, background.GetMinY() + 0.22023f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.96206f * background.Width, background.GetMinY() + 0.30861f * background.Height), new CGPoint(background.GetMinX() + 0.89706f * background.Width, background.GetMinY() + 0.27219f * background.Height), new CGPoint(background.GetMinX() + 0.94998f * background.Width, background.GetMinY() + 0.27949f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.94794f * background.Width, background.GetMinY() + 0.41087f * background.Height), new CGPoint(background.GetMinX() + 0.97392f * background.Width, background.GetMinY() + 0.33723f * background.Height), new CGPoint(background.GetMinX() + 0.94178f * background.Width, background.GetMinY() + 0.37976f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 1.00000f * background.Width, background.GetMinY() + 0.50000f * background.Height), new CGPoint(background.GetMinX() + 0.95391f * background.Width, background.GetMinY() + 0.44106f * background.Height), new CGPoint(background.GetMinX() + 1.00000f * background.Width, background.GetMinY() + 0.46806f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.94794f * background.Width, background.GetMinY() + 0.58913f * background.Height), new CGPoint(background.GetMinX() + 1.00000f * background.Width, background.GetMinY() + 0.53194f * background.Height), new CGPoint(background.GetMinX() + 0.95391f * background.Width, background.GetMinY() + 0.55894f * background.Height)); bezierPath.ClosePath(); bezierPath.UsesEvenOddFillRule = true; this.Green.SetFill(); bezierPath.Fill(); var whitePath = UIBezierPath.FromOval(new CGRect(background.GetMinX() + NMath.Floor(background.Width * 0.09115f - 0.41f) + 0.91f, background.GetMinY() + NMath.Floor(background.Height * 0.09203f + 0.47f) + 0.03f, NMath.Floor(background.Width * 0.91052f - 0.11f) - NMath.Floor(background.Width * 0.09115f - 0.41f) - 0.3f, NMath.Floor(background.Height * 0.90967f - 0.23f) - NMath.Floor(background.Height * 0.09203f + 0.47f) + 0.7f)); this.SimpleWhite.SetFill(); whitePath.Fill(); var white2Rect = new CGRect(background.GetMinX() + NMath.Floor(background.Width * 0.08925f - 0.41f) + 0.91f, background.GetMinY() + NMath.Floor(background.Height * 0.09011f + 0.47f) + 0.03f, NMath.Floor(background.Width * 0.91052f - 0.11f) - NMath.Floor(background.Width * 0.08925f - 0.41f) - 0.3f, NMath.Floor(background.Height * 0.90967f - 0.23f) - NMath.Floor(background.Height * 0.09011f + 0.47f) + 0.7f); var white2Path = new UIBezierPath(); white2Path.AddArc(new CGPoint(0.0f, 0.0f), white2Rect.Width / 2.0f, (nfloat)(-expression * NMath.PI / 180), (nfloat)(-expression2 * NMath.PI / 180.0f), true); white2Path.AddLineTo(new CGPoint(0.0f, 0.0f)); white2Path.ClosePath(); var white2Transform = CGAffineTransform.MakeScale(1.0f, white2Rect.Height / white2Rect.Width); white2Transform.Translate(white2Rect.GetMidX(), white2Rect.GetMidY()); white2Path.ApplyTransform(white2Transform); this.Green.SetFill(); white2Path.Fill(); var greenFillerPath = UIBezierPath.FromOval(new CGRect(background.GetMinX() + NMath.Floor(background.Width * 0.09686f - 0.41f) + 0.91f, background.GetMinY() + NMath.Floor(background.Height * 0.09780f - 0.23f) + 0.73f, NMath.Floor(background.Width * 0.90348f - 0.41f) - NMath.Floor(background.Width * 0.09686f - 0.41f), NMath.Floor(background.Height * 0.90257f - 0.23f) - NMath.Floor(background.Height * 0.09780f - 0.23f))); this.Green.SetFill(); greenFillerPath.Fill(); } { var ovalPath = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.07499f + 0.4f) + 0.1f, beer.GetMinY() + NMath.Floor(beer.Height * 0.06273f + 0.45f) + 0.05f, NMath.Floor(beer.Width * 0.26124f - 0.1f) - NMath.Floor(beer.Width * 0.07499f + 0.4f) + 0.5f, NMath.Floor(beer.Height * 0.20908f - 0.05f) - NMath.Floor(beer.Height * 0.06273f + 0.45f) + 0.5f)); OffWhite.SetFill(); ovalPath.Fill(); var oval2Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.00000f + 0.5f), beer.GetMinY() + NMath.Floor(beer.Height * 0.15263f + 0.1f) + 0.4f, NMath.Floor(beer.Width * 0.18624f) - NMath.Floor(beer.Width * 0.00000f + 0.5f) + 0.5f, NMath.Floor(beer.Height * 0.29899f - 0.4f) - NMath.Floor(beer.Height * 0.15263f + 0.1f) + 0.5f)); OffWhite.SetFill(); oval2Path.Fill(); var oval3Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.00000f + 0.5f), beer.GetMinY() + NMath.Floor(beer.Height * 0.24881f + 0.5f) + 0.0f, NMath.Floor(beer.Width * 0.13211f - 0.1f) - NMath.Floor(beer.Width * 0.00000f + 0.5f) + 0.6f, NMath.Floor(beer.Height * 0.35373f - 0.1f) - NMath.Floor(beer.Height * 0.24881f + 0.5f) + 0.6f)); OffWhite.SetFill(); oval3Path.Fill(); var oval4Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.00000f + 0.5f), beer.GetMinY() + NMath.Floor(beer.Height * 0.32541f - 0.35f) + 0.85f, NMath.Floor(beer.Width * 0.13211f - 0.1f) - NMath.Floor(beer.Width * 0.00000f + 0.5f) + 0.6f, NMath.Floor(beer.Height * 0.43033f + 0.05f) - NMath.Floor(beer.Height * 0.32541f - 0.35f) - 0.4f)); OffWhite.SetFill(); oval4Path.Fill(); var oval5Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.03526f + 0.4f) + 0.1f, beer.GetMinY() + NMath.Floor(beer.Height * 0.40068f + 0.45f) + 0.05f, NMath.Floor(beer.Width * 0.16737f - 0.2f) - NMath.Floor(beer.Width * 0.03526f + 0.4f) + 0.6f, NMath.Floor(beer.Height * 0.50560f - 0.15f) - NMath.Floor(beer.Height * 0.40068f + 0.45f) + 0.6f)); OffWhite.SetFill(); oval5Path.Fill(); UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new CGPoint(beer.GetMinX() + 0.71340f * beer.Width, beer.GetMinY() + 0.27402f * beer.Height)); bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.75623f * beer.Width, beer.GetMinY() + 0.31182f * beer.Height), new CGPoint(beer.GetMinX() + 0.71340f * beer.Width, beer.GetMinY() + 0.27402f * beer.Height), new CGPoint(beer.GetMinX() + 0.72564f * beer.Width, beer.GetMinY() + 0.30342f * beer.Height)); bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.91991f * beer.Width, beer.GetMinY() + 0.33162f * beer.Height), new CGPoint(beer.GetMinX() + 0.78618f * beer.Width, beer.GetMinY() + 0.32004f * beer.Height), new CGPoint(beer.GetMinX() + 0.85931f * beer.Width, beer.GetMinY() + 0.30847f * beer.Height)); bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.99028f * beer.Width, beer.GetMinY() + 0.67241f * beer.Height), new CGPoint(beer.GetMinX() + 0.97956f * beer.Width, beer.GetMinY() + 0.35442f * beer.Height), new CGPoint(beer.GetMinX() + 1.01934f * beer.Width, beer.GetMinY() + 0.58000f * beer.Height)); bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.74374f * beer.Width, beer.GetMinY() + 0.90110f * beer.Height), new CGPoint(beer.GetMinX() + 0.96121f * beer.Width, beer.GetMinY() + 0.76480f * beer.Height), new CGPoint(beer.GetMinX() + 0.71157f * beer.Width, beer.GetMinY() + 0.83870f * beer.Height)); bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.70703f * beer.Width, beer.GetMinY() + 0.67071f * beer.Height), new CGPoint(beer.GetMinX() + 0.71927f * beer.Width, beer.GetMinY() + 0.95149f * beer.Height), new CGPoint(beer.GetMinX() + 0.68742f * beer.Width, beer.GetMinY() + 0.70678f * beer.Height)); bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.86866f * beer.Width, beer.GetMinY() + 0.70181f * beer.Height), new CGPoint(beer.GetMinX() + 0.72080f * beer.Width, beer.GetMinY() + 0.74270f * beer.Height), new CGPoint(beer.GetMinX() + 0.83654f * beer.Width, beer.GetMinY() + 0.72700f * beer.Height)); bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.91685f * beer.Width, beer.GetMinY() + 0.55481f * beer.Height), new CGPoint(beer.GetMinX() + 0.90079f * beer.Width, beer.GetMinY() + 0.67660f * beer.Height), new CGPoint(beer.GetMinX() + 0.93284f * beer.Width, beer.GetMinY() + 0.65992f * beer.Height)); bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.87095f * beer.Width, beer.GetMinY() + 0.38322f * beer.Height), new CGPoint(beer.GetMinX() + 0.90085f * beer.Width, beer.GetMinY() + 0.44970f * beer.Height), new CGPoint(beer.GetMinX() + 0.90002f * beer.Width, beer.GetMinY() + 0.39521f * beer.Height)); bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.76540f * beer.Width, beer.GetMinY() + 0.38082f * beer.Height), new CGPoint(beer.GetMinX() + 0.84188f * beer.Width, beer.GetMinY() + 0.37122f * beer.Height), new CGPoint(beer.GetMinX() + 0.78988f * beer.Width, beer.GetMinY() + 0.37602f * beer.Height)); bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.70116f * beer.Width, beer.GetMinY() + 0.43331f * beer.Height), new CGPoint(beer.GetMinX() + 0.74093f * beer.Width, beer.GetMinY() + 0.38562f * beer.Height), new CGPoint(beer.GetMinX() + 0.70116f * beer.Width, beer.GetMinY() + 0.43331f * beer.Height)); bezier2Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.71340f * beer.Width, beer.GetMinY() + 0.27402f * beer.Height)); bezier2Path.ClosePath(); bezier2Path.UsesEvenOddFillRule = true; SimpleWhite.SetFill(); bezier2Path.Fill(); UIBezierPath bezier3Path = new UIBezierPath(); bezier3Path.MoveTo(new CGPoint(beer.GetMinX() + 0.08316f * beer.Width, beer.GetMinY() + 0.83800f * beer.Height)); bezier3Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.05563f * beer.Width, beer.GetMinY() + 0.95199f * beer.Height)); bezier3Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.40975f * beer.Width, beer.GetMinY() + 0.98741f * beer.Height), new CGPoint(beer.GetMinX() + 0.05563f * beer.Width, beer.GetMinY() + 0.95199f * beer.Height), new CGPoint(beer.GetMinX() + 0.10382f * beer.Width, beer.GetMinY() + 0.98741f * beer.Height)); bezier3Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.75623f * beer.Width, beer.GetMinY() + 0.95199f * beer.Height), new CGPoint(beer.GetMinX() + 0.71569f * beer.Width, beer.GetMinY() + 0.98741f * beer.Height), new CGPoint(beer.GetMinX() + 0.75623f * beer.Width, beer.GetMinY() + 0.95199f * beer.Height)); bezier3Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.73787f * beer.Width, beer.GetMinY() + 0.83800f * beer.Height)); bezier3Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.41893f * beer.Width, beer.GetMinY() + 0.86680f * beer.Height), new CGPoint(beer.GetMinX() + 0.73787f * beer.Width, beer.GetMinY() + 0.83800f * beer.Height), new CGPoint(beer.GetMinX() + 0.68510f * beer.Width, beer.GetMinY() + 0.86680f * beer.Height)); bezier3Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.08316f * beer.Width, beer.GetMinY() + 0.83800f * beer.Height), new CGPoint(beer.GetMinX() + 0.15277f * beer.Width, beer.GetMinY() + 0.86680f * beer.Height), new CGPoint(beer.GetMinX() + 0.08316f * beer.Width, beer.GetMinY() + 0.83800f * beer.Height)); bezier3Path.ClosePath(); bezier3Path.UsesEvenOddFillRule = true; SimpleWhite.SetFill(); bezier3Path.Fill(); UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new CGPoint(beer.GetMinX() + 0.08189f * beer.Width, beer.GetMinY() + 0.84290f * beer.Height)); bezier4Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.11024f * beer.Width, beer.GetMinY() + 0.26059f * beer.Height), new CGPoint(beer.GetMinX() + 0.08189f * beer.Width, beer.GetMinY() + 0.84290f * beer.Height), new CGPoint(beer.GetMinX() + 0.11789f * beer.Width, beer.GetMinY() + 0.37817f * beer.Height)); bezier4Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.72869f * beer.Width, beer.GetMinY() + 0.28120f * beer.Height), new CGPoint(beer.GetMinX() + 0.56915f * beer.Width, beer.GetMinY() + 0.27150f * beer.Height), new CGPoint(beer.GetMinX() + 0.72869f * beer.Width, beer.GetMinY() + 0.28120f * beer.Height)); bezier4Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.71951f * beer.Width, beer.GetMinY() + 0.56362f * beer.Height), new CGPoint(beer.GetMinX() + 0.72869f * beer.Width, beer.GetMinY() + 0.28120f * beer.Height), new CGPoint(beer.GetMinX() + 0.71951f * beer.Width, beer.GetMinY() + 0.43635f * beer.Height)); bezier4Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.73787f * beer.Width, beer.GetMinY() + 0.83756f * beer.Height), new CGPoint(beer.GetMinX() + 0.71951f * beer.Width, beer.GetMinY() + 0.69090f * beer.Height), new CGPoint(beer.GetMinX() + 0.73787f * beer.Width, beer.GetMinY() + 0.83756f * beer.Height)); bezier4Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.40593f * beer.Width, beer.GetMinY() + 0.88119f * beer.Height), new CGPoint(beer.GetMinX() + 0.73787f * beer.Width, beer.GetMinY() + 0.83756f * beer.Height), new CGPoint(beer.GetMinX() + 0.63538f * beer.Width, beer.GetMinY() + 0.88726f * beer.Height)); bezier4Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.08189f * beer.Width, beer.GetMinY() + 0.84290f * beer.Height), new CGPoint(beer.GetMinX() + 0.17648f * beer.Width, beer.GetMinY() + 0.87513f * beer.Height), new CGPoint(beer.GetMinX() + 0.08189f * beer.Width, beer.GetMinY() + 0.84290f * beer.Height)); bezier4Path.ClosePath(); bezier4Path.UsesEvenOddFillRule = true; fillColor4.SetFill(); bezier4Path.Fill(); UIBezierPath bezier5Path = new UIBezierPath(); bezier5Path.MoveTo(new CGPoint(beer.GetMinX() + 0.72835f * beer.Width, beer.GetMinY() + 0.29331f * beer.Height)); bezier5Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.72835f * beer.Width, beer.GetMinY() + 0.19362f * beer.Height)); bezier5Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.11621f * beer.Width, beer.GetMinY() + 0.19110f * beer.Height)); bezier5Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.11073f * beer.Width, beer.GetMinY() + 0.28260f * beer.Height)); bezier5Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.72835f * beer.Width, beer.GetMinY() + 0.29331f * beer.Height)); bezier5Path.ClosePath(); bezier5Path.UsesEvenOddFillRule = true; SimpleWhite.SetFill(); bezier5Path.Fill(); UIBezierPath bezier6Path = new UIBezierPath(); bezier6Path.MoveTo(new CGPoint(beer.GetMinX() + 0.07471f * beer.Width, beer.GetMinY() + 0.94603f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.40975f * beer.Width, beer.GetMinY() + 0.97479f * beer.Height), new CGPoint(beer.GetMinX() + 0.09876f * beer.Width, beer.GetMinY() + 0.95447f * beer.Height), new CGPoint(beer.GetMinX() + 0.18051f * beer.Width, beer.GetMinY() + 0.97479f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.73863f * beer.Width, beer.GetMinY() + 0.94607f * beer.Height), new CGPoint(beer.GetMinX() + 0.64454f * beer.Width, beer.GetMinY() + 0.97479f * beer.Height), new CGPoint(beer.GetMinX() + 0.71869f * beer.Width, beer.GetMinY() + 0.95411f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.72181f * beer.Width, beer.GetMinY() + 0.83863f * beer.Height), new CGPoint(beer.GetMinX() + 0.73399f * beer.Width, beer.GetMinY() + 0.92454f * beer.Height), new CGPoint(beer.GetMinX() + 0.72199f * beer.Width, beer.GetMinY() + 0.86626f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.70346f * beer.Width, beer.GetMinY() + 0.56681f * beer.Height), new CGPoint(beer.GetMinX() + 0.72051f * beer.Width, beer.GetMinY() + 0.82816f * beer.Height), new CGPoint(beer.GetMinX() + 0.70346f * beer.Width, beer.GetMinY() + 0.68784f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.70999f * beer.Width, beer.GetMinY() + 0.21141f * beer.Height), new CGPoint(beer.GetMinX() + 0.70346f * beer.Width, beer.GetMinY() + 0.45862f * beer.Height), new CGPoint(beer.GetMinX() + 0.70858f * beer.Width, beer.GetMinY() + 0.26290f * beer.Height)); bezier6Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.13157f * beer.Width, beer.GetMinY() + 0.20390f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.09795f * beer.Width, beer.GetMinY() + 0.84329f * beer.Height), new CGPoint(beer.GetMinX() + 0.12671f * beer.Width, beer.GetMinY() + 0.29022f * beer.Height), new CGPoint(beer.GetMinX() + 0.09795f * beer.Width, beer.GetMinY() + 0.80316f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.07471f * beer.Width, beer.GetMinY() + 0.94603f * beer.Height), new CGPoint(beer.GetMinX() + 0.09795f * beer.Width, beer.GetMinY() + 0.87907f * beer.Height), new CGPoint(beer.GetMinX() + 0.08216f * beer.Width, beer.GetMinY() + 0.92590f * beer.Height)); bezier6Path.ClosePath(); bezier6Path.MoveTo(new CGPoint(beer.GetMinX() + 0.40975f * beer.Width, beer.GetMinY() + 1.00000f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.04465f * beer.Width, beer.GetMinY() + 0.96119f * beer.Height), new CGPoint(beer.GetMinX() + 0.10624f * beer.Width, beer.GetMinY() + 1.00000f * beer.Height), new CGPoint(beer.GetMinX() + 0.05006f * beer.Width, beer.GetMinY() + 0.96517f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.04033f * beer.Width, beer.GetMinY() + 0.94815f * beer.Height), new CGPoint(beer.GetMinX() + 0.04013f * beer.Width, beer.GetMinY() + 0.95786f * beer.Height), new CGPoint(beer.GetMinX() + 0.03844f * beer.Width, beer.GetMinY() + 0.95279f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.06583f * beer.Width, beer.GetMinY() + 0.84329f * beer.Height), new CGPoint(beer.GetMinX() + 0.04059f * beer.Width, beer.GetMinY() + 0.94752f * beer.Height), new CGPoint(beer.GetMinX() + 0.06583f * beer.Width, beer.GetMinY() + 0.88517f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.10017f * beer.Width, beer.GetMinY() + 0.19054f * beer.Height), new CGPoint(beer.GetMinX() + 0.06583f * beer.Width, beer.GetMinY() + 0.79913f * beer.Height), new CGPoint(beer.GetMinX() + 0.09876f * beer.Width, beer.GetMinY() + 0.21537f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.11648f * beer.Width, beer.GetMinY() + 0.17850f * beer.Height), new CGPoint(beer.GetMinX() + 0.10055f * beer.Width, beer.GetMinY() + 0.18373f * beer.Height), new CGPoint(beer.GetMinX() + 0.10770f * beer.Width, beer.GetMinY() + 0.17845f * beer.Height)); bezier6Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.72667f * beer.Width, beer.GetMinY() + 0.18643f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.73798f * beer.Width, beer.GetMinY() + 0.19029f * beer.Height), new CGPoint(beer.GetMinX() + 0.73094f * beer.Width, beer.GetMinY() + 0.18648f * beer.Height), new CGPoint(beer.GetMinX() + 0.73501f * beer.Width, beer.GetMinY() + 0.18787f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.74246f * beer.Width, beer.GetMinY() + 0.19931f * beer.Height), new CGPoint(beer.GetMinX() + 0.74094f * beer.Width, beer.GetMinY() + 0.19271f * beer.Height), new CGPoint(beer.GetMinX() + 0.74255f * beer.Width, beer.GetMinY() + 0.19595f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.73559f * beer.Width, beer.GetMinY() + 0.56681f * beer.Height), new CGPoint(beer.GetMinX() + 0.74239f * beer.Width, beer.GetMinY() + 0.20172f * beer.Height), new CGPoint(beer.GetMinX() + 0.73559f * beer.Width, beer.GetMinY() + 0.44240f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.75155f * beer.Width, beer.GetMinY() + 0.81696f * beer.Height), new CGPoint(beer.GetMinX() + 0.73559f * beer.Width, beer.GetMinY() + 0.66362f * beer.Height), new CGPoint(beer.GetMinX() + 0.74661f * beer.Width, beer.GetMinY() + 0.77302f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.75393f * beer.Width, beer.GetMinY() + 0.82358f * beer.Height), new CGPoint(beer.GetMinX() + 0.75305f * beer.Width, beer.GetMinY() + 0.81888f * beer.Height), new CGPoint(beer.GetMinX() + 0.75393f * beer.Width, beer.GetMinY() + 0.82115f * beer.Height)); bezier6Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.75393f * beer.Width, beer.GetMinY() + 0.83800f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.77205f * beer.Width, beer.GetMinY() + 0.94980f * beer.Height), new CGPoint(beer.GetMinX() + 0.75393f * beer.Width, beer.GetMinY() + 0.86897f * beer.Height), new CGPoint(beer.GetMinX() + 0.77186f * beer.Width, beer.GetMinY() + 0.94900f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.76818f * beer.Width, beer.GetMinY() + 0.96041f * beer.Height), new CGPoint(beer.GetMinX() + 0.77291f * beer.Width, beer.GetMinY() + 0.95363f * beer.Height), new CGPoint(beer.GetMinX() + 0.77148f * beer.Width, beer.GetMinY() + 0.95754f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.40975f * beer.Width, beer.GetMinY() + 1.00000f * beer.Height), new CGPoint(beer.GetMinX() + 0.76061f * beer.Width, beer.GetMinY() + 0.96702f * beer.Height), new CGPoint(beer.GetMinX() + 0.70776f * beer.Width, beer.GetMinY() + 1.00000f * beer.Height)); bezier6Path.ClosePath(); bezier6Path.UsesEvenOddFillRule = true; SimpleWhite.SetFill(); bezier6Path.Fill(); UIBezierPath bezier7Path = new UIBezierPath(); bezier7Path.MoveTo(new CGPoint(beer.GetMinX() + 0.70988f * beer.Width, beer.GetMinY() + 0.21792f * beer.Height)); bezier7Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.13068f * beer.Width, beer.GetMinY() + 0.21792f * beer.Height)); bezier7Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.13068f * beer.Width, beer.GetMinY() + 0.16404f * beer.Height)); bezier7Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.70988f * beer.Width, beer.GetMinY() + 0.17446f * beer.Height)); bezier7Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.70988f * beer.Width, beer.GetMinY() + 0.21792f * beer.Height)); bezier7Path.ClosePath(); bezier7Path.UsesEvenOddFillRule = true; SimpleWhite.SetFill(); bezier7Path.Fill(); var oval6Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.42910f + 0.1f) + 0.4f, beer.GetMinY() + NMath.Floor(beer.Height * 0.65196f - 0.45f) + 0.95f, NMath.Floor(beer.Width * 0.48175f + 0.5f) - NMath.Floor(beer.Width * 0.42910f + 0.1f) - 0.4f, NMath.Floor(beer.Height * 0.69226f - 0.05f) - NMath.Floor(beer.Height * 0.65196f - 0.45f) - 0.4f)); fillColor9.SetFill(); oval6Path.Fill(); var oval7Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.34542f - 0.05f) + 0.55f, beer.GetMinY() + NMath.Floor(beer.Height * 0.55521f - 0.3f) + 0.8f, NMath.Floor(beer.Width * 0.42091f - 0.25f) - NMath.Floor(beer.Width * 0.34542f - 0.05f) + 0.2f, NMath.Floor(beer.Height * 0.61300f + 0.5f) - NMath.Floor(beer.Height * 0.55521f - 0.3f) - 0.8f)); fillColor9.SetFill(); oval7Path.Fill(); var oval8Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.14651f) + 0.5f, beer.GetMinY() + NMath.Floor(beer.Height * 0.76810f - 0.4f) + 0.9f, NMath.Floor(beer.Width * 0.23144f - 0.1f) - NMath.Floor(beer.Width * 0.14651f) + 0.1f, NMath.Floor(beer.Height * 0.83311f + 0.5f) - NMath.Floor(beer.Height * 0.76810f - 0.4f) - 0.9f)); fillColor9.SetFill(); oval8Path.Fill(); var oval9Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.61162f + 0.35f) + 0.15f, beer.GetMinY() + NMath.Floor(beer.Height * 0.74700f + 0.05f) + 0.45f, NMath.Floor(beer.Width * 0.66725f + 0.15f) - NMath.Floor(beer.Width * 0.61162f + 0.35f) + 0.2f, NMath.Floor(beer.Height * 0.78920f - 0.05f) - NMath.Floor(beer.Height * 0.74700f + 0.05f) + 0.1f)); fillColor9.SetFill(); oval9Path.Fill(); var oval10Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.56891f - 0.05f) + 0.55f, beer.GetMinY() + NMath.Floor(beer.Height * 0.62250f + 0.2f) + 0.3f, NMath.Floor(beer.Width * 0.63348f - 0.05f) - NMath.Floor(beer.Width * 0.56891f - 0.05f), NMath.Floor(beer.Height * 0.67192f + 0.2f) - NMath.Floor(beer.Height * 0.62250f + 0.2f))); fillColor9.SetFill(); oval10Path.Fill(); var oval11Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.34393f + 0.25f) + 0.25f, beer.GetMinY() + NMath.Floor(beer.Height * 0.75631f + 0.2f) + 0.3f, NMath.Floor(beer.Width * 0.42240f + 0.45f) - NMath.Floor(beer.Width * 0.34393f + 0.25f) - 0.2f, NMath.Floor(beer.Height * 0.81638f + 0.4f) - NMath.Floor(beer.Height * 0.75631f + 0.2f) - 0.2f)); fillColor9.SetFill(); oval11Path.Fill(); var oval12Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.61162f + 0.35f) + 0.15f, beer.GetMinY() + NMath.Floor(beer.Height * 0.43661f + 0.5f) + 0.0f, NMath.Floor(beer.Width * 0.64242f + 0.15f) - NMath.Floor(beer.Width * 0.61162f + 0.35f) + 0.2f, NMath.Floor(beer.Height * 0.46018f + 0.3f) - NMath.Floor(beer.Height * 0.43661f + 0.5f) + 0.2f)); fillColor9.SetFill(); oval12Path.Fill(); var oval13Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.22821f - 0.45f) + 0.95f, beer.GetMinY() + NMath.Floor(beer.Height * 0.42482f + 0.4f) + 0.1f, NMath.Floor(beer.Width * 0.25900f + 0.35f) - NMath.Floor(beer.Width * 0.22821f - 0.45f) - 0.8f, NMath.Floor(beer.Height * 0.44839f + 0.2f) - NMath.Floor(beer.Height * 0.42482f + 0.4f) + 0.2f)); fillColor9.SetFill(); oval13Path.Fill(); var oval14Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.43705f + 0.5f), beer.GetMinY() + NMath.Floor(beer.Height * 0.44820f - 0.45f) + 0.95f, NMath.Floor(beer.Width * 0.46784f + 0.3f) - NMath.Floor(beer.Width * 0.43705f + 0.5f) + 0.2f, NMath.Floor(beer.Height * 0.47177f + 0.35f) - NMath.Floor(beer.Height * 0.44820f - 0.45f) - 0.8f)); fillColor9.SetFill(); oval14Path.Fill(); var oval15Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.15818f - 0.35f) + 0.85f, beer.GetMinY() + NMath.Floor(beer.Height * 0.50940f - 0.35f) + 0.85f, NMath.Floor(beer.Width * 0.18897f + 0.45f) - NMath.Floor(beer.Width * 0.15818f - 0.35f) - 0.8f, NMath.Floor(beer.Height * 0.53297f + 0.45f) - NMath.Floor(beer.Height * 0.50940f - 0.35f) - 0.8f)); fillColor9.SetFill(); oval15Path.Fill(); var oval16Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.52794f + 0.2f) + 0.3f, beer.GetMinY() + NMath.Floor(beer.Height * 0.52803f - 0.45f) + 0.95f, NMath.Floor(beer.Width * 0.55873f) - NMath.Floor(beer.Width * 0.52794f + 0.2f) + 0.2f, NMath.Floor(beer.Height * 0.55160f + 0.35f) - NMath.Floor(beer.Height * 0.52803f - 0.45f) - 0.8f)); fillColor9.SetFill(); oval16Path.Fill(); var oval17Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.25875f + 0.4f) + 0.1f, beer.GetMinY() + NMath.Floor(beer.Height * 0.69207f - 0.3f) + 0.8f, NMath.Floor(beer.Width * 0.28955f + 0.2f) - NMath.Floor(beer.Width * 0.25875f + 0.4f) + 0.2f, NMath.Floor(beer.Height * 0.71564f + 0.5f) - NMath.Floor(beer.Height * 0.69207f - 0.3f) - 0.8f)); fillColor9.SetFill(); oval17Path.Fill(); var oval18Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.50013f - 0.2f) + 0.7f, beer.GetMinY() + NMath.Floor(beer.Height * 0.81638f - 0.1f) + 0.6f, NMath.Floor(beer.Width * 0.54333f + 0.1f) - NMath.Floor(beer.Width * 0.50013f - 0.2f) - 0.3f, NMath.Floor(beer.Height * 0.84945f + 0.2f) - NMath.Floor(beer.Height * 0.81638f - 0.1f) - 0.3f)); fillColor9.SetFill(); oval18Path.Fill(); var oval19Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.20512f + 0.2f) + 0.3f, beer.GetMinY() + NMath.Floor(beer.Height * 0.55863f - 0.0f) + 0.5f, NMath.Floor(beer.Width * 0.25776f - 0.4f) - NMath.Floor(beer.Width * 0.20512f + 0.2f) + 0.6f, NMath.Floor(beer.Height * 0.59893f + 0.4f) - NMath.Floor(beer.Height * 0.55863f - 0.0f) - 0.4f)); fillColor9.SetFill(); oval19Path.Fill(); var oval20Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.55004f - 0.25f) + 0.75f, beer.GetMinY() + NMath.Floor(beer.Height * 0.07318f + 0.2f) + 0.3f, NMath.Floor(beer.Width * 0.73628f + 0.25f) - NMath.Floor(beer.Width * 0.55004f - 0.25f) - 0.5f, NMath.Floor(beer.Height * 0.21954f - 0.3f) - NMath.Floor(beer.Height * 0.07318f + 0.2f) + 0.5f)); OffWhite.SetFill(); oval20Path.Fill(); var oval21Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.52148f + 0.5f), beer.GetMinY() + NMath.Floor(beer.Height * 0.11272f - 0.4f) + 0.9f, NMath.Floor(beer.Width * 0.70772f) - NMath.Floor(beer.Width * 0.52148f + 0.5f) + 0.5f, NMath.Floor(beer.Height * 0.25907f + 0.1f) - NMath.Floor(beer.Height * 0.11272f - 0.4f) - 0.5f)); OffWhite.SetFill(); oval21Path.Fill(); var oval22Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.45568f - 0.25f) + 0.75f, beer.GetMinY() + NMath.Floor(beer.Height * 0.01673f + 0.35f) + 0.15f, NMath.Floor(beer.Width * 0.64192f + 0.25f) - NMath.Floor(beer.Width * 0.45568f - 0.25f) - 0.5f, NMath.Floor(beer.Height * 0.16309f - 0.15f) - NMath.Floor(beer.Height * 0.01673f + 0.35f) + 0.5f)); OffWhite.SetFill(); oval22Path.Fill(); var oval23Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.30097f - 0.1f) + 0.6f, beer.GetMinY() + NMath.Floor(beer.Height * 0.00000f - 0.05f) + 0.55f, NMath.Floor(beer.Width * 0.48721f + 0.4f) - NMath.Floor(beer.Width * 0.30097f - 0.1f) - 0.5f, NMath.Floor(beer.Height * 0.14636f + 0.45f) - NMath.Floor(beer.Height * 0.00000f - 0.05f) - 0.5f)); OffWhite.SetFill(); oval23Path.Fill(); var oval24Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.15843f - 0.4f) + 0.9f, beer.GetMinY() + NMath.Floor(beer.Height * 0.01178f + 0.05f) + 0.45f, NMath.Floor(beer.Width * 0.34467f + 0.1f) - NMath.Floor(beer.Width * 0.15843f - 0.4f) - 0.5f, NMath.Floor(beer.Height * 0.15814f - 0.45f) - NMath.Floor(beer.Height * 0.01178f + 0.05f) + 0.5f)); OffWhite.SetFill(); oval24Path.Fill(); var oval25Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.23169f - 0.15f) + 0.65f, beer.GetMinY() + NMath.Floor(beer.Height * 0.14199f + 0.3f) + 0.2f, NMath.Floor(beer.Width * 0.41793f + 0.35f) - NMath.Floor(beer.Width * 0.23169f - 0.15f) - 0.5f, NMath.Floor(beer.Height * 0.28835f - 0.2f) - NMath.Floor(beer.Height * 0.14199f + 0.3f) + 0.5f)); OffWhite.SetFill(); oval25Path.Fill(); var oval26Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.25329f + 0.5f), beer.GetMinY() + NMath.Floor(beer.Height * 0.09504f - 0.05f) + 0.55f, NMath.Floor(beer.Width * 0.43953f) - NMath.Floor(beer.Width * 0.25329f + 0.5f) + 0.5f, NMath.Floor(beer.Height * 0.24140f + 0.45f) - NMath.Floor(beer.Height * 0.09504f - 0.05f) - 0.5f)); OffWhite.SetFill(); oval26Path.Fill(); var oval27Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.12218f - 0.1f) + 0.6f, beer.GetMinY() + NMath.Floor(beer.Height * 0.09504f - 0.05f) + 0.55f, NMath.Floor(beer.Width * 0.30842f + 0.4f) - NMath.Floor(beer.Width * 0.12218f - 0.1f) - 0.5f, NMath.Floor(beer.Height * 0.24140f + 0.45f) - NMath.Floor(beer.Height * 0.09504f - 0.05f) - 0.5f)); OffWhite.SetFill(); oval27Path.Fill(); var oval28Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.36702f - 0.4f) + 0.9f, beer.GetMinY() + NMath.Floor(beer.Height * 0.10910f - 0.35f) + 0.85f, NMath.Floor(beer.Width * 0.55327f + 0.1f) - NMath.Floor(beer.Width * 0.36702f - 0.4f) - 0.5f, NMath.Floor(beer.Height * 0.25546f + 0.15f) - NMath.Floor(beer.Height * 0.10910f - 0.35f) - 0.5f)); OffWhite.SetFill(); oval28Path.Fill(); } }
public override void DrawRect(RectangleF area, UIViewPrintFormatter formatter) { base.DrawRect(area, formatter); //General Declarations CGContext context = UIGraphics.GetCurrentContext(); // Color Declarations UIColor mmFill = new UIColor(0F, 0F, 0F, 0.196F); UIColor shape1DropShadowColor = new UIColor(1F, 1F, 1F, 0.4F); UIColor shape1InnerShadowColor = new UIColor(0F, 0F, 0F, 0.392F); // Shadow Declarations UIColor mmDropShadow = shape1DropShadowColor; SizeF mmDropShadowOffset = new SizeF(0.1F, 1.1F); Single mmDropShadowBlurRadius = 0; UIColor mmInnerShadow = shape1InnerShadowColor; SizeF mmInnerShadowOffset = new SizeF(0.1F, 1.1F); Single mmInnerShadowBlurRadius = 0; // Frames RectangleF frame = this.Bounds; // mmGroup { // mmShape Drawing UIBezierPath mmShapePath = new UIBezierPath(); mmShapePath.MoveTo(new PointF(frame.GetMinX() + 0.51759F * frame.Width, frame.GetMinY() + 0.96761F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.37558F * frame.Width, frame.GetMinY() + 0.91398F * frame.Height), new PointF(frame.GetMinX() + 0.46395F * frame.Width, frame.GetMinY() + 0.96761F * frame.Height), new PointF(frame.GetMinX() + 0.41351F * frame.Width, frame.GetMinY() + 0.94854F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.31759F * frame.Width, frame.GetMinY() + 0.76824F * frame.Height), new PointF(frame.GetMinX() + 0.33346F * frame.Width, frame.GetMinY() + 0.87556F * frame.Height), new PointF(frame.GetMinX() + 0.31234F * frame.Width, frame.GetMinY() + 0.82249F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.31904F * frame.Width, frame.GetMinY() + 0.75325F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.30262F * frame.Width, frame.GetMinY() + 0.75459F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.28470F * frame.Width, frame.GetMinY() + 0.75535F * frame.Height), new PointF(frame.GetMinX() + 0.29666F * frame.Width, frame.GetMinY() + 0.75510F * frame.Height), new PointF(frame.GetMinX() + 0.29065F * frame.Width, frame.GetMinY() + 0.75535F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.14274F * frame.Width, frame.GetMinY() + 0.70173F * frame.Height), new PointF(frame.GetMinX() + 0.23106F * frame.Width, frame.GetMinY() + 0.75535F * frame.Height), new PointF(frame.GetMinX() + 0.18067F * frame.Width, frame.GetMinY() + 0.73625F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.14274F * frame.Width, frame.GetMinY() + 0.44291F * frame.Height), new PointF(frame.GetMinX() + 0.06451F * frame.Width, frame.GetMinY() + 0.63038F * frame.Height), new PointF(frame.GetMinX() + 0.06451F * frame.Width, frame.GetMinY() + 0.51425F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.45528F * frame.Width, frame.GetMinY() + 0.15799F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.48085F * frame.Width, frame.GetMinY() + 0.14832F * frame.Height), new PointF(frame.GetMinX() + 0.46207F * frame.Width, frame.GetMinY() + 0.15176F * frame.Height), new PointF(frame.GetMinX() + 0.47120F * frame.Width, frame.GetMinY() + 0.14832F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.50639F * frame.Width, frame.GetMinY() + 0.15799F * frame.Height), new PointF(frame.GetMinX() + 0.49051F * frame.Width, frame.GetMinY() + 0.14832F * frame.Height), new PointF(frame.GetMinX() + 0.49957F * frame.Width, frame.GetMinY() + 0.15176F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.50639F * frame.Width, frame.GetMinY() + 0.20462F * frame.Height), new PointF(frame.GetMinX() + 0.52050F * frame.Width, frame.GetMinY() + 0.17087F * frame.Height), new PointF(frame.GetMinX() + 0.52050F * frame.Width, frame.GetMinY() + 0.19177F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.19390F * frame.Width, frame.GetMinY() + 0.48951F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.19386F * frame.Width, frame.GetMinY() + 0.65510F * frame.Height), new PointF(frame.GetMinX() + 0.14397F * frame.Width, frame.GetMinY() + 0.53518F * frame.Height), new PointF(frame.GetMinX() + 0.14397F * frame.Width, frame.GetMinY() + 0.60942F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.28476F * frame.Width, frame.GetMinY() + 0.68936F * frame.Height), new PointF(frame.GetMinX() + 0.21821F * frame.Width, frame.GetMinY() + 0.67720F * frame.Height), new PointF(frame.GetMinX() + 0.25047F * frame.Width, frame.GetMinY() + 0.68936F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.37557F * frame.Width, frame.GetMinY() + 0.65514F * frame.Height), new PointF(frame.GetMinX() + 0.31904F * frame.Width, frame.GetMinY() + 0.68936F * frame.Height), new PointF(frame.GetMinX() + 0.35128F * frame.Width, frame.GetMinY() + 0.67720F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.68812F * frame.Width, frame.GetMinY() + 0.37025F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.71365F * frame.Width, frame.GetMinY() + 0.36056F * frame.Height), new PointF(frame.GetMinX() + 0.69491F * frame.Width, frame.GetMinY() + 0.36401F * frame.Height), new PointF(frame.GetMinX() + 0.70403F * frame.Width, frame.GetMinY() + 0.36056F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.73923F * frame.Width, frame.GetMinY() + 0.37025F * frame.Height), new PointF(frame.GetMinX() + 0.72332F * frame.Width, frame.GetMinY() + 0.36056F * frame.Height), new PointF(frame.GetMinX() + 0.73241F * frame.Width, frame.GetMinY() + 0.36401F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.73923F * frame.Width, frame.GetMinY() + 0.41681F * frame.Height), new PointF(frame.GetMinX() + 0.75333F * frame.Width, frame.GetMinY() + 0.38310F * frame.Height), new PointF(frame.GetMinX() + 0.75333F * frame.Width, frame.GetMinY() + 0.40399F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.42673F * frame.Width, frame.GetMinY() + 0.70173F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.42670F * frame.Width, frame.GetMinY() + 0.86737F * frame.Height), new PointF(frame.GetMinX() + 0.37681F * frame.Width, frame.GetMinY() + 0.74744F * frame.Height), new PointF(frame.GetMinX() + 0.37681F * frame.Width, frame.GetMinY() + 0.82172F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.51759F * frame.Width, frame.GetMinY() + 0.90159F * frame.Height), new PointF(frame.GetMinX() + 0.45104F * frame.Width, frame.GetMinY() + 0.88944F * frame.Height), new PointF(frame.GetMinX() + 0.48328F * frame.Width, frame.GetMinY() + 0.90159F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.60840F * frame.Width, frame.GetMinY() + 0.86743F * frame.Height), new PointF(frame.GetMinX() + 0.55183F * frame.Width, frame.GetMinY() + 0.90159F * frame.Height), new PointF(frame.GetMinX() + 0.58413F * frame.Width, frame.GetMinY() + 0.88944F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.92092F * frame.Width, frame.GetMinY() + 0.58246F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.94646F * frame.Width, frame.GetMinY() + 0.57284F * frame.Height), new PointF(frame.GetMinX() + 0.92773F * frame.Width, frame.GetMinY() + 0.57623F * frame.Height), new PointF(frame.GetMinX() + 0.93682F * frame.Width, frame.GetMinY() + 0.57284F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.97208F * frame.Width, frame.GetMinY() + 0.58246F * frame.Height), new PointF(frame.GetMinX() + 0.95617F * frame.Width, frame.GetMinY() + 0.57284F * frame.Height), new PointF(frame.GetMinX() + 0.96523F * frame.Width, frame.GetMinY() + 0.57623F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.97208F * frame.Width, frame.GetMinY() + 0.62912F * frame.Height), new PointF(frame.GetMinX() + 0.98615F * frame.Width, frame.GetMinY() + 0.59535F * frame.Height), new PointF(frame.GetMinX() + 0.98615F * frame.Width, frame.GetMinY() + 0.61626F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.65956F * frame.Width, frame.GetMinY() + 0.91398F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.51759F * frame.Width, frame.GetMinY() + 0.96761F * frame.Height), new PointF(frame.GetMinX() + 0.62160F * frame.Width, frame.GetMinY() + 0.94854F * frame.Height), new PointF(frame.GetMinX() + 0.57117F * frame.Width, frame.GetMinY() + 0.96761F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.51759F * frame.Width, frame.GetMinY() + 0.96761F * frame.Height)); mmShapePath.ClosePath(); mmShapePath.MoveTo(new PointF(frame.GetMinX() + 0.51965F * frame.Width, frame.GetMinY() + 0.81940F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.49408F * frame.Width, frame.GetMinY() + 0.80982F * frame.Height), new PointF(frame.GetMinX() + 0.50999F * frame.Width, frame.GetMinY() + 0.81940F * frame.Height), new PointF(frame.GetMinX() + 0.50091F * frame.Width, frame.GetMinY() + 0.81600F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.49408F * frame.Width, frame.GetMinY() + 0.76313F * frame.Height), new PointF(frame.GetMinX() + 0.48000F * frame.Width, frame.GetMinY() + 0.79686F * frame.Height), new PointF(frame.GetMinX() + 0.48000F * frame.Width, frame.GetMinY() + 0.77600F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.80659F * frame.Width, frame.GetMinY() + 0.47824F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.80662F * frame.Width, frame.GetMinY() + 0.31264F * frame.Height), new PointF(frame.GetMinX() + 0.85650F * frame.Width, frame.GetMinY() + 0.43259F * frame.Height), new PointF(frame.GetMinX() + 0.85650F * frame.Width, frame.GetMinY() + 0.35831F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.71574F * frame.Width, frame.GetMinY() + 0.27840F * frame.Height), new PointF(frame.GetMinX() + 0.78226F * frame.Width, frame.GetMinY() + 0.29053F * frame.Height), new PointF(frame.GetMinX() + 0.75001F * frame.Width, frame.GetMinY() + 0.27840F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.62493F * frame.Width, frame.GetMinY() + 0.31260F * frame.Height), new PointF(frame.GetMinX() + 0.68146F * frame.Width, frame.GetMinY() + 0.27840F * frame.Height), new PointF(frame.GetMinX() + 0.64921F * frame.Width, frame.GetMinY() + 0.29053F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.31239F * frame.Width, frame.GetMinY() + 0.59752F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.28684F * frame.Width, frame.GetMinY() + 0.60718F * frame.Height), new PointF(frame.GetMinX() + 0.30556F * frame.Width, frame.GetMinY() + 0.60378F * frame.Height), new PointF(frame.GetMinX() + 0.29644F * frame.Width, frame.GetMinY() + 0.60718F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.26125F * frame.Width, frame.GetMinY() + 0.59752F * frame.Height), new PointF(frame.GetMinX() + 0.27718F * frame.Width, frame.GetMinY() + 0.60718F * frame.Height), new PointF(frame.GetMinX() + 0.26808F * frame.Width, frame.GetMinY() + 0.60378F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.26125F * frame.Width, frame.GetMinY() + 0.55093F * frame.Height), new PointF(frame.GetMinX() + 0.24715F * frame.Width, frame.GetMinY() + 0.58467F * frame.Height), new PointF(frame.GetMinX() + 0.24715F * frame.Width, frame.GetMinY() + 0.56377F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.57377F * frame.Width, frame.GetMinY() + 0.26601F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.57380F * frame.Width, frame.GetMinY() + 0.10041F * frame.Height), new PointF(frame.GetMinX() + 0.62368F * frame.Width, frame.GetMinY() + 0.22029F * frame.Height), new PointF(frame.GetMinX() + 0.62368F * frame.Width, frame.GetMinY() + 0.14606F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.48291F * frame.Width, frame.GetMinY() + 0.06617F * frame.Height), new PointF(frame.GetMinX() + 0.54946F * frame.Width, frame.GetMinY() + 0.07832F * frame.Height), new PointF(frame.GetMinX() + 0.51721F * frame.Width, frame.GetMinY() + 0.06617F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.39208F * frame.Width, frame.GetMinY() + 0.10040F * frame.Height), new PointF(frame.GetMinX() + 0.44863F * frame.Width, frame.GetMinY() + 0.06617F * frame.Height), new PointF(frame.GetMinX() + 0.41637F * frame.Width, frame.GetMinY() + 0.07832F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.07956F * frame.Width, frame.GetMinY() + 0.38530F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.05400F * frame.Width, frame.GetMinY() + 0.39496F * frame.Height), new PointF(frame.GetMinX() + 0.07274F * frame.Width, frame.GetMinY() + 0.39149F * frame.Height), new PointF(frame.GetMinX() + 0.06365F * frame.Width, frame.GetMinY() + 0.39496F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.02841F * frame.Width, frame.GetMinY() + 0.38530F * frame.Height), new PointF(frame.GetMinX() + 0.04434F * frame.Width, frame.GetMinY() + 0.39496F * frame.Height), new PointF(frame.GetMinX() + 0.03525F * frame.Width, frame.GetMinY() + 0.39149F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.02841F * frame.Width, frame.GetMinY() + 0.33867F * frame.Height), new PointF(frame.GetMinX() + 0.01434F * frame.Width, frame.GetMinY() + 0.37241F * frame.Height), new PointF(frame.GetMinX() + 0.01434F * frame.Width, frame.GetMinY() + 0.35151F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.34095F * frame.Width, frame.GetMinY() + 0.05378F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.48291F * frame.Width, frame.GetMinY() + 0.00013F * frame.Height), new PointF(frame.GetMinX() + 0.37888F * frame.Width, frame.GetMinY() + 0.01919F * frame.Height), new PointF(frame.GetMinX() + 0.42931F * frame.Width, frame.GetMinY() + 0.00013F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.62491F * frame.Width, frame.GetMinY() + 0.05378F * frame.Height), new PointF(frame.GetMinX() + 0.53657F * frame.Width, frame.GetMinY() + 0.00013F * frame.Height), new PointF(frame.GetMinX() + 0.58700F * frame.Width, frame.GetMinY() + 0.01919F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.68292F * frame.Width, frame.GetMinY() + 0.19950F * frame.Height), new PointF(frame.GetMinX() + 0.66705F * frame.Width, frame.GetMinY() + 0.09219F * frame.Height), new PointF(frame.GetMinX() + 0.68815F * frame.Width, frame.GetMinY() + 0.14529F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.68143F * frame.Width, frame.GetMinY() + 0.21454F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.69786F * frame.Width, frame.GetMinY() + 0.21318F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.71580F * frame.Width, frame.GetMinY() + 0.21244F * frame.Height), new PointF(frame.GetMinX() + 0.70379F * frame.Width, frame.GetMinY() + 0.21269F * frame.Height), new PointF(frame.GetMinX() + 0.70984F * frame.Width, frame.GetMinY() + 0.21244F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.85774F * frame.Width, frame.GetMinY() + 0.26604F * frame.Height), new PointF(frame.GetMinX() + 0.76941F * frame.Width, frame.GetMinY() + 0.21244F * frame.Height), new PointF(frame.GetMinX() + 0.81981F * frame.Width, frame.GetMinY() + 0.23147F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.85774F * frame.Width, frame.GetMinY() + 0.52485F * frame.Height), new PointF(frame.GetMinX() + 0.93599F * frame.Width, frame.GetMinY() + 0.33738F * frame.Height), new PointF(frame.GetMinX() + 0.93599F * frame.Width, frame.GetMinY() + 0.45349F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.54521F * frame.Width, frame.GetMinY() + 0.80977F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.51965F * frame.Width, frame.GetMinY() + 0.81940F * frame.Height), new PointF(frame.GetMinX() + 0.53840F * frame.Width, frame.GetMinY() + 0.81600F * frame.Height), new PointF(frame.GetMinX() + 0.52930F * frame.Width, frame.GetMinY() + 0.81940F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.51965F * frame.Width, frame.GetMinY() + 0.81940F * frame.Height)); mmShapePath.ClosePath(); context.SaveState(); context.SetShadowWithColor(mmDropShadowOffset, mmDropShadowBlurRadius, mmDropShadow.CGColor); context.SetBlendMode(CGBlendMode.Overlay); mmFill.SetFill(); mmShapePath.Fill(); RectangleF mmShapeBorderRect = RectangleF.Inflate(mmShapePath.Bounds, mmInnerShadowBlurRadius, mmInnerShadowBlurRadius); mmShapeBorderRect.Offset(mmInnerShadowOffset.Width, mmInnerShadowOffset.Height); mmShapeBorderRect.UnionWith(mmShapePath.Bounds); UIBezierPath mmShapeNegativePath = UIBezierPath.FromRect(mmShapeBorderRect); mmShapeNegativePath.AppendPath(mmShapePath); mmShapeNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { Single xOffset = mmInnerShadowOffset.Width + (float)Math.Round(mmShapeBorderRect.Size.Width); Single yOffset = mmInnerShadowOffset.Height; context.SetShadowWithColor(new SizeF(xOffset + CopySign(0.1F, xOffset), yOffset + CopySign(0.1F, yOffset)), mmInnerShadowBlurRadius, mmInnerShadow.CGColor); mmShapePath.AddClip(); CGAffineTransform transform = CGAffineTransform.MakeTranslation((float)-Math.Round(mmShapeBorderRect.Size.Width), 0F); mmShapeNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); mmShapeNegativePath.Fill(); } context.RestoreState(); context.RestoreState(); } }