static void DrawXamagram() { var context = UIGraphics.GetCurrentContext(); var color = UIColor.FromRGBA(0.204f, 0.600f, 0.863f, 1.000f); context.SaveState(); context.TranslateCTM(257.0f, 257.0f); context.RotateCTM(90.0f * (nfloat)Math.PI / 180.0f); var polygonPath = new UIBezierPath(); polygonPath.MoveTo(new PointF(0.0f, -250.0f)); polygonPath.AddLineTo(new PointF(216.51f, -125.0f)); polygonPath.AddLineTo(new PointF(216.51f, 125.0f)); polygonPath.AddLineTo(new PointF(0.0f, 250.0f)); polygonPath.AddLineTo(new PointF(-216.51f, 125.0f)); polygonPath.AddLineTo(new PointF(-216.51f, -125.0f)); polygonPath.ClosePath(); color.SetFill(); polygonPath.Fill(); context.RestoreState(); var textRect = new RectangleF(0.0f, 0.0f, 512.0f, 512.0f); var textContent = "X"; UIColor.White.SetFill(); var textFont = UIFont.FromName("Helvetica", 350.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); }
public void DrawCross(CGContext ctx) { //// cross Drawing UIBezierPath crossPath = new UIBezierPath(); crossPath.MoveTo(new CGPoint(35.85f, 12.39f)); crossPath.AddLineTo(new CGPoint(31.61f, 8.15f)); crossPath.AddLineTo(new CGPoint(22.0f, 18.09f)); crossPath.AddLineTo(new CGPoint(12.39f, 8.15f)); crossPath.AddLineTo(new CGPoint(8.15f, 12.39f)); crossPath.AddLineTo(new CGPoint(17.76f, 22.0f)); crossPath.AddLineTo(new CGPoint(8.15f, 31.61f)); crossPath.AddLineTo(new CGPoint(12.39f, 35.85f)); crossPath.AddLineTo(new CGPoint(22.0f, 26.24f)); crossPath.AddLineTo(new CGPoint(31.61f, 35.85f)); crossPath.AddLineTo(new CGPoint(35.85f, 31.61f)); crossPath.AddLineTo(new CGPoint(26.24f, 22.0f)); crossPath.AddLineTo(new CGPoint(35.85f, 12.39f)); crossPath.ClosePath(); crossPath.MiterLimit = 4.0f; crossPath.Fill(); // Border //slCrossBGLayer.StrokeColor = this._colorPaths.CGColor; //slCrossBGLayer.LineWidth = 1.0f; }
public override void DrawRect (System.Drawing.RectangleF area, UIViewPrintFormatter formatter) { base.DrawRect (area, formatter); CGContext context = UIGraphics.GetCurrentContext (); UIColor shadow; shadow = UIColor.Clear; UIColor chevronColor = this.Color; SizeF shadowOffset = new SizeF (0.1F, 1.1F); Single shadowBlurRadius = 0F; RectangleF frame = new RectangleF (this.Bounds.X, this.Bounds.Y, this.Bounds.Width, this.Bounds.Height); UIBezierPath chevronPath = new UIBezierPath (); chevronPath.MoveTo (new PointF (frame.GetMinX () + 0.22000F * frame.Width, frame.GetMinY () + 0.01667F * frame.Height)); chevronPath.AddLineTo (new PointF (frame.GetMinX() + 0.98000F * frame.Width, frame.GetMinY() + 0.48333F * frame.Height)); chevronPath.AddLineTo (new PointF (frame.GetMinX() + 0.22000F * frame.Width, frame.GetMinY() + 0.98333F * frame.Height)); chevronPath.AddLineTo (new PointF (frame.GetMinX() + 0.02000F * frame.Width, frame.GetMinY() + 0.81667F * frame.Height)); chevronPath.AddLineTo (new PointF (frame.GetMinX() + 0.54000F * frame.Width, frame.GetMinY() + 0.48333F * frame.Height)); chevronPath.AddLineTo (new PointF (frame.GetMinX() + 0.02000F * frame.Width, frame.GetMinY() + 0.15000F * frame.Height)); chevronPath.AddLineTo (new PointF (frame.GetMinX() + 0.22000F * frame.Width, frame.GetMinY() + 0.01667F * frame.Height)); chevronPath.ClosePath (); context.SaveState (); context.SetShadowWithColor (shadowOffset, shadowBlurRadius, shadow.CGColor); chevronColor.SetFill (); chevronPath.Fill (); context.RestoreState (); }
// 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(); }
public static UIImage MakeBackArrow() { bool retina = (UIScreen.MainScreen.Scale > 1.0); if (retina) { UIGraphics.BeginImageContext (new System.Drawing.SizeF (44, 44)); //BEGIN PAINTCODE RETINA //// Color Declarations UIColor gradient2Color = UIColor.FromRGBA(0.018f, 0.324f, 0.969f, 1.000f); //// Bezier 5 Drawing UIBezierPath bezier5Path = new UIBezierPath(); bezier5Path.MoveTo(new PointF(14.5f, 16.31f)); bezier5Path.AddLineTo(new PointF(39.5f, 16.31f)); bezier5Path.AddLineTo(new PointF(39.5f, 26.69f)); bezier5Path.AddLineTo(new PointF(14.5f, 26.69f)); bezier5Path.AddLineTo(new PointF(14.5f, 41.5f)); bezier5Path.AddLineTo(new PointF(2.5f, 20.32f)); bezier5Path.AddLineTo(new PointF(14.5f, 1.5f)); bezier5Path.AddLineTo(new PointF(14.5f, 16.31f)); bezier5Path.ClosePath(); gradient2Color.SetFill(); bezier5Path.Fill(); gradient2Color.SetStroke(); bezier5Path.LineWidth = 1; bezier5Path.Stroke(); //END PAINTCODE RETINA } else { UIGraphics.BeginImageContext (new System.Drawing.SizeF (22, 22)); //start paintcode NON RETINA //// Color Declarations UIColor gradient2Color = UIColor.FromRGBA(0.018f, 0.324f, 0.969f, 1.000f); //// Bezier 5 Drawing UIBezierPath bezier5Path = new UIBezierPath(); bezier5Path.MoveTo(new PointF(7.99f, 8.91f)); bezier5Path.AddLineTo(new PointF(21.5f, 8.91f)); bezier5Path.AddLineTo(new PointF(21.5f, 14.09f)); bezier5Path.AddLineTo(new PointF(7.99f, 14.09f)); bezier5Path.AddLineTo(new PointF(7.5f, 20.5f)); bezier5Path.AddLineTo(new PointF(1.5f, 10.91f)); bezier5Path.AddLineTo(new PointF(7.99f, 1.5f)); bezier5Path.AddLineTo(new PointF(7.99f, 8.91f)); bezier5Path.ClosePath(); gradient2Color.SetFill(); bezier5Path.Fill(); gradient2Color.SetStroke(); bezier5Path.LineWidth = 1; bezier5Path.Stroke(); //END PAINTCODE NON RETINA } var converted = UIGraphics.GetImageFromCurrentImageContext (); UIGraphics.EndImageContext (); return converted; }
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); }
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 UIBezierPath PathForRect(CGRect rect, nfloat arrowOffset) { if (rect == CGRect.Empty) { return(null); } rect = new CGRect(CGPoint.Empty, rect.Size); // ensure origin is CGPointZero // Create rounded rect CGRect roundedRect = rect; var size = roundedRect.Size; size.Height -= ArrowLength; roundedRect.Size = size; var popUpPath = UIBezierPath.FromRoundedRect(roundedRect, cornerRadius); // Create arrow path nfloat maxX = roundedRect.GetMaxX(); // prevent arrow from extending beyond this point nfloat arrowTipX = rect.GetMidX() + arrowOffset; CGPoint tip = new CGPoint(arrowTipX, rect.GetMaxY()); nfloat arrowLength = roundedRect.Height / 2.0f; nfloat x = arrowLength * NMath.Tan(45.0f * NMath.PI / 180); // x = half the length of the base of the arrow var arrowPath = new UIBezierPath(); arrowPath.MoveTo(tip); arrowPath.AddLineTo(new CGPoint(NMath.Max(arrowTipX - x, 0), roundedRect.GetMaxY() - arrowLength)); arrowPath.AddLineTo(new CGPoint(NMath.Min(arrowTipX + x, maxX), roundedRect.GetMaxY() - arrowLength)); arrowPath.ClosePath(); popUpPath.AppendPath(arrowPath); return(popUpPath); }
public static UIBezierPath CreatePolygonPath(CGRect rect, int sides, double cornerRadius = 0.0, double rotationOffset = 0.0) { var offsetRadians = rotationOffset * Math.PI / 180; var path = new UIBezierPath(); var theta = 2 * Math.PI / sides; var width = (-cornerRadius + Math.Min(rect.Size.Width, rect.Size.Height)) / 2; var center = new CGPoint(rect.Width / 2, rect.Height / 2); var radius = width + cornerRadius - (Math.Cos(theta) * cornerRadius) / 2; var angle = offsetRadians; var corner = new CGPoint(center.X + (radius - cornerRadius) * Math.Cos(angle), center.Y + (radius - cornerRadius) * Math.Sin(angle)); path.MoveTo(new CGPoint(corner.X + cornerRadius * Math.Cos(angle + theta), corner.Y + cornerRadius * Math.Sin(angle + theta))); for (var i = 0; i < sides; i++) { angle += theta; corner = new CGPoint(center.X + (radius - cornerRadius) * Math.Cos(angle), center.Y + (radius - cornerRadius) * Math.Sin(angle)); var tip = new CGPoint(center.X + radius * Math.Cos(angle), center.Y + radius * Math.Sin(angle)); var start = new CGPoint(corner.X + cornerRadius * Math.Cos(angle - theta), corner.Y + cornerRadius * Math.Sin(angle - theta)); var end = new CGPoint(corner.X + cornerRadius * Math.Cos(angle + theta), corner.Y + cornerRadius * Math.Sin(angle + theta)); path.AddLineTo(start); path.AddQuadCurveToPoint(end, tip); } path.ClosePath(); return(path); }
private void DrawCancelPictureButton(CGRect frame) { var color2 = UIColor.White; 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(); }
public override void Draw(RectangleF rect) { var xamarinBlue = UIColor.FromRGBA(0.071f, 0.463f, 0.725f, 1.000f); UIBezierPath xamarinLogoPath = new UIBezierPath(); xamarinLogoPath.MoveTo(new PointF(230.49f, 92.68f)); xamarinLogoPath.AddLineTo(new PointF(200.74f, 92.68f)); xamarinLogoPath.AddLineTo(new PointF(159.7f, 167.71f)); xamarinLogoPath.AddLineTo(new PointF(200.74f, 242.73f)); xamarinLogoPath.AddLineTo(new PointF(230.49f, 242.73f)); xamarinLogoPath.AddLineTo(new PointF(191.23f, 167.71f)); xamarinLogoPath.AddLineTo(new PointF(230.49f, 92.68f)); xamarinLogoPath.ClosePath(); xamarinLogoPath.MoveTo(new PointF(118.66f, 92.68f)); xamarinLogoPath.AddLineTo(new PointF(88.92f, 92.68f)); xamarinLogoPath.AddLineTo(new PointF(128.18f, 167.71f)); xamarinLogoPath.AddLineTo(new PointF(88.92f, 242.73f)); xamarinLogoPath.AddLineTo(new PointF(118.66f, 242.73f)); xamarinLogoPath.AddLineTo(new PointF(159.7f, 167.71f)); xamarinLogoPath.AddLineTo(new PointF(118.66f, 92.68f)); xamarinLogoPath.ClosePath(); xamarinLogoPath.MoveTo(new PointF(220.7f, 37.0f)); xamarinLogoPath.AddCurveToPoint(new PointF(232.55f, 41.1f), new PointF(220.7f, 37.0f), new PointF(227.07f, 38.03f)); xamarinLogoPath.AddCurveToPoint(new PointF(242.62f, 49.31f), new PointF(238.03f, 44.18f), new PointF(242.62f, 49.31f)); xamarinLogoPath.AddLineTo(new PointF(304.22f, 152.47f)); xamarinLogoPath.AddCurveToPoint(new PointF(308.95f, 170.05f), new PointF(304.22f, 152.47f), new PointF(309.55f, 163.02f)); xamarinLogoPath.AddCurveToPoint(new PointF(304.22f, 183.53f), new PointF(308.36f, 177.09f), new PointF(304.22f, 183.53f)); xamarinLogoPath.AddLineTo(new PointF(243.57f, 286.11f)); xamarinLogoPath.AddCurveToPoint(new PointF(234.05f, 294.31f), new PointF(243.57f, 286.11f), new PointF(239.7f, 291.09f)); xamarinLogoPath.AddCurveToPoint(new PointF(220.97f, 299.0f), new PointF(228.4f, 297.53f), new PointF(220.97f, 299.0f)); xamarinLogoPath.AddLineTo(new PointF(97.25f, 299.0f)); xamarinLogoPath.AddCurveToPoint(new PointF(84.16f, 294.31f), new PointF(97.25f, 299.0f), new PointF(89.51f, 297.53f)); xamarinLogoPath.AddCurveToPoint(new PointF(75.83f, 286.11f), new PointF(78.81f, 291.09f), new PointF(75.83f, 286.11f)); xamarinLogoPath.AddLineTo(new PointF(13.99f, 181.77f)); xamarinLogoPath.AddCurveToPoint(new PointF(11.03f, 170.05f), new PointF(13.99f, 181.77f), new PointF(11.33f, 176.21f)); xamarinLogoPath.AddCurveToPoint(new PointF(12.81f, 157.16f), new PointF(10.73f, 163.9f), new PointF(12.81f, 157.16f)); xamarinLogoPath.AddLineTo(new PointF(75.59f, 49.31f)); xamarinLogoPath.AddCurveToPoint(new PointF(85.07f, 41.1f), new PointF(75.59f, 49.31f), new PointF(79.59f, 44.18f)); xamarinLogoPath.AddCurveToPoint(new PointF(97.5f, 37.0f), new PointF(90.54f, 38.03f), new PointF(97.5f, 37.0f)); xamarinLogoPath.AddLineTo(new PointF(220.7f, 37.0f)); xamarinLogoPath.AddLineTo(new PointF(220.7f, 37.0f)); xamarinLogoPath.ClosePath(); xamarinBlue.SetFill(); xamarinLogoPath.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(); }
UIBezierPath GetCircularOverlayPath() { int radius = (int)(Bounds.Width / 2) - 20; UIBezierPath circlePath = UIBezierPath.FromRoundedRect(new CGRect(Bounds.GetMidX() - radius, Bounds.GetMidY() - radius, 2.0 * radius, 2.0 * radius), radius); circlePath.ClosePath(); return(circlePath); }
public override void TouchesEnded(Foundation.NSSet touches, UIEvent evt) { base.TouchesEnded(touches, evt); linePathCollection.Add(new LinePath() { PenColor = penColor, Path = path, LineWidth = lineWidth }); path.ClosePath(); }
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(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); }
public override void CreatePath(Triangle shape, CGRect bounds) { using (var bezierPath = new UIBezierPath()) { bezierPath.MoveTo(shape.PointA.ToCGPointProp(bounds)); bezierPath.AddLineTo(shape.PointB.ToCGPointProp(bounds)); bezierPath.AddLineTo(shape.PointC.ToCGPointProp(bounds)); bezierPath.ClosePath(); Path = bezierPath.CGPath; } }
public override void Draw(CGRect rect) { base.Draw(rect); Console.WriteLine("DrawingView draw!"); CGContext context = UIGraphics.GetCurrentContext(); // Create a path around the entire view UIBezierPath clipPath = UIBezierPath.FromRect(rect); // Add the transparent window to a sample rectangle CGRect sampleRect = new CGRect(0f, 0f, rect.Width, rect.Height); UIBezierPath path = UIBezierPath.FromRoundedRect(sampleRect, (System.nfloat)Device.CornerRadius); //Top left of notch path.MoveTo(new CGPoint(Device.NotchX - Device.NotchTopRadius, Device.NotchY)); //Curve into notch path.AddArc(new CGPoint(Device.NotchX - Device.NotchTopRadius, Device.NotchTopRadius), (System.nfloat)(Device.NotchY + Device.NotchTopRadius), Top, Right, true);//Angles in Radians, relative to 90deg //Left side of notch path.AddLineTo(new CGPoint(Device.NotchX, Device.NotchHeight - Device.NotchBottomRadius)); //Curve into bottom path.AddArc(new CGPoint(Device.NotchX + Device.NotchBottomRadius, Device.NotchY + Device.NotchHeight - Device.NotchBottomRadius), (System.nfloat)Device.NotchBottomRadius, Left, Bottom, false); //Bottom of notch path.AddLineTo(new CGPoint(Device.NotchX + Device.NotchWidth - Device.NotchBottomRadius, Device.NotchY + Device.NotchHeight)); //Curve into right path.AddArc(new CGPoint(Device.NotchX + Device.NotchWidth - Device.NotchBottomRadius, Device.NotchY + Device.NotchHeight - Device.NotchBottomRadius), (System.nfloat)Device.NotchBottomRadius, Bottom, Right, false); //Right side of nothc path.AddLineTo(new CGPoint(Device.NotchX + Device.NotchWidth, Device.NotchY + Device.NotchTopRadius)); //Curve out of notch path.AddArc(new CGPoint(Device.NotchX + Device.NotchWidth + Device.NotchTopRadius, Device.NotchTopRadius), (System.nfloat)(Device.NotchY + Device.NotchTopRadius), Left, Top, true); //finish path path.AddLineTo(new CGPoint(Device.NotchX - Device.NotchTopRadius, Device.NotchY)); path.ClosePath(); clipPath.AppendPath(path); // This sets the algorithm used to determine what gets filled and what doesn't clipPath.UsesEvenOddFillRule = true; context.SetFillColor(Device.NotchColor.ToUIColor().CGColor); clipPath.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(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(); } }
static void paintCodeNonRetina() { //// 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 static UIBezierPath CreateRoundedRectPath(CGRect rect, CornerRadius cornerRadius) { var path = new UIBezierPath(); path.AddLineTo(new CGPoint(rect.Width - cornerRadius.TopRight, rect.Y)); path.AddArc(new CGPoint((float)rect.X + rect.Width - cornerRadius.TopRight, (float)rect.Y + cornerRadius.TopRight), (nfloat)cornerRadius.TopRight, (float)(Math.PI * 1.5), (float)Math.PI * 2, true); path.AddLineTo(new CGPoint(rect.Width, rect.Height - cornerRadius.BottomRight)); path.AddArc(new CGPoint((float)rect.X + rect.Width - cornerRadius.BottomRight, (float)rect.Y + rect.Height - cornerRadius.BottomRight), (nfloat)cornerRadius.BottomRight, 0, (float)(Math.PI * .5), true); path.AddLineTo(new CGPoint(cornerRadius.BottomLeft, rect.Height)); path.AddArc(new CGPoint((float)rect.X + cornerRadius.BottomLeft, (float)rect.Y + rect.Height - cornerRadius.BottomLeft), (nfloat)cornerRadius.BottomLeft, (float)(Math.PI * .5), (float)Math.PI, true); path.AddLineTo(new CGPoint(rect.X, cornerRadius.TopLeft)); path.AddArc(new CGPoint((float)rect.X + cornerRadius.TopLeft, (float)rect.Y + cornerRadius.TopLeft), (nfloat)cornerRadius.TopLeft, (float)Math.PI, (float)(Math.PI * 1.5), true); path.ClosePath(); return(path); }
public static void DrawArrowFill(CGRect frameFill, float outlinePadding, UIColor fillColor) { // FillShape Drawing UIBezierPath fillShapePath = new UIBezierPath(); fillShapePath.MoveTo(new CGPoint(frameFill.GetMinX() + outlinePadding, frameFill.GetMaxY() - outlinePadding)); fillShapePath.AddLineTo(new CGPoint(frameFill.GetMaxX() - (frameFill.Height / 2.0f), frameFill.GetMaxY() - outlinePadding)); fillShapePath.AddLineTo(new CGPoint(frameFill.GetMaxX() - outlinePadding, frameFill.GetMinY() + 0.50000f * frameFill.Height)); fillShapePath.AddLineTo(new CGPoint(frameFill.GetMaxX() - (frameFill.Height / 2.0f), frameFill.GetMinY() + outlinePadding)); fillShapePath.AddLineTo(new CGPoint(frameFill.GetMinX() + outlinePadding, frameFill.GetMinY() + outlinePadding)); fillShapePath.AddLineTo(new CGPoint(frameFill.GetMinX() + outlinePadding, frameFill.GetMaxY() - outlinePadding)); fillShapePath.ClosePath(); fillColor.SetFill(); fillShapePath.Fill(); }
void DrawQuadrangle(CGPoint p0, CGPoint p1, CGPoint p2, CGPoint p3, CALayer layer, RTRResultStabilityStatus progress) { var area = new CAShapeLayer(); var recognizedAreaPath = new UIBezierPath(); recognizedAreaPath.MoveTo(p0); recognizedAreaPath.AddLineTo(p1); recognizedAreaPath.AddLineTo(p2); recognizedAreaPath.AddLineTo(p3); recognizedAreaPath.ClosePath(); area.Path = recognizedAreaPath.CGPath; area.StrokeColor = ProgressColor(progress).CGColor; area.FillColor = UIColor.Clear.CGColor; layer.AddSublayer(area); }
private CGPath CreateCornerPath(PancakeView pancake, bool addBorderInset) { var cornerPath = new UIBezierPath(); var insetBounds = addBorderInset ? this.Bounds.Inset(pancake.BorderThickness / 2, pancake.BorderThickness / 2) : this.Bounds; // Create arcs for the given corner radius. cornerPath.AddArc(new CGPoint((float)insetBounds.X + insetBounds.Width - pancake.CornerRadii.TopRight, (float)insetBounds.Y + pancake.CornerRadii.TopRight), (float)pancake.CornerRadii.TopRight, (float)(Math.PI * 1.5), (float)Math.PI * 2, true); cornerPath.AddArc(new CGPoint((float)insetBounds.X + insetBounds.Width - pancake.CornerRadii.BottomRight, (float)insetBounds.Y + insetBounds.Height - pancake.CornerRadii.BottomRight), (float)pancake.CornerRadii.BottomRight, 0, (float)(Math.PI * .5), true); cornerPath.AddArc(new CGPoint((float)insetBounds.X + pancake.CornerRadii.BottomLeft, (float)insetBounds.Y + insetBounds.Height - pancake.CornerRadii.BottomLeft), (float)pancake.CornerRadii.BottomLeft, (float)(Math.PI * .5), (float)Math.PI, true); cornerPath.AddArc(new CGPoint((float)insetBounds.X + pancake.CornerRadii.TopLeft, (float)insetBounds.Y + pancake.CornerRadii.TopLeft), (float)pancake.CornerRadii.TopLeft, (float)Math.PI, (float)(Math.PI * 1.5), true); cornerPath.ClosePath(); return(cornerPath.CGPath); }
public override void ViewDidLayoutSubviews() { base.ViewDidLayoutSubviews(); ProfileImage.Layer.CornerRadius = ProfileImage.Frame.Width / 2; ChallengesButton.Layer.CornerRadius = 2; ChallengesButton.Font = UIFont.FromName("ProximaNova-Regular", SizeConstants.ScreenMultiplier * 14); lblLedaerboardCollectionTitle.Font = UIFont.FromName("ProximaNova-Bold", SizeConstants.ScreenMultiplier * 16); lblProfileLeaderboardPosition.Font = UIFont.FromName("ProximaNova-Regular", SizeConstants.ScreenMultiplier * 14); ScrollView.ContentSize = new CGSize(ScrollView.Frame.Width, tvLeaderboardTable.Frame.Y + tvLeaderboardTable.ContentSize.Height); tvLeaderboardTable.UpdateConstraints(); vContent.UpdateConstraints(); InvokeOnMainThread(() => { View.LayoutIfNeeded(); }); ScrollView.ContentSize = new CGSize(ScrollView.Frame.Width, tvLeaderboardTable.Frame.Y + tvLeaderboardTable.ContentSize.Height); var bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(ivTriangle.Layer.Bounds.GetMidX(), ivTriangle.Layer.Bounds.Y)); bezierPath.AddLineTo(new CGPoint(ivTriangle.Layer.Bounds.X, ivTriangle.Layer.Bounds.GetMaxY())); bezierPath.AddLineTo(new CGPoint(ivTriangle.Layer.Bounds.X, ivTriangle.Layer.Bounds.GetMaxY() + 4)); bezierPath.AddLineTo(new CGPoint(ivTriangle.Layer.Bounds.GetMaxX(), ivTriangle.Layer.Bounds.GetMaxY() + 4)); bezierPath.AddLineTo(new CGPoint(ivTriangle.Layer.Bounds.GetMaxX(), ivTriangle.Layer.Bounds.GetMaxY())); bezierPath.ClosePath(); ivTriangle.Layer.AddSublayer(new CAShapeLayer { Frame = ivTriangle.Bounds, Path = bezierPath.CGPath, FillColor = UIColor.White.CGColor }); ivTriangle.Image = null; //tvLeaderboardTable.AllowsSelection = false; ScrollToOffset(ScrollView); SL.Manager.GetProfileAsync(CheckLeaderBoardTableView); }
private void DrawGrid() { var size = new CGRect() { Width = ContentSize.Width > Frame.Width ? Frame.Width : ContentSize.Width, Height = ContentSize.Height > Frame.Width ? Frame.Width : ContentSize.Height, X = ContentOffset.X < 0 ? 0 : ContentOffset.X, Y = ContentOffset.Y < 0 ? 0 : ContentOffset.Y, }; var gridHeight = size.Height / (_linesCount + 1); var gridWidth = size.Width / (_linesCount + 1); _path = UIBezierPath.Create(); _path.LineWidth = 1; for (int i = 1; i < _linesCount + 1; i++) { var start = new CGPoint(x: i * gridWidth + size.X, y: size.Y); var end = new CGPoint(x: i * gridWidth + size.X, y: size.Height + size.Y); _path.MoveTo(start); _path.AddLineTo(end); } for (int i = 1; i < _linesCount + 1; i++) { var start = new CGPoint(x: size.X, y: i * gridHeight + size.Y); var end = new CGPoint(x: size.Width + size.X, y: i * gridHeight + size.Y); _path.MoveTo(start); _path.AddLineTo(end); } _shapeLayer.RemoveAllAnimations(); _shapeLayer.StrokeColor = _strokeColor.ColorWithAlpha(0.15f).CGColor; var animation = CABasicAnimation.FromKeyPath("strokeColor"); animation.BeginTime = CAAnimation.CurrentMediaTime() + 0.2; //delay animation.Duration = 0.2; animation.SetTo(_strokeColor.ColorWithAlpha(0).CGColor); animation.RemovedOnCompletion = false; animation.FillMode = CAFillMode.Forwards; _shapeLayer.AddAnimation(animation, "flashStrokeColor"); _shapeLayer.Path = _path.CGPath; _path.ClosePath(); }
public override void ViewDidLayoutSubviews() { base.ViewDidLayoutSubviews(); var marin = UIScreen.MainScreen.Bounds.Width * 0.056f; btnInfo.ContentEdgeInsets = new UIEdgeInsets(marin, marin, marin, marin); cnsTableViewHeight.Constant = TableView.ContentSize.Height; ScrollView.ContentSize = new CGSize(ScrollView.Frame.Width, TableView.Frame.Y + TableView.ContentSize.Height); ScoreView.LayoutSubviews(); Score.Font = UIFont.FromName("ProximaNova-Bold", SizeConstants.ScreenMultiplier * 24); lblScoreGroup.Font = UIFont.FromName("ProximaNova-Bold", SizeConstants.ScreenMultiplier * 14); lblScoreGroup.SizeToFit(); InvokeOnMainThread(() => { View.LayoutIfNeeded(); }); cnsTableViewHeight.Constant = TableView.ContentSize.Height; ScrollView.ContentSize = new CGSize(ScrollView.Frame.Width, TableView.Frame.Y + TableView.ContentSize.Height); var bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(ivTriangle.Layer.Bounds.GetMaxX(), ivTriangle.Layer.Bounds.Y)); bezierPath.AddLineTo(new CGPoint(ivTriangle.Layer.Bounds.GetMaxX(), ivTriangle.Layer.Bounds.GetMaxY() + 4)); bezierPath.AddLineTo(new CGPoint(ivTriangle.Layer.Bounds.X, ivTriangle.Layer.Bounds.GetMaxY() + 4)); bezierPath.AddLineTo(new CGPoint(ivTriangle.Layer.Bounds.X, ivTriangle.Layer.Bounds.GetMaxY())); bezierPath.ClosePath(); ivTriangle.Layer.AddSublayer(new CAShapeLayer { Frame = ivTriangle.Bounds, Path = bezierPath.CGPath, FillColor = UIColor.White.CGColor }); ivTriangle.Image = null; //ScrollToOffset(ScrollView); }
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(); }
private static UIBezierPath CreatePathFigure(LineString linearRing, IViewport viewport) { var pathFigure = new UIBezierPath(); var start = linearRing.Vertices[0]; var startPos = viewport.WorldToScreen(start); pathFigure.MoveTo(ToUIKit(startPos)); for (int i = 1; i < linearRing.Vertices.Count; i++) { var pos = linearRing.Vertices[i]; var screenPos = viewport.WorldToScreen(pos); pathFigure.AddLineTo(ToUIKit(screenPos)); } pathFigure.ClosePath(); return(pathFigure); }
public static void DrawArrowOutline(CGRect frameOutline, float outlinePadding, float outlineThickness, UIColor outlineColor) { // OutlineShape Drawing UIBezierPath outlineShapePath = new UIBezierPath(); outlineShapePath.MoveTo(new CGPoint(frameOutline.GetMinX() + outlinePadding, frameOutline.GetMaxY() - outlinePadding)); outlineShapePath.AddLineTo(new CGPoint(frameOutline.GetMaxX() - (frameOutline.Height / 2.0f), frameOutline.GetMaxY() - outlinePadding)); outlineShapePath.AddLineTo(new CGPoint(frameOutline.GetMaxX() - outlinePadding, frameOutline.GetMinY() + 0.50000f * frameOutline.Height)); outlineShapePath.AddLineTo(new CGPoint(frameOutline.GetMaxX() - (frameOutline.Height / 2.0f), frameOutline.GetMinY() + outlinePadding)); outlineShapePath.AddLineTo(new CGPoint(frameOutline.GetMinX() + outlinePadding, frameOutline.GetMinY() + outlinePadding)); outlineShapePath.AddLineTo(new CGPoint(frameOutline.GetMinX() + outlinePadding, frameOutline.GetMaxY() - outlinePadding)); outlineShapePath.ClosePath(); outlineColor.SetStroke(); outlineShapePath.LineWidth = outlineThickness; outlineShapePath.Stroke(); }
//// 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(); }
private UIImage imageWithColor(UIColor imgColor) { var imgRenderer = new UIGraphicsImageRenderer(new CGSize(1, 1)); var img = imgRenderer.CreateImage((UIGraphicsImageRendererContext ctxt) => { var superRed = UIColor.FromDisplayP3(1.358f, -0.074f, -0.012f, 1.0f); superRed.SetFill(); UIColor.Black.SetStroke(); var path = new UIBezierPath(); path.MoveTo(new CGPoint(10, 10)); path.AddLineTo(new CGPoint(90, 10)); path.AddLineTo(new CGPoint(45, 90)); path.ClosePath(); path.Stroke(); path.Fill(); }); return(img); }
private CAShapeLayer createChartSegment(nfloat offset, nfloat percent, CGColor color) { var startAngle = (nfloat)FullCircle * offset - (nfloat)QuarterOfCircle; var angle = (nfloat)FullCircle * percent; var radius = Chart.Bounds.Width / 2; var start = new CGPoint(Chart.Center.X + (nfloat)Math.Cos(startAngle) * radius, Chart.Center.Y + (nfloat)Math.Sin(startAngle) * radius); var path = new UIBezierPath(); path.MoveTo(Chart.Center); path.AddLineTo(start); path.AddArc(Chart.Center, radius, startAngle, startAngle + angle, true); path.ClosePath(); var layer = new CAShapeLayer(); layer.Path = path.CGPath; layer.FillColor = color; return(layer); }
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); }
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(); } }
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 Draw(RectangleF rect) { //// Color Declarations //// Frames var bgFrame = new RectangleF(0, 0, rect.Width, rect.Height); //// Subframes var circleGroup = new RectangleF(bgFrame.GetMinX() + (float)Math.Floor(bgFrame.Width * 0.13437f + 0.5f), bgFrame.GetMinY() + (float)Math.Floor(bgFrame.Height * 0.12500f + 0.5f), (float)Math.Floor(bgFrame.Width * 0.85938f + 0.5f) - (float)Math.Floor(bgFrame.Width * 0.13437f + 0.5f), (float)Math.Floor(bgFrame.Height * 0.84688f + 0.5f) - (float)Math.Floor(bgFrame.Height * 0.12500f + 0.5f)); //// Abstracted Attributes var progressOvalEndAngle = Progress; //// circleGroup { //// outerOval Drawing var outerOvalPath = UIBezierPath.FromOval(new RectangleF(circleGroup.GetMinX() + (float)Math.Floor(circleGroup.Width * 0.00216f) + 0.5f, circleGroup.GetMinY() + (float)Math.Floor(circleGroup.Height * 0.00000f + 0.5f), (float)Math.Floor(circleGroup.Width * 0.99784f) - (float)Math.Floor(circleGroup.Width * 0.00216f), (float)Math.Floor(circleGroup.Height * 1.00000f + 0.5f) - (float)Math.Floor(circleGroup.Height * 0.00000f + 0.5f))); OuterColor.SetFill(); outerOvalPath.Fill(); //// progressOval Drawing var progressOvalRect = new RectangleF(circleGroup.GetMinX() + (float)Math.Floor(circleGroup.Width * 0.00216f) + 0.5f, circleGroup.GetMinY() + (float)Math.Floor(circleGroup.Height * 0.00000f + 0.5f), (float)Math.Floor(circleGroup.Width * 0.99784f) - (float)Math.Floor(circleGroup.Width * 0.00216f), (float)Math.Floor(circleGroup.Height * 1.00000f + 0.5f) - (float)Math.Floor(circleGroup.Height * 0.00000f + 0.5f)); var progressOvalPath = new UIBezierPath(); progressOvalPath.AddArc(new PointF(progressOvalRect.GetMidX(), progressOvalRect.GetMidY()), progressOvalRect.Width / 2, (float)(270 * Math.PI / 180), (float)(progressOvalEndAngle * Math.PI / 180), true); progressOvalPath.AddLineTo(new PointF(progressOvalRect.GetMidX(), progressOvalRect.GetMidY())); progressOvalPath.ClosePath(); InnerColor.SetFill(); progressOvalPath.Fill(); //// innerOval Drawing var innerOvalPath = UIBezierPath.FromOval(new RectangleF(circleGroup.GetMinX() + (float)Math.Floor(circleGroup.Width * 0.09052f + 0.5f), circleGroup.GetMinY() + (float)Math.Floor(circleGroup.Height * 0.09091f + 0.5f), (float)Math.Floor(circleGroup.Width * 0.90948f + 0.5f) - (float)Math.Floor(circleGroup.Width * 0.09052f + 0.5f), (float)Math.Floor(circleGroup.Height * 0.91342f + 0.5f) - (float)Math.Floor(circleGroup.Height * 0.09091f + 0.5f))); InsideColor.SetFill(); innerOvalPath.Fill(); } }
static void paintCodeRetina() { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor shadowColor2 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 0.413f); UIColor color5 = UIColor.FromRGBA(0.200f, 0.067f, 0.000f, 1.000f); //// Shadow Declarations var shadow = shadowColor2.CGColor; var shadowOffset = new SizeF(0.1f, 1.1f); var shadowBlurRadius = 10; //// Rectangle 5 Drawing UIBezierPath rectangle5Path = new UIBezierPath(); rectangle5Path.MoveTo(new PointF(6.09f, 11.75f)); rectangle5Path.AddLineTo(new PointF(6.09f, 11.85f)); rectangle5Path.AddLineTo(new PointF(6.09f, 11.75f)); rectangle5Path.ClosePath(); rectangle5Path.MoveTo(new PointF(6.94f, 20.6f)); rectangle5Path.AddLineTo(new PointF(6.94f, 2)); rectangle5Path.AddLineTo(new PointF(9.27f, 5.28f)); rectangle5Path.AddLineTo(new PointF(9.47f, 26.07f)); rectangle5Path.AddLineTo(new PointF(6.94f, 20.6f)); rectangle5Path.ClosePath(); color5.SetFill(); rectangle5Path.Fill(); ////// Rectangle 5 Inner Shadow var rectangle5BorderRect = rectangle5Path.Bounds; rectangle5BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle5BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle5BorderRect = RectangleF.Union(rectangle5BorderRect, rectangle5Path.Bounds); rectangle5BorderRect.Inflate(1, 1); var rectangle5NegativePath = UIBezierPath.FromRect(rectangle5BorderRect); rectangle5NegativePath.AppendPath(rectangle5Path); rectangle5NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle5BorderRect.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); rectangle5Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle5BorderRect.Width), 0); rectangle5NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle5NegativePath.Fill(); } context.RestoreState(); color5.SetStroke(); rectangle5Path.LineWidth = 1; rectangle5Path.Stroke(); //// Rectangle 4 Drawing UIBezierPath rectangle4Path = new UIBezierPath(); rectangle4Path.MoveTo(new PointF(77.17f, 46.2f)); rectangle4Path.AddLineTo(new PointF(77.17f, 46.2f)); rectangle4Path.AddLineTo(new PointF(77.17f, 46.2f)); rectangle4Path.ClosePath(); rectangle4Path.MoveTo(new PointF(77.54f, 58.04f)); rectangle4Path.AddLineTo(new PointF(77.54f, 34.62f)); rectangle4Path.AddLineTo(new PointF(83.98f, 37.55f)); rectangle4Path.AddLineTo(new PointF(83.98f, 63.9f)); rectangle4Path.AddLineTo(new PointF(77.54f, 58.04f)); rectangle4Path.ClosePath(); color5.SetFill(); rectangle4Path.Fill(); ////// Rectangle 4 Inner Shadow var rectangle4BorderRect = rectangle4Path.Bounds; rectangle4BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle4BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle4BorderRect = RectangleF.Union(rectangle4BorderRect, rectangle4Path.Bounds); rectangle4BorderRect.Inflate(1, 1); var rectangle4NegativePath = UIBezierPath.FromRect(rectangle4BorderRect); rectangle4NegativePath.AppendPath(rectangle4Path); rectangle4NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle4BorderRect.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); rectangle4Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle4BorderRect.Width), 0); rectangle4NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle4NegativePath.Fill(); } context.RestoreState(); color5.SetStroke(); rectangle4Path.LineWidth = 1; rectangle4Path.Stroke(); //// Rectangle 6 Drawing UIBezierPath rectangle6Path = new UIBezierPath(); rectangle6Path.MoveTo(new PointF(26.89f, 48.27f)); rectangle6Path.AddLineTo(new PointF(26.89f, 48.27f)); rectangle6Path.AddLineTo(new PointF(26.89f, 48.27f)); rectangle6Path.ClosePath(); rectangle6Path.MoveTo(new PointF(27.14f, 58.73f)); rectangle6Path.AddLineTo(new PointF(27.14f, 31)); rectangle6Path.AddLineTo(new PointF(31.51f, 40.63f)); rectangle6Path.AddLineTo(new PointF(31.51f, 63.9f)); rectangle6Path.AddLineTo(new PointF(27.14f, 58.73f)); rectangle6Path.ClosePath(); color5.SetFill(); rectangle6Path.Fill(); ////// Rectangle 6 Inner Shadow var rectangle6BorderRect = rectangle6Path.Bounds; rectangle6BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle6BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle6BorderRect = RectangleF.Union(rectangle6BorderRect, rectangle6Path.Bounds); rectangle6BorderRect.Inflate(1, 1); var rectangle6NegativePath = UIBezierPath.FromRect(rectangle6BorderRect); rectangle6NegativePath.AppendPath(rectangle6Path); rectangle6NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle6BorderRect.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); rectangle6Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle6BorderRect.Width), 0); rectangle6NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle6NegativePath.Fill(); } context.RestoreState(); color5.SetStroke(); rectangle6Path.LineWidth = 1; rectangle6Path.Stroke(); //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRect(new RectangleF(31.5f, 39.5f, 11, 24)); color5.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(); color5.SetStroke(); rectanglePath.LineWidth = 1; rectanglePath.Stroke(); //// Rectangle 2 Drawing var rectangle2Path = UIBezierPath.FromRect(new RectangleF(9.5f, 7.5f, 7, 19)); color5.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(); color5.SetStroke(); rectangle2Path.LineWidth = 1; rectangle2Path.Stroke(); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(7.47f, 2.1f)); bezierPath.AddLineTo(new PointF(30.42f, 38.52f)); bezierPath.AddLineTo(new PointF(93.81f, 38.52f)); bezierPath.AddLineTo(new PointF(53.37f, 2.1f)); bezierPath.AddLineTo(new PointF(10.74f, 2.1f)); bezierPath.AddLineTo(new PointF(7.47f, 2.1f)); bezierPath.ClosePath(); color5.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(); color5.SetStroke(); bezierPath.LineWidth = 2; bezierPath.Stroke(); //// Rectangle 3 Drawing var rectangle3Path = UIBezierPath.FromRect(new RectangleF(83.5f, 39.5f, 11, 24)); color5.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(); color5.SetStroke(); rectangle3Path.LineWidth = 1; rectangle3Path.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 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 (); }
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(); } }
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(); }
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 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(); } }
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(); }
private void SetArrowFrame() { SelectionIndicatorArrowLayer.Frame = FrameForSelectionIndicator(); SelectionIndicatorArrowLayer.Mask = null; PointF p1, p2, p3; if (SelectionIndicatorLocation == HMSegmentedControlIndicatorLocation.Down) { p1 = new PointF(SelectionIndicatorArrowLayer.Bounds.Size.Width / 2, 0); p2 = new PointF(0, SelectionIndicatorArrowLayer.Bounds.Size.Height); p3 = new PointF(SelectionIndicatorArrowLayer.Bounds.Size.Width, SelectionIndicatorArrowLayer.Bounds.Size.Height); } else if (SelectionIndicatorLocation == HMSegmentedControlIndicatorLocation.Up) { p1 = new PointF(SelectionIndicatorArrowLayer.Bounds.Size.Width / 2, SelectionIndicatorArrowLayer.Bounds.Size.Height); p2 = new PointF(SelectionIndicatorArrowLayer.Bounds.Size.Width, 0); p3 = new PointF(0, 0); } else { p1 = p2 = p3 = PointF.Empty; } var arrowPath = new UIBezierPath(); arrowPath.MoveTo(p1); arrowPath.AddLineTo(p2); arrowPath.AddLineTo(p3); arrowPath.ClosePath(); SelectionIndicatorArrowLayer.Mask = new CAShapeLayer { Frame = SelectionIndicatorArrowLayer.Bounds, Path = arrowPath.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); //// 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() { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor shadowColor2 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 0.413f); UIColor color5 = UIColor.FromRGBA(0.200f, 0.067f, 0.000f, 1.000f); //// Shadow Declarations var shadow = shadowColor2.CGColor; var shadowOffset = new SizeF(0.1f, 1.1f); var shadowBlurRadius = 10; //// Group { //// Rectangle 5 Drawing UIBezierPath rectangle5Path = new UIBezierPath(); rectangle5Path.MoveTo(new PointF(4.04f, 7.93f)); rectangle5Path.AddLineTo(new PointF(4.04f, 7.97f)); rectangle5Path.AddLineTo(new PointF(4.04f, 7.93f)); rectangle5Path.ClosePath(); rectangle5Path.MoveTo(new PointF(4.43f, 11.5f)); rectangle5Path.AddLineTo(new PointF(4.43f, 4)); rectangle5Path.AddLineTo(new PointF(5.51f, 5.32f)); rectangle5Path.AddLineTo(new PointF(5.6f, 13.71f)); rectangle5Path.AddLineTo(new PointF(4.43f, 11.5f)); rectangle5Path.ClosePath(); color5.SetFill(); rectangle5Path.Fill(); ////// Rectangle 5 Inner Shadow var rectangle5BorderRect = rectangle5Path.Bounds; rectangle5BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle5BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle5BorderRect = RectangleF.Union(rectangle5BorderRect, rectangle5Path.Bounds); rectangle5BorderRect.Inflate(1, 1); var rectangle5NegativePath = UIBezierPath.FromRect(rectangle5BorderRect); rectangle5NegativePath.AppendPath(rectangle5Path); rectangle5NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle5BorderRect.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); rectangle5Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle5BorderRect.Width), 0); rectangle5NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle5NegativePath.Fill(); } context.RestoreState(); color5.SetStroke(); rectangle5Path.LineWidth = 1; rectangle5Path.Stroke(); //// Rectangle 4 Drawing UIBezierPath rectangle4Path = new UIBezierPath(); rectangle4Path.MoveTo(new PointF(36.78f, 21.82f)); rectangle4Path.AddLineTo(new PointF(36.78f, 21.82f)); rectangle4Path.AddLineTo(new PointF(36.78f, 21.82f)); rectangle4Path.ClosePath(); rectangle4Path.MoveTo(new PointF(36.96f, 26.6f)); rectangle4Path.AddLineTo(new PointF(36.96f, 17.15f)); rectangle4Path.AddLineTo(new PointF(39.92f, 18.33f)); rectangle4Path.AddLineTo(new PointF(39.92f, 28.96f)); rectangle4Path.AddLineTo(new PointF(36.96f, 26.6f)); rectangle4Path.ClosePath(); color5.SetFill(); rectangle4Path.Fill(); ////// Rectangle 4 Inner Shadow var rectangle4BorderRect = rectangle4Path.Bounds; rectangle4BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle4BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle4BorderRect = RectangleF.Union(rectangle4BorderRect, rectangle4Path.Bounds); rectangle4BorderRect.Inflate(1, 1); var rectangle4NegativePath = UIBezierPath.FromRect(rectangle4BorderRect); rectangle4NegativePath.AppendPath(rectangle4Path); rectangle4NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle4BorderRect.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); rectangle4Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle4BorderRect.Width), 0); rectangle4NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle4NegativePath.Fill(); } context.RestoreState(); color5.SetStroke(); rectangle4Path.LineWidth = 1; rectangle4Path.Stroke(); //// Rectangle 6 Drawing UIBezierPath rectangle6Path = new UIBezierPath(); rectangle6Path.MoveTo(new PointF(13.62f, 22.66f)); rectangle6Path.AddLineTo(new PointF(13.62f, 22.66f)); rectangle6Path.AddLineTo(new PointF(13.62f, 22.66f)); rectangle6Path.ClosePath(); rectangle6Path.MoveTo(new PointF(13.74f, 26.87f)); rectangle6Path.AddLineTo(new PointF(13.74f, 15.69f)); rectangle6Path.AddLineTo(new PointF(15.75f, 19.58f)); rectangle6Path.AddLineTo(new PointF(15.75f, 28.96f)); rectangle6Path.AddLineTo(new PointF(13.74f, 26.87f)); rectangle6Path.ClosePath(); color5.SetFill(); rectangle6Path.Fill(); ////// Rectangle 6 Inner Shadow var rectangle6BorderRect = rectangle6Path.Bounds; rectangle6BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle6BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle6BorderRect = RectangleF.Union(rectangle6BorderRect, rectangle6Path.Bounds); rectangle6BorderRect.Inflate(1, 1); var rectangle6NegativePath = UIBezierPath.FromRect(rectangle6BorderRect); rectangle6NegativePath.AppendPath(rectangle6Path); rectangle6NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle6BorderRect.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); rectangle6Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle6BorderRect.Width), 0); rectangle6NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle6NegativePath.Fill(); } context.RestoreState(); color5.SetStroke(); rectangle6Path.LineWidth = 1; rectangle6Path.Stroke(); //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRect(new RectangleF(16.5f, 19.5f, 4, 9)); color5.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(); color5.SetStroke(); rectanglePath.LineWidth = 1; rectanglePath.Stroke(); //// Rectangle 2 Drawing var rectangle2Path = UIBezierPath.FromRect(new RectangleF(5.5f, 6.5f, 3, 7)); color5.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(); color5.SetStroke(); rectangle2Path.LineWidth = 1; rectangle2Path.Stroke(); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(4.67f, 4.04f)); bezierPath.AddLineTo(new PointF(15.25f, 18.72f)); bezierPath.AddLineTo(new PointF(44.45f, 18.72f)); bezierPath.AddLineTo(new PointF(25.82f, 4.04f)); bezierPath.AddLineTo(new PointF(6.19f, 4.04f)); bezierPath.AddLineTo(new PointF(4.67f, 4.04f)); bezierPath.ClosePath(); color5.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(); color5.SetStroke(); bezierPath.LineWidth = 2; bezierPath.Stroke(); //// Rectangle 3 Drawing var rectangle3Path = UIBezierPath.FromRect(new RectangleF(39.5f, 19.5f, 5, 9)); color5.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(); color5.SetStroke(); rectangle3Path.LineWidth = 1; rectangle3Path.Stroke(); } }
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() { //// 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(); } }
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; }
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(); }
public static UIBezierPath BezierPathForBackButton(RectangleF rect, float radius) { var path = new UIBezierPath(); var mPoint = new PointF(rect.Right - radius, rect.Y); var ctrlPoint = mPoint; path.MoveTo(mPoint); ctrlPoint.Y += radius; mPoint.X += radius; mPoint.Y += radius; if (radius > 0) path.AddArc(ctrlPoint, radius, (float)(Math.PI + Math.PI / 2), 0, true); mPoint.Y = rect.Bottom - radius; path.AddLineTo(mPoint); ctrlPoint = mPoint; mPoint.Y += radius; mPoint.X -= radius; ctrlPoint.X -= radius; if (radius > 0) path.AddArc(ctrlPoint, radius, 0, (float)(Math.PI / 2), true); mPoint.X = rect.X + 10f; path.AddLineTo(mPoint); path.AddLineTo(new PointF(rect.X, rect.Height / 2)); mPoint.Y = rect.Y; path.AddLineTo(mPoint); path.ClosePath(); return path; }
public static void paintCodeDrawQRRETINA() { //// Color Declarations UIColor color2 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRect(new RectangleF(11.5f, 7.5f, 13, 14)); UIColor.White.SetFill(); rectanglePath.Fill(); UIColor.Black.SetStroke(); rectanglePath.LineWidth = 1; rectanglePath.Stroke(); //// Rectangle 2 Drawing var rectangle2Path = UIBezierPath.FromRect(new RectangleF(14.5f, 10.5f, 7, 8)); color2.SetFill(); rectangle2Path.Fill(); UIColor.Black.SetStroke(); rectangle2Path.LineWidth = 1; rectangle2Path.Stroke(); //// Rectangle 3 Drawing var rectangle3Path = UIBezierPath.FromRect(new RectangleF(57.5f, 7.5f, 13, 14)); UIColor.White.SetFill(); rectangle3Path.Fill(); UIColor.Black.SetStroke(); rectangle3Path.LineWidth = 1; rectangle3Path.Stroke(); //// Rectangle 4 Drawing var rectangle4Path = UIBezierPath.FromRect(new RectangleF(60.5f, 10.5f, 7, 8)); color2.SetFill(); rectangle4Path.Fill(); UIColor.Black.SetStroke(); rectangle4Path.LineWidth = 1; rectangle4Path.Stroke(); //// Rectangle 5 Drawing var rectangle5Path = UIBezierPath.FromRect(new RectangleF(11.5f, 36.5f, 13, 14)); UIColor.White.SetFill(); rectangle5Path.Fill(); UIColor.Black.SetStroke(); rectangle5Path.LineWidth = 1; rectangle5Path.Stroke(); //// Rectangle 6 Drawing var rectangle6Path = UIBezierPath.FromRect(new RectangleF(14.5f, 39.5f, 7, 8)); color2.SetFill(); rectangle6Path.Fill(); UIColor.Black.SetStroke(); rectangle6Path.LineWidth = 1; rectangle6Path.Stroke(); //// Star Drawing UIBezierPath starPath = new UIBezierPath(); starPath.MoveTo(new PointF(41.5f, 21.5f)); starPath.AddLineTo(new PointF(45.73f, 27.42f)); starPath.AddLineTo(new PointF(52.91f, 29.45f)); starPath.AddLineTo(new PointF(48.35f, 35.13f)); starPath.AddLineTo(new PointF(48.55f, 42.3f)); starPath.AddLineTo(new PointF(41.5f, 39.9f)); starPath.AddLineTo(new PointF(34.45f, 42.3f)); starPath.AddLineTo(new PointF(34.65f, 35.13f)); starPath.AddLineTo(new PointF(30.09f, 29.45f)); starPath.AddLineTo(new PointF(37.27f, 27.42f)); starPath.ClosePath(); UIColor.White.SetFill(); starPath.Fill(); color2.SetStroke(); starPath.LineWidth = 3.5f; starPath.Stroke(); //// Star 2 Drawing UIBezierPath star2Path = new UIBezierPath(); star2Path.MoveTo(new PointF(36.5f, 28.5f)); star2Path.AddLineTo(new PointF(36.5f, 28.5f)); star2Path.AddLineTo(new PointF(36.5f, 28.5f)); star2Path.AddLineTo(new PointF(36.5f, 28.5f)); star2Path.AddLineTo(new PointF(36.5f, 28.5f)); star2Path.AddLineTo(new PointF(36.5f, 28.5f)); star2Path.AddLineTo(new PointF(36.5f, 28.5f)); star2Path.AddLineTo(new PointF(36.5f, 28.5f)); star2Path.AddLineTo(new PointF(36.5f, 28.5f)); star2Path.AddLineTo(new PointF(36.5f, 28.5f)); star2Path.ClosePath(); UIColor.White.SetFill(); star2Path.Fill(); UIColor.Black.SetStroke(); star2Path.LineWidth = 1; star2Path.Stroke(); //// Star 3 Drawing UIBezierPath star3Path = new UIBezierPath(); star3Path.MoveTo(new PointF(32.5f, 11)); star3Path.AddLineTo(new PointF(34.62f, 13.83f)); star3Path.AddLineTo(new PointF(38.21f, 14.8f)); star3Path.AddLineTo(new PointF(35.92f, 17.52f)); star3Path.AddLineTo(new PointF(36.03f, 20.95f)); star3Path.AddLineTo(new PointF(32.5f, 19.8f)); star3Path.AddLineTo(new PointF(28.97f, 20.95f)); star3Path.AddLineTo(new PointF(29.08f, 17.52f)); star3Path.AddLineTo(new PointF(26.79f, 14.8f)); star3Path.AddLineTo(new PointF(30.38f, 13.83f)); star3Path.ClosePath(); UIColor.White.SetFill(); star3Path.Fill(); UIColor.Black.SetStroke(); star3Path.LineWidth = 2.5f; star3Path.Stroke(); //// Star 4 Drawing UIBezierPath star4Path = new UIBezierPath(); star4Path.MoveTo(new PointF(50, 11.5f)); star4Path.AddLineTo(new PointF(51.94f, 14.07f)); star4Path.AddLineTo(new PointF(55.23f, 14.95f)); star4Path.AddLineTo(new PointF(53.14f, 17.43f)); star4Path.AddLineTo(new PointF(53.23f, 20.55f)); star4Path.AddLineTo(new PointF(50, 19.5f)); star4Path.AddLineTo(new PointF(46.77f, 20.55f)); star4Path.AddLineTo(new PointF(46.86f, 17.43f)); star4Path.AddLineTo(new PointF(44.77f, 14.95f)); star4Path.AddLineTo(new PointF(48.06f, 14.07f)); star4Path.ClosePath(); UIColor.White.SetFill(); star4Path.Fill(); UIColor.Black.SetStroke(); star4Path.LineWidth = 2.5f; star4Path.Stroke(); //// Star 5 Drawing UIBezierPath star5Path = new UIBezierPath(); star5Path.MoveTo(new PointF(62.5f, 36.5f)); star5Path.AddLineTo(new PointF(64.97f, 40.1f)); star5Path.AddLineTo(new PointF(69.16f, 41.34f)); star5Path.AddLineTo(new PointF(66.49f, 44.8f)); star5Path.AddLineTo(new PointF(66.61f, 49.16f)); star5Path.AddLineTo(new PointF(62.5f, 47.7f)); star5Path.AddLineTo(new PointF(58.39f, 49.16f)); star5Path.AddLineTo(new PointF(58.51f, 44.8f)); star5Path.AddLineTo(new PointF(55.84f, 41.34f)); star5Path.AddLineTo(new PointF(60.03f, 40.1f)); star5Path.ClosePath(); UIColor.White.SetFill(); star5Path.Fill(); UIColor.Black.SetStroke(); star5Path.LineWidth = 2.5f; star5Path.Stroke(); }
public static void paintCodeDrawQRNONRetina() { //// Color Declarations UIColor color2 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRect(new RectangleF(3.5f, 2.5f, 10, 8)); UIColor.White.SetFill(); rectanglePath.Fill(); UIColor.Black.SetStroke(); rectanglePath.LineWidth = 1; rectanglePath.Stroke(); //// Rectangle 2 Drawing var rectangle2Path = UIBezierPath.FromRect(new RectangleF(6.5f, 4.5f, 4, 4)); color2.SetFill(); rectangle2Path.Fill(); UIColor.Black.SetStroke(); rectangle2Path.LineWidth = 1; rectangle2Path.Stroke(); //// Rectangle 3 Drawing var rectangle3Path = UIBezierPath.FromRect(new RectangleF(3.5f, 18.5f, 10, 8)); UIColor.White.SetFill(); rectangle3Path.Fill(); UIColor.Black.SetStroke(); rectangle3Path.LineWidth = 1; rectangle3Path.Stroke(); //// Rectangle 4 Drawing var rectangle4Path = UIBezierPath.FromRect(new RectangleF(6.5f, 20.5f, 4, 4)); color2.SetFill(); rectangle4Path.Fill(); UIColor.Black.SetStroke(); rectangle4Path.LineWidth = 1; rectangle4Path.Stroke(); //// Rectangle 5 Drawing var rectangle5Path = UIBezierPath.FromRect(new RectangleF(30.5f, 2.5f, 10, 8)); UIColor.White.SetFill(); rectangle5Path.Fill(); UIColor.Black.SetStroke(); rectangle5Path.LineWidth = 1; rectangle5Path.Stroke(); //// Rectangle 6 Drawing var rectangle6Path = UIBezierPath.FromRect(new RectangleF(33.5f, 4.5f, 4, 4)); color2.SetFill(); rectangle6Path.Fill(); UIColor.Black.SetStroke(); rectangle6Path.LineWidth = 1; rectangle6Path.Stroke(); //// Star Drawing UIBezierPath starPath = new UIBezierPath(); starPath.MoveTo(new PointF(26.5f, 8.5f)); starPath.AddLineTo(new PointF(29.67f, 13.39f)); starPath.AddLineTo(new PointF(35.06f, 15.06f)); starPath.AddLineTo(new PointF(31.64f, 19.76f)); starPath.AddLineTo(new PointF(31.79f, 25.69f)); starPath.AddLineTo(new PointF(26.5f, 23.7f)); starPath.AddLineTo(new PointF(21.21f, 25.69f)); starPath.AddLineTo(new PointF(21.36f, 19.76f)); starPath.AddLineTo(new PointF(17.94f, 15.06f)); starPath.AddLineTo(new PointF(23.33f, 13.39f)); starPath.ClosePath(); UIColor.White.SetFill(); starPath.Fill(); UIColor.Black.SetStroke(); starPath.LineWidth = 2.5f; starPath.Stroke(); //// Star 2 Drawing UIBezierPath star2Path = new UIBezierPath(); star2Path.MoveTo(new PointF(20.5f, 2.5f)); star2Path.AddLineTo(new PointF(21.56f, 4.56f)); star2Path.AddLineTo(new PointF(23.35f, 5.26f)); star2Path.AddLineTo(new PointF(22.21f, 7.24f)); star2Path.AddLineTo(new PointF(22.26f, 9.74f)); star2Path.AddLineTo(new PointF(20.5f, 8.9f)); star2Path.AddLineTo(new PointF(18.74f, 9.74f)); star2Path.AddLineTo(new PointF(18.79f, 7.24f)); star2Path.AddLineTo(new PointF(17.65f, 5.26f)); star2Path.AddLineTo(new PointF(19.44f, 4.56f)); star2Path.ClosePath(); UIColor.White.SetFill(); star2Path.Fill(); UIColor.Black.SetStroke(); star2Path.LineWidth = 2; star2Path.Stroke(); //// Star 3 Drawing UIBezierPath star3Path = new UIBezierPath(); star3Path.MoveTo(new PointF(41.5f, 21.5f)); star3Path.AddLineTo(new PointF(42.91f, 23.56f)); star3Path.AddLineTo(new PointF(45.3f, 24.26f)); star3Path.AddLineTo(new PointF(43.78f, 26.24f)); star3Path.AddLineTo(new PointF(43.85f, 28.74f)); star3Path.AddLineTo(new PointF(41.5f, 27.9f)); star3Path.AddLineTo(new PointF(39.15f, 28.74f)); star3Path.AddLineTo(new PointF(39.22f, 26.24f)); star3Path.AddLineTo(new PointF(37.7f, 24.26f)); star3Path.AddLineTo(new PointF(40.09f, 23.56f)); star3Path.ClosePath(); UIColor.White.SetFill(); star3Path.Fill(); UIColor.Black.SetStroke(); star3Path.LineWidth = 1.5f; star3Path.Stroke(); }
public override void Draw(RectangleF rect) { // Draw two appropriate corners, with cornerBackgroundColor behind them. if (this.CornerRadius < 0) { return; } float fMaxX = this.Bounds.GetMaxX(); float fMaxY =this.Bounds.GetMaxY(); UIBezierPath oPath = new UIBezierPath(); PointF oPt = PointF.Empty; switch (this.CornersPosition) { case CORNERS_POSITION.LeadingVertical: // top of screen for a left/right split oPath.MoveTo(oPt); oPt.Y += this.CornerRadius; oPath.AppendPath(UIBezierPath.FromArc(oPt, this.CornerRadius, this.Deg2Rad(90), 0f, true)); oPt.X += this.CornerRadius; oPt.Y -= this.CornerRadius; oPath.AddLineTo(oPt); oPath.AddLineTo(PointF.Empty); oPath.ClosePath();; oPt.X = fMaxX - this.CornerRadius; oPt.Y = 0; oPath.MoveTo(oPt); oPt.Y = fMaxY; oPath.AddLineTo(oPt); oPt.X += this.CornerRadius; oPath.AppendPath(UIBezierPath.FromArc(oPt, this.CornerRadius, this.Deg2Rad(180f), this.Deg2Rad(90), true)); oPt.Y -= this.CornerRadius; oPath.AddLineTo(oPt); oPt.X -= this.CornerRadius; oPath.AddLineTo(oPt); oPath.ClosePath(); break; case CORNERS_POSITION.TrailingVertical: // bottom of screen for a left/right split oPt.Y = fMaxY; oPath.MoveTo(oPt); oPt.Y -= this.CornerRadius; oPath.AppendPath(UIBezierPath.FromArc(oPt, this.CornerRadius, this.Deg2Rad(270f), this.Deg2Rad(360), false)); oPt.X +=this.CornerRadius; oPt.Y +=this.CornerRadius; oPath.AddLineTo(oPt); oPt.X -=this.CornerRadius; oPath.AddLineTo(oPt); oPath.ClosePath(); oPt.X = fMaxX -this.CornerRadius; oPt.Y = fMaxY; oPath.MoveTo(oPt); oPt.Y -=this.CornerRadius; oPath.AddLineTo(oPt); oPt.X +=this.CornerRadius; oPath.AppendPath(UIBezierPath.FromArc(oPt, this.CornerRadius, this.Deg2Rad(180f), this.Deg2Rad(270f), false)); oPt.Y +=this.CornerRadius; oPath.AddLineTo(oPt); oPt.X -=this.CornerRadius; oPath.AddLineTo(oPt); oPath.ClosePath(); break; case CORNERS_POSITION.LeadingHorizontal: // left of screen for a top/bottom split oPt.X = 0; oPt.Y =this.CornerRadius; oPath.MoveTo(oPt); oPt.Y -=this.CornerRadius; oPath.AddLineTo(oPt); oPt.X +=this.CornerRadius; oPath.AppendPath(UIBezierPath.FromArc(oPt, this.CornerRadius, this.Deg2Rad(180), this.Deg2Rad(270), false)); oPt.Y +=this.CornerRadius; oPath.AddLineTo(oPt); oPt.X -=this.CornerRadius; oPath.AddLineTo(oPt); oPath.ClosePath(); oPt.X = 0; oPt.Y = fMaxY -this.CornerRadius; oPath.MoveTo(oPt); oPt.Y = fMaxY; oPath.AddLineTo(oPt); oPt.X +=this.CornerRadius; oPath.AppendPath(UIBezierPath.FromArc(oPt, this.CornerRadius, this.Deg2Rad(180f), this.Deg2Rad(90f), true)); oPt.Y -=this.CornerRadius; oPath.AddLineTo(oPt); oPt.X -=this.CornerRadius; oPath.AddLineTo(oPt); oPath.ClosePath(); break; case CORNERS_POSITION.TrailingHorizontal: // right of screen for a top/bottom split oPt.Y =this.CornerRadius; oPath.MoveTo(oPt); oPt.Y -=this.CornerRadius; oPath.AppendPath(UIBezierPath.FromArc(oPt, this.CornerRadius, this.Deg2Rad(270f), this.Deg2Rad(360f), false)); oPt.X +=this.CornerRadius; oPt.Y +=this.CornerRadius; oPath.AddLineTo(oPt); oPt.X -=this.CornerRadius; oPath.AddLineTo(oPt); oPath.ClosePath(); oPt.Y = fMaxY -this.CornerRadius; oPath.MoveTo(oPt); oPt.Y +=this.CornerRadius; oPath.AppendPath(UIBezierPath.FromArc(oPt, this.CornerRadius, this.Deg2Rad(90), 0f, true)); oPt.X +=this.CornerRadius; oPt.Y -=this.CornerRadius; oPath.AddLineTo(oPt); oPt.X -=this.CornerRadius; oPath.AddLineTo(oPt); oPath.ClosePath(); break; default: break; } this.CornerBackgroundColor.SetFill(); this.CornerBackgroundColor.SetStroke(); oPath.Fill(); }
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 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 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 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(); } } }