public override void Draw (CGRect rect) { TintColor.SetColor (); CGRect bounds = Bounds; float x = (float)bounds.Right - LineWidth; for (int n = 0; n < Count; n++) { x -= LineMargin; if ((n + 1) % LineGroupCount == 0) { UIBezierPath path = new UIBezierPath (); path.MoveTo ( new CGPoint (x + 0.5f * LineWidth, bounds.Top + 0.5f * LineWidth)); path.AddLineTo ( new CGPoint (x + 0.5f * LineWidth + LineGroupCount * LineMargin, bounds.Bottom - 0.5f * LineWidth)); path.Stroke (); } else { CGRect lineRect = bounds; lineRect.X = x; lineRect.Width = LineWidth; UIGraphics.RectFill (lineRect); } } }
//// Drawing Methods public static void DrawRefreshIcon(UIColor strokeColor) { //// Group 2 { //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(22.65f, 2.0f)); bezierPath.AddCurveToPoint(new CGPoint(36.33f, 7.67f), new CGPoint(27.6f, 2.0f), new CGPoint(32.55f, 3.89f)); bezierPath.AddCurveToPoint(new CGPoint(38.13f, 32.97f), new CGPoint(43.23f, 14.57f), new CGPoint(43.83f, 25.39f)); bezierPath.AddLineTo(new CGPoint(34.26f, 36.84f)); strokeColor.SetStroke(); bezierPath.LineWidth = 1.0f; bezierPath.Stroke(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new CGPoint(21.35f, 42.0f)); bezier2Path.AddCurveToPoint(new CGPoint(7.67f, 36.33f), new CGPoint(16.4f, 42.0f), new CGPoint(11.45f, 40.11f)); bezier2Path.AddCurveToPoint(new CGPoint(5.87f, 11.03f), new CGPoint(0.77f, 29.43f), new CGPoint(0.17f, 18.61f)); bezier2Path.AddLineTo(new CGPoint(9.74f, 7.16f)); strokeColor.SetStroke(); bezier2Path.LineWidth = 1.0f; bezier2Path.Stroke(); //// Bezier 3 Drawing UIBezierPath bezier3Path = new UIBezierPath(); bezier3Path.MoveTo(new CGPoint(34.26f, 29.74f)); bezier3Path.AddLineTo(new CGPoint(34.26f, 36.84f)); bezier3Path.AddLineTo(new CGPoint(41.35f, 36.84f)); bezier3Path.LineJoinStyle = CGLineJoin.Bevel; strokeColor.SetStroke(); bezier3Path.LineWidth = 1.0f; bezier3Path.Stroke(); //// Bezier 4 Drawing UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new CGPoint(9.74f, 14.26f)); bezier4Path.AddLineTo(new CGPoint(9.74f, 7.16f)); bezier4Path.AddLineTo(new CGPoint(2.65f, 7.16f)); bezier4Path.LineJoinStyle = CGLineJoin.Bevel; strokeColor.SetStroke(); bezier4Path.LineWidth = 1.0f; bezier4Path.Stroke(); } }
public override void Draw(CGRect frame) { // General Declarations var context = UIGraphics.GetCurrentContext(); // Color Declarations var color4 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); var color5 = UIColor.FromRGBA(0.793f, 0.793f, 0.793f, 1.000f); // Shadow Declarations var shadow = new NSShadow(); shadow.ShadowColor = UIColor.Black.ColorWithAlpha(0.28f); shadow.ShadowOffset = new CGSize(3.1f, 3.1f); shadow.ShadowBlurRadius = 5.0f; // Rectangle Drawing var rectanglePath = UIBezierPath.FromRoundedRect( new CGRect(frame.GetMinX() + 10.5f, frame.GetMinY() + 7.5f, frame.Width - 20.0f, 76.0f), 4.0f); context.SaveState(); context.SetShadow(shadow.ShadowOffset, shadow.ShadowBlurRadius, shadow.ShadowColor.CGColor); color4.SetFill(); rectanglePath.Fill(); context.RestoreState(); color5.SetStroke(); rectanglePath.LineWidth = 1.0f; rectanglePath.Stroke(); // Bezier 2 Drawing var bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new CGPoint(frame.GetMinX() + 0.02386f*frame.Width, frame.GetMinY() + 0.50543f*frame.Height)); bezier2Path.AddLineTo(new CGPoint(frame.GetMinX() + 0.97841f*frame.Width, frame.GetMinY() + 0.50543f*frame.Height)); context.SaveState(); context.SetShadow(shadow.ShadowOffset, shadow.ShadowBlurRadius, shadow.ShadowColor.CGColor); color4.SetFill(); bezier2Path.Fill(); context.RestoreState(); color5.SetStroke(); bezier2Path.LineWidth = 1.0f; bezier2Path.Stroke(); }
public static void DrawArrowIcon(UIColor strokeColor) { //// Group { //// Oval Drawing var ovalPath = UIBezierPath.FromOval(new CGRect(2.0f, 2.0f, 40.0f, 40.0f)); strokeColor.SetStroke(); ovalPath.LineWidth = 1.0f; ovalPath.Stroke(); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(18.77f, 11.03f)); bezierPath.AddLineTo(new CGPoint(29.74f, 22.0f)); bezierPath.AddLineTo(new CGPoint(18.77f, 32.97f)); bezierPath.LineJoinStyle = CGLineJoin.Bevel; strokeColor.SetStroke(); bezierPath.LineWidth = 1.0f; bezierPath.Stroke(); } }
public override void Draw (CGRect rect) { rect = rect.Inset (4, 4); rect = new CGRect ((rect.Size.Width - rect.Size.Height) / 2 + 4, 8, rect.Size.Height, rect.Size.Height); UIBezierPath path = UIBezierPath.FromOval (rect); UIColor.Black.SetStroke (); UIColor.White.SetFill (); path.LineWidth = 2; path.Fill (); path.Stroke (); UIBezierPath rightEye, leftEye, mouth = new UIBezierPath (); if (MovingRight) { rightEye = UIBezierPath.FromArc (new CGPoint (rect.GetMidX () - 5, rect.Y + 15), 4, 0, 180, true); leftEye = UIBezierPath.FromArc (new CGPoint (rect.GetMidX () + 10, rect.Y + 15), 4, 0, 180, true); mouth.MoveTo (new CGPoint (rect.GetMidX (), rect.Y + 30)); mouth.AddLineTo (new CGPoint (rect.GetMidX () + 13, rect.Y + 30)); } else { rightEye = UIBezierPath.FromArc (new CGPoint (rect.GetMidX () - 10, rect.Y + 15), 4, 0, 180, true); leftEye = UIBezierPath.FromArc (new CGPoint (rect.GetMidX () + 5, rect.Y + 15), 4, 0, 180, true); mouth.MoveTo (new CGPoint (rect.GetMidX (), rect.Y + 30)); mouth.AddLineTo (new CGPoint (rect.GetMidX () - 13, rect.Y + 30)); } rightEye.LineWidth = 2; rightEye.Stroke (); leftEye.LineWidth = 2; leftEye.Stroke (); mouth.LineWidth = 2; mouth.Stroke (); }
// To intermix custom drawing with the drawing performed by an associated print formatter, // this method is called for each print formatter associated with a given page. // // We do this to intermix/overlay our custom drawing onto the recipe presentation. // We draw the upper portion of the recipe presentation by hand (image, title, desc), // and the bottom portion is drawn via the UIMarkupTextPrintFormatter. public override void DrawPrintFormatterForPage (UIPrintFormatter printFormatter, nint page) { base.DrawPrintFormatterForPage (printFormatter, page); // To keep our custom drawing in sync with the printFormatter, base our drawing // on the formatters rect. CGRect rect = printFormatter.RectangleForPage (page); // Use a bezier path to draw the borders. // We may potentially choose not to draw either the top or bottom line // of the border depending on whether our recipe extended from the previous // page, or carries onto the subsequent page. UIBezierPath border = new UIBezierPath (); if (page == printFormatter.StartPage) { // For border drawing, get the rect that includes the formatter area plus the header area. // Move the formatter's rect up the size of the custom drawn recipe presentation // and essentially grow the rect's height by this amount. rect.Height += RecipeInfoHeight; rect.Y -= RecipeInfoHeight; border.MoveTo (rect.Location); border.AddLineTo (new CGPoint (rect.Right, rect.Top)); Recipe recipe = recipeFormatterMap[printFormatter]; // Run custom code to draw upper portion of the recipe presentation (image, title, desc) DrawRecipe (recipe, rect); } // Draw the left border border.MoveTo (rect.Location); border.AddLineTo (new CGPoint (rect.Left, rect.Bottom)); // Draw the right border border.MoveTo (new CGPoint (rect.Right, rect.Top)); border.AddLineTo (new CGPoint (rect.Right, rect.Bottom)); if (page == printFormatter.StartPage + printFormatter.PageCount - 1) border.AddLineTo (new CGPoint (rect.Left, rect.Bottom)); // Set the UIColor to be used by the current graphics context, and then stroke // stroke the current path that is defined by the border bezier path. UIColor.Black.SetColor (); border.Stroke (); }
public override void Draw(CGRect rect) { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations var fillColor = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); var strokeColor3 = UIColor.FromRGBA(0.716f, 0.716f, 0.716f, 1.000f); var shadowTint2 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); var strokeColor4 = UIColor.FromRGBA(0.807f, 0.807f, 0.807f, 1.000f); var fillColor4 = UIColor.FromRGBA(0.969f, 0.969f, 0.969f, 1.000f); var fillColor6 = UIColor.FromRGBA(0.314f, 0.824f, 0.761f, 1.000f); var strokeColor5 = UIColor.FromRGBA(0.855f, 0.855f, 0.855f, 1.000f); //// Shadow Declarations var shadow3 = new NSShadow(); shadow3.ShadowColor = shadowTint2.ColorWithAlpha(shadowTint2.CGColor.Alpha * 0.13f); shadow3.ShadowOffset = new CGSize(1450.1f, 2.1f); shadow3.ShadowBlurRadius = 4.0f; //// Group 5 { context.SaveState(); context.BeginTransparencyLayer(); //// Clip Clip 5 var clip5Path = UIBezierPath.FromRect(new CGRect(rect.GetMinX() + 4.0f, rect.GetMinY() + 248.55f, 686.9f, 265.6f)); clip5Path.AddClip(); //// Rectangle 6 Drawing var rectangle6Path = UIBezierPath.FromRect(new CGRect(rect.GetMinX() + 4.0f, rect.GetMinY() + 248.55f, 686.9f, 265.6f)); strokeColor4.SetStroke(); rectangle6Path.LineWidth = 2.0f; rectangle6Path.Stroke(); context.EndTransparencyLayer(); context.RestoreState(); } //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(rect.GetMinX() + 687.41f, rect.GetMinY() + 349.29f)); bezierPath.AddLineTo(new CGPoint(rect.GetMinX() + 5.5f, rect.GetMinY() + 353.29f)); bezierPath.LineCapStyle = CGLineCap.Square; strokeColor3.SetStroke(); bezierPath.LineWidth = 1.0f; bezierPath.Stroke(); //// Group { context.SaveState(); context.BeginTransparencyLayer(); //// Clip Clip var clipPath = UIBezierPath.FromRect(new CGRect(rect.GetMinX() - 13.0f, rect.GetMinY() - 17.0f, 725.0f, 556.0f)); clipPath.AddClip(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new CGPoint(rect.GetMinX() - 1448.0f, rect.GetMinY() + 2.0f)); bezier2Path.AddCurveToPoint(new CGPoint(rect.GetMinX() - 1444.0f, rect.GetMinY() - 2.0f), new CGPoint(rect.GetMinX() - 1448.0f, rect.GetMinY() - 0.21f), new CGPoint(rect.GetMinX() - 1446.2f, rect.GetMinY() - 2.0f)); bezier2Path.AddLineTo(new CGPoint(rect.GetMinX() - 765.08f, rect.GetMinY() - 2.0f)); bezier2Path.AddCurveToPoint(new CGPoint(rect.GetMinX() - 761.09f, rect.GetMinY() + 2.0f), new CGPoint(rect.GetMinX() - 762.87f, rect.GetMinY() - 2.0f), new CGPoint(rect.GetMinX() - 761.09f, rect.GetMinY() - 0.21f)); bezier2Path.AddLineTo(new CGPoint(rect.GetMinX() - 761.09f, rect.GetMinY() + 509.16f)); bezier2Path.AddCurveToPoint(new CGPoint(rect.GetMinX() - 765.08f, rect.GetMinY() + 513.16f), new CGPoint(rect.GetMinX() - 761.09f, rect.GetMinY() + 511.37f), new CGPoint(rect.GetMinX() - 762.88f, rect.GetMinY() + 513.16f)); bezier2Path.AddLineTo(new CGPoint(rect.GetMinX() - 1444.0f, rect.GetMinY() + 513.16f)); bezier2Path.AddCurveToPoint(new CGPoint(rect.GetMinX() - 1448.0f, rect.GetMinY() + 509.16f), new CGPoint(rect.GetMinX() - 1446.21f, rect.GetMinY() + 513.16f), new CGPoint(rect.GetMinX() - 1448.0f, rect.GetMinY() + 511.37f)); bezier2Path.AddLineTo(new CGPoint(rect.GetMinX() - 1448.0f, rect.GetMinY() + 2.0f)); bezier2Path.ClosePath(); bezier2Path.UsesEvenOddFillRule = true; context.SaveState(); context.SetShadow(shadow3.ShadowOffset, shadow3.ShadowBlurRadius, shadow3.ShadowColor.CGColor); fillColor.SetFill(); bezier2Path.Fill(); context.RestoreState(); context.EndTransparencyLayer(); context.RestoreState(); } //// Group 2 { context.SaveState(); context.BeginTransparencyLayer(); //// Clip Clip 3 UIBezierPath clip3Path = new UIBezierPath(); clip3Path.MoveTo(new CGPoint(rect.GetMinX() - 15.49f, rect.GetMinY() - 22.5f)); clip3Path.AddLineTo(new CGPoint(rect.GetMinX() + 712.41f, rect.GetMinY() - 22.5f)); clip3Path.AddLineTo(new CGPoint(rect.GetMinX() + 712.41f, rect.GetMinY() + 533.66f)); clip3Path.AddLineTo(new CGPoint(rect.GetMinX() - 15.49f, rect.GetMinY() + 533.66f)); clip3Path.AddLineTo(new CGPoint(rect.GetMinX() - 15.49f, rect.GetMinY() - 22.5f)); clip3Path.ClosePath(); clip3Path.MoveTo(new CGPoint(rect.GetMinX() + 5.51f, rect.GetMinY() + 2.0f)); clip3Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 9.0f, rect.GetMinY() - 1.5f), new CGPoint(rect.GetMinX() + 5.51f, rect.GetMinY() + 0.07f), new CGPoint(rect.GetMinX() + 7.07f, rect.GetMinY() - 1.5f)); clip3Path.AddLineTo(new CGPoint(rect.GetMinX() + 687.92f, rect.GetMinY() - 1.5f)); clip3Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 691.41f, rect.GetMinY() + 2.0f), new CGPoint(rect.GetMinX() + 689.85f, rect.GetMinY() - 1.5f), new CGPoint(rect.GetMinX() + 691.41f, rect.GetMinY() + 0.07f)); clip3Path.AddLineTo(new CGPoint(rect.GetMinX() + 691.41f, rect.GetMinY() + 509.16f)); clip3Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 687.92f, rect.GetMinY() + 512.66f), new CGPoint(rect.GetMinX() + 691.41f, rect.GetMinY() + 511.09f), new CGPoint(rect.GetMinX() + 689.85f, rect.GetMinY() + 512.66f)); clip3Path.AddLineTo(new CGPoint(rect.GetMinX() + 9.0f, rect.GetMinY() + 512.66f)); clip3Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 5.51f, rect.GetMinY() + 509.16f), new CGPoint(rect.GetMinX() + 7.07f, rect.GetMinY() + 512.66f), new CGPoint(rect.GetMinX() + 5.51f, rect.GetMinY() + 511.09f)); clip3Path.AddLineTo(new CGPoint(rect.GetMinX() + 5.51f, rect.GetMinY() + 2.0f)); clip3Path.ClosePath(); clip3Path.MoveTo(new CGPoint(rect.GetMinX() + 4.51f, rect.GetMinY() + 2.0f)); clip3Path.AddLineTo(new CGPoint(rect.GetMinX() + 4.51f, rect.GetMinY() + 509.16f)); clip3Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 9.0f, rect.GetMinY() + 513.66f), new CGPoint(rect.GetMinX() + 4.51f, rect.GetMinY() + 511.65f), new CGPoint(rect.GetMinX() + 6.52f, rect.GetMinY() + 513.66f)); clip3Path.AddLineTo(new CGPoint(rect.GetMinX() + 687.92f, rect.GetMinY() + 513.66f)); clip3Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 692.41f, rect.GetMinY() + 509.16f), new CGPoint(rect.GetMinX() + 690.4f, rect.GetMinY() + 513.66f), new CGPoint(rect.GetMinX() + 692.41f, rect.GetMinY() + 511.64f)); clip3Path.AddLineTo(new CGPoint(rect.GetMinX() + 692.41f, rect.GetMinY() + 2.0f)); clip3Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 687.92f, rect.GetMinY() - 2.5f), new CGPoint(rect.GetMinX() + 692.41f, rect.GetMinY() - 0.49f), new CGPoint(rect.GetMinX() + 690.4f, rect.GetMinY() - 2.5f)); clip3Path.AddLineTo(new CGPoint(rect.GetMinX() + 9.0f, rect.GetMinY() - 2.5f)); clip3Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 4.51f, rect.GetMinY() + 2.0f), new CGPoint(rect.GetMinX() + 6.52f, rect.GetMinY() - 2.5f), new CGPoint(rect.GetMinX() + 4.51f, rect.GetMinY() - 0.48f)); clip3Path.ClosePath(); clip3Path.UsesEvenOddFillRule = true; clip3Path.AddClip(); //// Group 3 { context.SaveState(); context.BeginTransparencyLayer(); //// Clip Clip 2 var clip2Path = UIBezierPath.FromRoundedRect(new CGRect(rect.GetMinX() + 5.0f, rect.GetMinY() - 1.98f, 686.9f, 515.15f), 4.0f); clip2Path.AddClip(); //// Rectangle 2 Drawing var rectangle2Path = UIBezierPath.FromRoundedRect(new CGRect(rect.GetMinX() + 5.0f, rect.GetMinY() - 1.98f, 686.9f, 515.15f), 4.0f); fillColor.SetFill(); rectangle2Path.Fill(); context.EndTransparencyLayer(); context.RestoreState(); } context.EndTransparencyLayer(); context.RestoreState(); } //// Group 4 { context.SaveState(); context.BeginTransparencyLayer(); //// Clip Clip 4 var clip4Path = UIBezierPath.FromRoundedRect(new CGRect(rect.GetMinX() + 4.0f, rect.GetMinY() + 3.02f, 686.9f, 515.15f), 4.0f); clip4Path.AddClip(); //// Rectangle 4 Drawing var rectangle4Path = UIBezierPath.FromRoundedRect(new CGRect(rect.GetMinX() + 4.0f, rect.GetMinY() + 3.02f, 686.9f, 515.15f), 4.0f); strokeColor4.SetStroke(); rectangle4Path.LineWidth = 2.0f; rectangle4Path.Stroke(); context.EndTransparencyLayer(); context.RestoreState(); } //// Bezier 4 Drawing UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new CGPoint(rect.GetMinX() + 689.51f, rect.GetMinY() + 248.57f)); bezier4Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 690.01f, rect.GetMinY() + 249.06f), new CGPoint(rect.GetMinX() + 689.51f, rect.GetMinY() + 248.56f), new CGPoint(rect.GetMinX() + 690.01f, rect.GetMinY() + 249.06f)); bezier4Path.AddLineTo(new CGPoint(rect.GetMinX() + 689.51f, rect.GetMinY() + 249.06f)); bezier4Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 689.51f, rect.GetMinY() + 248.56f), new CGPoint(rect.GetMinX() + 689.51f, rect.GetMinY() + 248.73f), new CGPoint(rect.GetMinX() + 689.51f, rect.GetMinY() + 248.56f)); bezier4Path.AddLineTo(new CGPoint(rect.GetMinX() + 689.51f, rect.GetMinY() + 248.57f)); bezier4Path.ClosePath(); bezier4Path.MoveTo(new CGPoint(rect.GetMinX() + 5.5f, rect.GetMinY() + 248.57f)); bezier4Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 5.5f, rect.GetMinY() + 249.06f), new CGPoint(rect.GetMinX() + 5.5f, rect.GetMinY() + 248.56f), new CGPoint(rect.GetMinX() + 5.5f, rect.GetMinY() + 248.73f)); bezier4Path.AddLineTo(new CGPoint(rect.GetMinX() + 689.51f, rect.GetMinY() + 249.06f)); bezier4Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 689.51f, rect.GetMinY() + 513.66f), new CGPoint(rect.GetMinX() + 689.51f, rect.GetMinY() + 261.48f), new CGPoint(rect.GetMinX() + 689.51f, rect.GetMinY() + 501.24f)); bezier4Path.AddLineTo(new CGPoint(rect.GetMinX() + 690.01f, rect.GetMinY() + 513.66f)); bezier4Path.AddLineTo(new CGPoint(rect.GetMinX() + 689.51f, rect.GetMinY() + 514.16f)); bezier4Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 689.51f, rect.GetMinY() + 513.66f), new CGPoint(rect.GetMinX() + 689.51f, rect.GetMinY() + 514.16f), new CGPoint(rect.GetMinX() + 689.51f, rect.GetMinY() + 513.99f)); bezier4Path.AddLineTo(new CGPoint(rect.GetMinX() + 5.5f, rect.GetMinY() + 513.66f)); bezier4Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 5.5f, rect.GetMinY() + 249.06f), new CGPoint(rect.GetMinX() + 5.5f, rect.GetMinY() + 501.24f), new CGPoint(rect.GetMinX() + 5.5f, rect.GetMinY() + 261.48f)); bezier4Path.AddLineTo(new CGPoint(rect.GetMinX() + 5.01f, rect.GetMinY() + 249.06f)); bezier4Path.AddLineTo(new CGPoint(rect.GetMinX() + 5.5f, rect.GetMinY() + 248.56f)); bezier4Path.AddLineTo(new CGPoint(rect.GetMinX() + 5.5f, rect.GetMinY() + 248.57f)); bezier4Path.ClosePath(); bezier4Path.MoveTo(new CGPoint(rect.GetMinX() + 5.5f, rect.GetMinY() + 513.66f)); bezier4Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 5.5f, rect.GetMinY() + 514.16f), new CGPoint(rect.GetMinX() + 5.5f, rect.GetMinY() + 513.99f), new CGPoint(rect.GetMinX() + 5.5f, rect.GetMinY() + 514.16f)); bezier4Path.AddLineTo(new CGPoint(rect.GetMinX() + 5.01f, rect.GetMinY() + 513.66f)); bezier4Path.AddLineTo(new CGPoint(rect.GetMinX() + 5.5f, rect.GetMinY() + 513.66f)); bezier4Path.ClosePath(); fillColor4.SetFill(); bezier4Path.Fill(); //// Bezier 5 Drawing UIBezierPath bezier5Path = new UIBezierPath(); bezier5Path.MoveTo(new CGPoint(rect.GetMinX() + 4.01f, rect.GetMinY() + 513.16f)); bezier5Path.AddLineTo(new CGPoint(rect.GetMinX() + 690.91f, rect.GetMinY() + 513.16f)); bezier5Path.AddLineTo(new CGPoint(rect.GetMinX() + 690.91f, rect.GetMinY() + 589.34f)); bezier5Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 686.91f, rect.GetMinY() + 593.34f), new CGPoint(rect.GetMinX() + 690.91f, rect.GetMinY() + 591.55f), new CGPoint(rect.GetMinX() + 689.13f, rect.GetMinY() + 593.34f)); bezier5Path.AddLineTo(new CGPoint(rect.GetMinX() + 350.63f, rect.GetMinY() + 593.34f)); bezier5Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 342.63f, rect.GetMinY() + 593.34f), new CGPoint(rect.GetMinX() + 348.42f, rect.GetMinY() + 593.34f), new CGPoint(rect.GetMinX() + 344.84f, rect.GetMinY() + 593.34f)); bezier5Path.AddLineTo(new CGPoint(rect.GetMinX() + 8.01f, rect.GetMinY() + 593.34f)); bezier5Path.AddCurveToPoint(new CGPoint(rect.GetMinX() + 4.01f, rect.GetMinY() + 589.34f), new CGPoint(rect.GetMinX() + 5.8f, rect.GetMinY() + 593.34f), new CGPoint(rect.GetMinX() + 4.01f, rect.GetMinY() + 591.55f)); bezier5Path.AddLineTo(new CGPoint(rect.GetMinX() + 4.01f, rect.GetMinY() + 513.16f)); bezier5Path.ClosePath(); bezier5Path.UsesEvenOddFillRule = true; fillColor6.SetFill(); bezier5Path.Fill(); //// Bezier 6 Drawing UIBezierPath bezier6Path = new UIBezierPath(); bezier6Path.MoveTo(new CGPoint(rect.GetMinX() + 345.0f, rect.GetMinY() + 110.0f)); bezier6Path.AddLineTo(new CGPoint(rect.GetMinX() + 345.46f, rect.GetMinY() + 4.0f)); bezier6Path.LineCapStyle = CGLineCap.Square; strokeColor5.SetStroke(); bezier6Path.LineWidth = 2.0f; bezier6Path.Stroke(); //// Bezier 7 Drawing UIBezierPath bezier7Path = new UIBezierPath(); bezier7Path.MoveTo(new CGPoint(rect.GetMinX() + 689.01f, rect.GetMinY() + 399.9f)); bezier7Path.AddLineTo(new CGPoint(rect.GetMinX() + 5.01f, rect.GetMinY() + 399.9f)); bezier7Path.LineCapStyle = CGLineCap.Square; strokeColor5.SetStroke(); bezier7Path.LineWidth = 2.0f; bezier7Path.Stroke(); //// Bezier 8 Drawing UIBezierPath bezier8Path = new UIBezierPath(); bezier8Path.MoveTo(new CGPoint(rect.GetMinX() + 688.91f, rect.GetMinY() + 110.25f)); bezier8Path.AddLineTo(new CGPoint(rect.GetMinX() + 6.01f, rect.GetMinY() + 110.25f)); bezier8Path.LineCapStyle = CGLineCap.Square; strokeColor5.SetStroke(); bezier8Path.LineWidth = 2.0f; bezier8Path.Stroke(); }
public override void Draw (CGRect rect) { base.Draw (rect); // ------------- START PAINTCODE ---------------- //// General Declarations using (var colorSpace = CGColorSpace.CreateDeviceRGB ()) { using (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 nfloat [] { 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 nfloat [] { 0, 0.26f, 0.26f }; var calendarGradient = new CGGradient (colorSpace, calendarGradientColors, calendarGradientLocations); //// Shadow Declarations var shadow = UIColor.DarkGray.CGColor; var shadowOffset = new CGSize (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 CGRect (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 CGRect (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 CGRect (8.5f, 60.5f, 37, 36), 4); context.SaveState (); context.SetShadow (shadowOffset, shadowBlurRadius, shadow); context.BeginTransparencyLayer (null); roundedRectanglePath.AddClip (); context.DrawLinearGradient (calendarGradient, new CGPoint (27, 96.5f), new CGPoint (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 CGPoint (9, 91.2f)); roundedRectangle3Path.AddCurveToPoint (new CGPoint (12.56f, 95), new CGPoint (9, 93.3f), new CGPoint (10.32f, 95)); roundedRectangle3Path.AddLineTo (new CGPoint (40.94f, 95)); roundedRectangle3Path.AddCurveToPoint (new CGPoint (45, 91.2f), new CGPoint (43.18f, 95), new CGPoint (45, 93.3f)); roundedRectangle3Path.AddLineTo (new CGPoint (45, 87)); roundedRectangle3Path.AddCurveToPoint (new CGPoint (43.42f, 85.5f), new CGPoint (45, 84.9f), new CGPoint (45.66f, 85.5f)); roundedRectangle3Path.AddLineTo (new CGPoint (10.94f, 85.5f)); roundedRectangle3Path.AddCurveToPoint (new CGPoint (9, 87), new CGPoint (8.7f, 85.5f), new CGPoint (9, 84.9f)); roundedRectangle3Path.AddLineTo (new CGPoint (9, 91.2f)); roundedRectangle3Path.ClosePath (); UIColor.Red.SetFill (); roundedRectangle3Path.Fill (); //// Month Drawing var monthRect = new CGRect (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 CGRect (0, 58, 54, 31); UIColor.Black.SetFill (); new NSString (dayContent).DrawString (dayRect, dayFont, UILineBreakMode.WordWrap, UITextAlignment.Center); //// Text Drawing var textRect = new CGRect (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 CGPoint (31, 14.5f)); starPath.AddLineTo (new CGPoint (26.24f, 21.45f)); starPath.AddLineTo (new CGPoint (18.16f, 23.83f)); starPath.AddLineTo (new CGPoint (23.3f, 30.5f)); starPath.AddLineTo (new CGPoint (23.06f, 38.92f)); starPath.AddLineTo (new CGPoint (31, 36.1f)); starPath.AddLineTo (new CGPoint (38.94f, 38.92f)); starPath.AddLineTo (new CGPoint (38.7f, 30.5f)); starPath.AddLineTo (new CGPoint (43.84f, 23.83f)); starPath.AddLineTo (new CGPoint (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 CGPoint (256.5f, 16.5f)); blueBlobPath.AddCurveToPoint (new CGPoint (240.5f, 41.5f), new CGPoint (235.5f, 37.5f), new CGPoint (217.53f, 41.55f)); blueBlobPath.AddCurveToPoint (new CGPoint (265.5f, 30.5f), new CGPoint (263.47f, 41.45f), new CGPoint (265.5f, 30.5f)); blueBlobPath.AddCurveToPoint (new CGPoint (256.5f, 16.5f), new CGPoint (265.5f, 30.5f), new CGPoint (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 CGRect (54.5f, 10.5f, 163, 31), 4); context.SaveState (); buttonPath.AddClip (); context.DrawRadialGradient (newGradient, new CGPoint (100.39f, 55.13f), 7.84f, new CGPoint (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 CGRect (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 CGRect (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 CGRect (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 CGPoint (172.5f, 80.5f)); bezier2Path.AddCurveToPoint (new CGPoint (185.5f, 85.5f), new CGPoint (177.75f, 85), new CGPoint (182.04f, 86.03f)); bezier2Path.AddCurveToPoint (new CGPoint (194.5f, 79.5f), new CGPoint (191.27f, 84.62f), new CGPoint (194.5f, 79.5f)); UIColor.Black.SetStroke (); bezier2Path.LineWidth = 2; bezier2Path.Stroke (); //// Oval 5 Drawing var oval5Path = UIBezierPath.FromOval (new CGRect (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 CGRect (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 CGRect (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 CGRect (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 CGRect (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 CGRect (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 CGRect (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 CGPoint (270.5f, 81.5f)); bezier5Path.AddCurveToPoint (new CGPoint (267.5f, 88.5f), new CGPoint (269.5f, 85.5f), new CGPoint (267.5f, 88.5f)); UIColor.Black.SetStroke (); bezier5Path.LineWidth = 1; bezier5Path.Stroke (); //// Bezier 6 Drawing UIBezierPath bezier6Path = new UIBezierPath (); bezier6Path.MoveTo (new CGPoint (272.5f, 81.5f)); bezier6Path.AddLineTo (new CGPoint (274.5f, 87.5f)); UIColor.Black.SetStroke (); bezier6Path.LineWidth = 1; bezier6Path.Stroke (); } } // ------------- END PAINTCODE ---------------- }
void DrawControl(CGRect frame, string name, string country, string abv, string ibu, string srm) { BackgroundColor = UIColor.Clear; Layer.BackgroundColor = UIColor.Clear.CGColor; //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations var fillColor = UIColor.FromRGBA(0.110f, 0.122f, 0.153f, 1.000f); var textForeground = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); var fillColor2 = UIColor.FromRGBA(0.773f, 0.816f, 0.871f, 1.000f); var textForeground2 = UIColor.FromRGBA(0.773f, 0.816f, 0.871f, 1.000f); var fillColor3 = UIColor.FromRGBA(0.169f, 0.188f, 0.231f, 1.000f); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(frame.GetMinX() + 0.00145f * frame.Width, frame.GetMinY() + 0.04170f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.01299f * frame.Width, frame.GetMinY() + 0.00467f * frame.Height), new CGPoint(frame.GetMinX() + 0.00145f * frame.Width, frame.GetMinY() + 0.02125f * frame.Height), new CGPoint(frame.GetMinX() + 0.00664f * frame.Width, frame.GetMinY() + 0.00467f * frame.Height)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.98701f * frame.Width, frame.GetMinY() + 0.00467f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.99855f * frame.Width, frame.GetMinY() + 0.04170f * frame.Height), new CGPoint(frame.GetMinX() + 0.99338f * frame.Width, frame.GetMinY() + 0.00467f * frame.Height), new CGPoint(frame.GetMinX() + 0.99855f * frame.Width, frame.GetMinY() + 0.02125f * frame.Height)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.99855f * frame.Width, frame.GetMinY() + 0.95830f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.98701f * frame.Width, frame.GetMinY() + 0.99533f * frame.Height), new CGPoint(frame.GetMinX() + 0.99855f * frame.Width, frame.GetMinY() + 0.97875f * frame.Height), new CGPoint(frame.GetMinX() + 0.99336f * frame.Width, frame.GetMinY() + 0.99533f * frame.Height)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.01299f * frame.Width, frame.GetMinY() + 0.99533f * frame.Height)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 0.00145f * frame.Width, frame.GetMinY() + 0.95830f * frame.Height), new CGPoint(frame.GetMinX() + 0.00662f * frame.Width, frame.GetMinY() + 0.99533f * frame.Height), new CGPoint(frame.GetMinX() + 0.00145f * frame.Width, frame.GetMinY() + 0.97875f * frame.Height)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 0.00145f * frame.Width, frame.GetMinY() + 0.04170f * frame.Height)); bezierPath.ClosePath(); bezierPath.LineJoinStyle = CGLineJoin.Round; bezierPath.UsesEvenOddFillRule = true; fillColor.SetFill(); bezierPath.Fill(); fillColor3.SetStroke(); bezierPath.LineWidth = 0.5f; bezierPath.Stroke(); //// lblName Drawing CGRect lblNameRect = new CGRect(frame.GetMinX() + 13.25f, frame.GetMinY() + 9.45f, frame.Width - 23.25f, NMath.Floor((frame.Height - 9.45f) * 0.31777f + 9.39f) - 8.89f); textForeground.SetFill(); var lblNameStyle = new NSMutableParagraphStyle(); lblNameStyle.Alignment = UITextAlignment.Left; var lblNameFontAttributes = new UIStringAttributes() { Font = UIFont.FromName("Avenir-Heavy", 18.0f), ForegroundColor = textForeground, ParagraphStyle = lblNameStyle }; var lblNameTextHeight = new NSString(name).GetBoundingRect(new CGSize(lblNameRect.Width, nfloat.MaxValue), NSStringDrawingOptions.UsesLineFragmentOrigin, lblNameFontAttributes, null).Height; context.SaveState(); context.ClipToRect(lblNameRect); new NSString(name).DrawString(new CGRect(lblNameRect.GetMinX(), lblNameRect.GetMinY() + (lblNameRect.Height - lblNameTextHeight) / 2.0f, lblNameRect.Width, lblNameTextHeight), UIFont.FromName("Avenir-Heavy", 18.0f), UILineBreakMode.WordWrap, UITextAlignment.Left); context.RestoreState(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new CGPoint(frame.GetMinX() + 18.25f, frame.GetMinY() + 39.0f)); bezier2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 15.0f, frame.GetMinY() + 42.08f), new CGPoint(frame.GetMinX() + 16.46f, frame.GetMinY() + 39.0f), new CGPoint(frame.GetMinX() + 15.0f, frame.GetMinY() + 40.38f)); bezier2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 18.26f, frame.GetMinY() + 46.96f), new CGPoint(frame.GetMinX() + 15.0f, frame.GetMinY() + 44.42f), new CGPoint(frame.GetMinX() + 17.63f, frame.GetMinY() + 46.96f)); bezier2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 21.5f, frame.GetMinY() + 42.08f), new CGPoint(frame.GetMinX() + 18.89f, frame.GetMinY() + 46.96f), new CGPoint(frame.GetMinX() + 21.5f, frame.GetMinY() + 44.42f)); bezier2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 18.25f, frame.GetMinY() + 39.0f), new CGPoint(frame.GetMinX() + 21.5f, frame.GetMinY() + 40.38f), new CGPoint(frame.GetMinX() + 20.05f, frame.GetMinY() + 39.0f)); bezier2Path.ClosePath(); bezier2Path.MoveTo(new CGPoint(frame.GetMinX() + 18.25f, frame.GetMinY() + 43.98f)); bezier2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 20.0f, frame.GetMinY() + 42.23f), new CGPoint(frame.GetMinX() + 19.22f, frame.GetMinY() + 43.98f), new CGPoint(frame.GetMinX() + 20.0f, frame.GetMinY() + 43.2f)); bezier2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 18.25f, frame.GetMinY() + 40.49f), new CGPoint(frame.GetMinX() + 20.0f, frame.GetMinY() + 41.27f), new CGPoint(frame.GetMinX() + 19.22f, frame.GetMinY() + 40.49f)); bezier2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 16.5f, frame.GetMinY() + 42.23f), new CGPoint(frame.GetMinX() + 17.28f, frame.GetMinY() + 40.49f), new CGPoint(frame.GetMinX() + 16.5f, frame.GetMinY() + 41.27f)); bezier2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 18.25f, frame.GetMinY() + 43.98f), new CGPoint(frame.GetMinX() + 16.5f, frame.GetMinY() + 43.2f), new CGPoint(frame.GetMinX() + 17.28f, frame.GetMinY() + 43.98f)); bezier2Path.ClosePath(); bezier2Path.UsesEvenOddFillRule = true; fillColor2.SetFill(); bezier2Path.Fill(); //// lblCountry Drawing CGRect lblCountryRect = new CGRect(frame.GetMinX() + 24.0f, frame.GetMinY() + 31.0f, frame.Width - 34.0f, NMath.Floor((frame.Height - 31.0f) * 0.30263f + 0.5f)); textForeground2.SetFill(); var lblCountryStyle = new NSMutableParagraphStyle(); lblCountryStyle.Alignment = UITextAlignment.Left; var lblCountryFontAttributes = new UIStringAttributes() { Font = UIFont.FromName("Avenir-Medium", 13.0f), ForegroundColor = textForeground2, ParagraphStyle = lblCountryStyle }; var lblCountryTextHeight = new NSString(country).GetBoundingRect(new CGSize(lblCountryRect.Width, nfloat.MaxValue), NSStringDrawingOptions.UsesLineFragmentOrigin, lblCountryFontAttributes, null).Height; context.SaveState(); context.ClipToRect(lblCountryRect); new NSString(country).DrawString(new CGRect(lblCountryRect.GetMinX(), lblCountryRect.GetMinY() + (lblCountryRect.Height - lblCountryTextHeight) / 2.0f, lblCountryRect.Width, lblCountryTextHeight), UIFont.FromName("Avenir-Medium", 13.0f), UILineBreakMode.WordWrap, UITextAlignment.Left); context.RestoreState(); //// Rectangle 3 Drawing var rectangle3Path = UIBezierPath.FromRect(new CGRect(frame.GetMinX(), frame.GetMinY() + NMath.Floor((frame.Height - 40.0f) * 0.98507f + 0.5f), frame.Width, frame.Height - 40.0f - NMath.Floor((frame.Height - 40.0f) * 0.98507f + 0.5f))); fillColor3.SetFill(); rectangle3Path.Fill(); //// Rectangle 4 Drawing var rectangle4Path = UIBezierPath.FromRect(new CGRect(frame.GetMinX() + 114.3f, frame.GetMinY() + NMath.Floor((frame.Height) * 0.62804f + 0.5f), NMath.Floor((frame.Width - 114.3f) * 0.00433f + 0.5f), frame.Height - NMath.Floor((frame.Height) * 0.62804f + 0.5f))); fillColor3.SetFill(); rectangle4Path.Fill(); //// Rectangle 5 Drawing var rectangle5Path = UIBezierPath.FromRect(new CGRect(frame.GetMinX() + NMath.Floor((frame.Width - 114.25f) * 0.99567f - 0.25f) + 0.75f, frame.GetMinY() + NMath.Floor((frame.Height) * 0.62804f + 0.5f), frame.Width - 115.0f - NMath.Floor((frame.Width - 114.25f) * 0.99567f - 0.25f), frame.Height - NMath.Floor((frame.Height) * 0.62804f + 0.5f))); fillColor3.SetFill(); rectangle5Path.Fill(); //// lblAbv Drawing CGRect lblAbvRect = new CGRect(frame.GetMinX() + NMath.Floor(frame.Width * -0.00000f - 0.5f) + 1.0f, frame.GetMinY() + NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f) + 0.81f, NMath.Floor(frame.Width * 0.16812f - 0.5f) - NMath.Floor(frame.Width * -0.00000f - 0.5f), frame.Height - 12.63f - NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f)); textForeground2.SetFill(); var lblAbvStyle = new NSMutableParagraphStyle(); lblAbvStyle.Alignment = UITextAlignment.Right; var lblAbvFontAttributes = new UIStringAttributes() { Font = UIFont.FromName("Avenir-Heavy", 12.0f), ForegroundColor = textForeground2, ParagraphStyle = lblAbvStyle }; var lblAbvTextHeight = new NSString(abv).GetBoundingRect(new CGSize(lblAbvRect.Width, nfloat.MaxValue), NSStringDrawingOptions.UsesLineFragmentOrigin, lblAbvFontAttributes, null).Height; context.SaveState(); context.ClipToRect(lblAbvRect); new NSString(abv).DrawString(new CGRect(lblAbvRect.GetMinX(), lblAbvRect.GetMinY() + (lblAbvRect.Height - lblAbvTextHeight) / 2.0f, lblAbvRect.Width, lblAbvTextHeight), UIFont.FromName("Avenir-Heavy", 12.0f), UILineBreakMode.WordWrap, UITextAlignment.Right); context.RestoreState(); //// Label 4 Drawing CGRect label4Rect = new CGRect(frame.GetMinX() + NMath.Floor((frame.Width - 231.0f) * 0.52961f + 0.12f) + 0.38f, frame.GetMinY() + NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f) + 0.81f, frame.Width - 231.38f - NMath.Floor((frame.Width - 231.0f) * 0.52961f + 0.12f), frame.Height - 12.63f - NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f)); { var textContent = "ABV"; textForeground.SetFill(); var label4Style = new NSMutableParagraphStyle(); label4Style.Alignment = UITextAlignment.Left; var label4FontAttributes = new UIStringAttributes() { Font = UIFont.FromName("Avenir-Heavy", 12.0f), ForegroundColor = textForeground, ParagraphStyle = label4Style }; var label4TextHeight = new NSString(textContent).GetBoundingRect(new CGSize(label4Rect.Width, nfloat.MaxValue), NSStringDrawingOptions.UsesLineFragmentOrigin, label4FontAttributes, null).Height; context.SaveState(); context.ClipToRect(label4Rect); new NSString(textContent).DrawString(new CGRect(label4Rect.GetMinX(), label4Rect.GetMinY() + (label4Rect.Height - label4TextHeight) / 2.0f, label4Rect.Width, label4TextHeight), UIFont.FromName("Avenir-Heavy", 12.0f), UILineBreakMode.WordWrap, UITextAlignment.Left); context.RestoreState(); } //// lblIbu Drawing CGRect lblIbuRect = new CGRect(frame.GetMinX() + NMath.Floor(frame.Width * 0.33623f + 0.5f), frame.GetMinY() + NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f) + 0.81f, NMath.Floor(frame.Width * 0.49855f + 0.5f) - NMath.Floor(frame.Width * 0.33623f + 0.5f), frame.Height - 12.63f - NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f)); textForeground2.SetFill(); var lblIbuStyle = new NSMutableParagraphStyle(); lblIbuStyle.Alignment = UITextAlignment.Right; var lblIbuFontAttributes = new UIStringAttributes() { Font = UIFont.FromName("Avenir-Heavy", 12.0f), ForegroundColor = textForeground2, ParagraphStyle = lblIbuStyle }; var lblIbuTextHeight = new NSString(ibu).GetBoundingRect(new CGSize(lblIbuRect.Width, nfloat.MaxValue), NSStringDrawingOptions.UsesLineFragmentOrigin, lblIbuFontAttributes, null).Height; context.SaveState(); context.ClipToRect(lblIbuRect); new NSString(ibu).DrawString(new CGRect(lblIbuRect.GetMinX(), lblIbuRect.GetMinY() + (lblIbuRect.Height - lblIbuTextHeight) / 2.0f, lblIbuRect.Width, lblIbuTextHeight), UIFont.FromName("Avenir-Heavy", 12.0f), UILineBreakMode.WordWrap, UITextAlignment.Right); context.RestoreState(); //// Label 6 Drawing CGRect label6Rect = new CGRect(frame.GetMinX() + NMath.Floor(frame.Width * 0.50435f + 0.5f), frame.GetMinY() + NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f) + 0.81f, NMath.Floor(frame.Width * 0.66667f + 0.5f) - NMath.Floor(frame.Width * 0.50435f + 0.5f), frame.Height - 12.63f - NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f)); { var textContent = "IBU"; textForeground.SetFill(); var label6Style = new NSMutableParagraphStyle(); label6Style.Alignment = UITextAlignment.Left; var label6FontAttributes = new UIStringAttributes() { Font = UIFont.FromName("Avenir-Heavy", 12.0f), ForegroundColor = textForeground, ParagraphStyle = label6Style }; var label6TextHeight = new NSString(textContent).GetBoundingRect(new CGSize(label6Rect.Width, nfloat.MaxValue), NSStringDrawingOptions.UsesLineFragmentOrigin, label6FontAttributes, null).Height; context.SaveState(); context.ClipToRect(label6Rect); new NSString(textContent).DrawString(new CGRect(label6Rect.GetMinX(), label6Rect.GetMinY() + (label6Rect.Height - label6TextHeight) / 2.0f, label6Rect.Width, label6TextHeight), UIFont.FromName("Avenir-Heavy", 12.0f), UILineBreakMode.WordWrap, UITextAlignment.Left); context.RestoreState(); } //// lblSrm Drawing CGRect lblSrmRect = new CGRect(frame.GetMinX() + NMath.Floor(frame.Width * 0.66957f + 0.5f), frame.GetMinY() + NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f) + 0.81f, NMath.Floor(frame.Width * 0.83478f + 0.5f) - NMath.Floor(frame.Width * 0.66957f + 0.5f), frame.Height - 12.63f - NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f)); textForeground2.SetFill(); var lblSrmStyle = new NSMutableParagraphStyle(); lblSrmStyle.Alignment = UITextAlignment.Right; var lblSrmFontAttributes = new UIStringAttributes() { Font = UIFont.FromName("Avenir-Heavy", 12.0f), ForegroundColor = textForeground2, ParagraphStyle = lblSrmStyle }; var lblSrmTextHeight = new NSString(srm).GetBoundingRect(new CGSize(lblSrmRect.Width, nfloat.MaxValue), NSStringDrawingOptions.UsesLineFragmentOrigin, lblSrmFontAttributes, null).Height; context.SaveState(); context.ClipToRect(lblSrmRect); new NSString(srm).DrawString(new CGRect(lblSrmRect.GetMinX(), lblSrmRect.GetMinY() + (lblSrmRect.Height - lblSrmTextHeight) / 2.0f, lblSrmRect.Width, lblSrmTextHeight), UIFont.FromName("Avenir-Heavy", 12.0f), UILineBreakMode.WordWrap, UITextAlignment.Right); context.RestoreState(); //// Label 8 Drawing CGRect label8Rect = new CGRect(frame.GetMinX() + NMath.Floor(frame.Width * 0.83460f - 0.44f) + 0.94f, frame.GetMinY() + NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f) + 0.81f, NMath.Floor(frame.Width * 1.00000f - 0.5f) - NMath.Floor(frame.Width * 0.83460f - 0.44f) + 0.06f, frame.Height - 12.63f - NMath.Floor((frame.Height - 11.81f) * 0.78989f - 0.31f)); { var textContent = "SRM"; textForeground.SetFill(); var label8Style = new NSMutableParagraphStyle(); label8Style.Alignment = UITextAlignment.Left; var label8FontAttributes = new UIStringAttributes() { Font = UIFont.FromName("Avenir-Heavy", 12.0f), ForegroundColor = textForeground, ParagraphStyle = label8Style }; var label8TextHeight = new NSString(textContent).GetBoundingRect(new CGSize(label8Rect.Width, nfloat.MaxValue), NSStringDrawingOptions.UsesLineFragmentOrigin, label8FontAttributes, null).Height; context.SaveState(); context.ClipToRect(label8Rect); new NSString(textContent).DrawString(new CGRect(label8Rect.GetMinX(), label8Rect.GetMinY() + (label8Rect.Height - label8TextHeight) / 2.0f, label8Rect.Width, label8TextHeight), UIFont.FromName("Avenir-Heavy", 12.0f), UILineBreakMode.WordWrap, UITextAlignment.Left); context.RestoreState(); } }
public override void Draw (CGRect rect) { UIView head = ((WalkingDead)Superview).head; var path = new UIBezierPath { LineCapStyle = CGLineCap.Round }; CGRect headFrame = head.Frame; if (!MovingRight) { rect.X -= 20; path.MoveTo (new CGPoint (rect.GetMidX () + 20, headFrame.GetMaxY () + 10)); path.AddLineTo (new CGPoint (rect.GetMidX () + 20 + rect.Size.Width / 6, headFrame.GetMaxY () + 10)); path.AddLineTo (new CGPoint (rect.GetMidX () + 20 + rect.Size.Width / 6 + 10, headFrame.GetMaxY () + 10 + 20)); } else { path.MoveTo (new CGPoint (rect.GetMidX () - 20, headFrame.GetMaxY () + 10)); path.AddLineTo (new CGPoint (rect.GetMidX () - 20 - rect.Size.Width / 6, headFrame.GetMaxY () + 10)); path.AddLineTo (new CGPoint (rect.GetMidX () - 20 - rect.Size.Width / 6 - 10, headFrame.GetMaxY () + 10 + 20)); } UIColor.Black.SetStroke (); path.LineWidth = 12; path.Stroke (); UIColor.White.SetStroke (); path.LineWidth = 8; path.Stroke (); }
public override void Draw (CGRect rect) { base.Draw (rect); var posX = (rect.Width - radius) / 2; var posY = (rect.Height - radius) / 2; using (var context = UIGraphics.GetCurrentContext ()) { UIBezierPath ovalPath; UIBezierPath bezierPath; if (isActive) { if (isRunning) { // Oval Drawing ovalPath = UIBezierPath.FromOval (new CGRect (posX, posY, radius, radius)); redColor.SetFill(); ovalPath.Fill(); // Rectangle Drawing var rectanglePath = UIBezierPath.FromRect (new CGRect (posX + 12.0f, posY + 12.0f, 8.0f, 8.0f)); UIColor.White.SetFill(); rectanglePath.Fill(); } else { // Oval Drawing ovalPath = UIBezierPath.FromOval (new CGRect (posX, posY, radius, radius)); greenColor.SetFill (); ovalPath.Fill (); // Bezier Drawing bezierPath = new UIBezierPath (); bezierPath.MoveTo (new CGPoint (posX + 13.0f, posY + 8.0f)); bezierPath.AddLineTo (new CGPoint (posX + 20.0f, posY + 16.47f)); bezierPath.AddLineTo (new CGPoint (posX + 13.0f, posY + 24.0f)); UIColor.White.SetStroke (); bezierPath.LineWidth = 1.0f; bezierPath.Stroke (); } } else { // Oval Drawing UIColor.White.SetStroke (); ovalPath = UIBezierPath.FromOval (new CGRect (posX, posY, radius, radius)); ovalPath.LineWidth = 1.0f; ovalPath.Stroke (); context.AddPath (ovalPath.CGPath); // Bezier Drawing bezierPath = new UIBezierPath (); bezierPath.MoveTo (new CGPoint (posX + 13.0f, posY + 8.0f)); bezierPath.AddLineTo (new CGPoint (posX + 20.0f, posY + 16.47f)); bezierPath.AddLineTo (new CGPoint (posX + 13.0f, posY + 24.0f)); bezierPath.LineWidth = 1.0f; bezierPath.Stroke (); context.AddPath (bezierPath.CGPath); } } }
public override void Draw (CGRect rect) { base.Draw (rect); using (var context = UIGraphics.GetCurrentContext ()) { UIBezierPath mainAxis = UIBezierPath.FromRoundedRect ( new CGRect (xAxisMargin, 0.0f, 2.0f, rect.Height), 2.0f); UIColor.FromRGB ( 203, 203, 203).SetFill(); mainAxis.Fill(); nfloat sepInterval = (nfloat)Math.Floor ((rect.Width - xAxisMargin - xTextMargin)/ 5); for (int i = 1; i < 6; i++) { var separatorAxis = new UIBezierPath(); separatorAxis.MoveTo (new CGPoint (xAxisMargin + sepInterval * i, 0)); separatorAxis.AddLineTo (new CGPoint ( xAxisMargin + sepInterval * i, rect.Height - yAxisMargin)); UIColor.FromRGB ( 203, 203, 203).SetStroke(); separatorAxis.LineWidth = 1.0f; separatorAxis.SetLineDash ( new nfloat[] {1.0f,1.0f}, 1); separatorAxis.Stroke (); var textLayer = new CATextLayer (); textLayer.ContentsScale = UIScreen.MainScreen.Scale; CGFont font = CGFont.CreateWithFontName (LabelFont.Name); if (font != null) { textLayer.SetFont (font); font.Dispose (); } textLayer.FontSize = LabelFont.PointSize; textLayer.AnchorPoint = new CGPoint ( 0.5f, 0.0f); textLayer.AlignmentMode = CATextLayer.AlignmentCenter; textLayer.BackgroundColor = UIColor.Clear.CGColor; textLayer.ForegroundColor = LabelColor.CGColor; CGSize size = ((NSString)"0000 h").StringSize (LabelFont); textLayer.String = "00 h"; textLayer.Bounds = new CGRect (0, 0, size.Width, size.Height); textLayer.Position = new CGPoint ( xAxisMargin + sepInterval * i, rect.Height - yAxisMargin + 5.0f); Layer.AddSublayer (textLayer); xAxisText [i - 1] = textLayer; } } }
public override void Draw(CGRect frame) { // General Declarations var context = UIGraphics.GetCurrentContext(); // Color Declarations var minimumTrackColor = UIColor.FromRGBA(0.502f, 0.812f, 0.769f, 1.000f); var maximumTrackColor = UIColor.FromRGBA(0.314f, 0.314f, 0.314f, 1.000f); var color = UIColor.FromRGBA(0.376f, 0.490f, 0.722f, 1.000f); // Variable Declarations var expression2 = percentage*2.0f; var expression = new CGPoint(25.0f + expression2, 61.0f); var expression3 = 200.0f - percentage*2.0f; // Minimum Track Drawing var minimumTrackPath = UIBezierPath.FromRoundedRect( new CGRect(frame.GetMinX(), frame.GetMinY() + 24.0f, frame.Width, frame.Height - 29.0f), 2.0f); minimumTrackColor.SetFill(); minimumTrackPath.Fill(); // Maximum Track Drawing context.SaveState(); context.TranslateCTM(frame.GetMinX() + 1.00000f*frame.Width, frame.GetMinY() + 0.85714f*frame.Height); context.RotateCTM(-180.0f*NMath.PI/180.0f); var maximumTrackPath = UIBezierPath.FromRoundedRect(new CGRect(0.0f, 0.0f, expression3, 6.0f), UIRectCorner.TopLeft | UIRectCorner.BottomLeft, new CGSize(2.0f, 2.0f)); maximumTrackPath.ClosePath(); maximumTrackColor.SetFill(); maximumTrackPath.Fill(); context.RestoreState(); // Bezier Drawing context.SaveState(); context.TranslateCTM(expression.X, expression.Y); UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(0.0f, 2.01f)); bezierPath.AddCurveToPoint(new CGPoint(2.6f, 0.0f), new CGPoint(0.0f, 0.9f), new CGPoint(1.17f, 0.0f)); bezierPath.AddLineTo(new CGPoint(10.4f, 0.0f)); bezierPath.AddCurveToPoint(new CGPoint(13.0f, 2.01f), new CGPoint(11.84f, 0.0f), new CGPoint(13.0f, 0.9f)); bezierPath.AddLineTo(new CGPoint(13.0f, 13.04f)); bezierPath.AddCurveToPoint(new CGPoint(11.29f, 16.56f), new CGPoint(13.0f, 14.15f), new CGPoint(12.23f, 15.73f)); bezierPath.AddLineTo(new CGPoint(6.5f, 20.81f)); bezierPath.AddLineTo(new CGPoint(6.5f, 23.65f)); bezierPath.AddLineTo(new CGPoint(6.5f, 20.81f)); bezierPath.AddLineTo(new CGPoint(1.71f, 16.56f)); bezierPath.AddCurveToPoint(new CGPoint(0.0f, 13.04f), new CGPoint(0.76f, 15.73f), new CGPoint(0.0f, 14.15f)); bezierPath.AddLineTo(new CGPoint(0.0f, 2.01f)); bezierPath.ClosePath(); bezierPath.UsesEvenOddFillRule = true; color.SetFill(); bezierPath.Fill(); UIColor.White.SetStroke(); bezierPath.LineWidth = 1.5f; bezierPath.Stroke(); context.RestoreState(); }
void DrawCanvas(CGRect frame2) { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations var fillColor = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); var strokeColor = UIColor.FromRGBA(0.807f, 0.807f, 0.807f, 1.000f); var strokeColor2 = UIColor.FromRGBA(0.851f, 0.851f, 0.851f, 1.000f); //// Frames CGRect frame = new CGRect(1.0f, 0.0f, 771.0f, 356.0f); //// Subframes CGRect group3 = new CGRect(frame.GetMinX(), frame.GetMinY(), frame.Width, frame.Height); CGRect group5 = new CGRect(frame.GetMinX() + 3.0f, frame.GetMinY() + 3.0f, frame.Width - 7.0f, frame.Height - 7.0f); //// Group 2 { //// Group 3 { context.SaveState(); context.BeginTransparencyLayer(); //// Clip Clip 2 UIBezierPath clip2Path = new UIBezierPath(); clip2Path.MoveTo(new CGPoint(group3.GetMinX() + 0.00130f * group3.Width, group3.GetMinY() + 0.00000f * group3.Height)); clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 1.00130f * group3.Width, group3.GetMinY() + 0.00000f * group3.Height)); clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 1.00130f * group3.Width, group3.GetMinY() + 1.00000f * group3.Height)); clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 0.00130f * group3.Width, group3.GetMinY() + 1.00000f * group3.Height)); clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 0.00130f * group3.Width, group3.GetMinY() + 0.00000f * group3.Height)); clip2Path.ClosePath(); clip2Path.MoveTo(new CGPoint(group3.GetMinX() + 0.02853f * group3.Width, group3.GetMinY() + 0.06901f * group3.Height)); clip2Path.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.03307f * group3.Width, group3.GetMinY() + 0.05915f * group3.Height), new CGPoint(group3.GetMinX() + 0.02853f * group3.Width, group3.GetMinY() + 0.06356f * group3.Height), new CGPoint(group3.GetMinX() + 0.03056f * group3.Width, group3.GetMinY() + 0.05915f * group3.Height)); clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 0.96953f * group3.Width, group3.GetMinY() + 0.05915f * group3.Height)); clip2Path.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.97406f * group3.Width, group3.GetMinY() + 0.06901f * group3.Height), new CGPoint(group3.GetMinX() + 0.97203f * group3.Width, group3.GetMinY() + 0.05915f * group3.Height), new CGPoint(group3.GetMinX() + 0.97406f * group3.Width, group3.GetMinY() + 0.06356f * group3.Height)); clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 0.97406f * group3.Width, group3.GetMinY() + 0.93099f * group3.Height)); clip2Path.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.96953f * group3.Width, group3.GetMinY() + 0.94085f * group3.Height), new CGPoint(group3.GetMinX() + 0.97406f * group3.Width, group3.GetMinY() + 0.93644f * group3.Height), new CGPoint(group3.GetMinX() + 0.97204f * group3.Width, group3.GetMinY() + 0.94085f * group3.Height)); clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 0.03307f * group3.Width, group3.GetMinY() + 0.94085f * group3.Height)); clip2Path.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.02853f * group3.Width, group3.GetMinY() + 0.93099f * group3.Height), new CGPoint(group3.GetMinX() + 0.03056f * group3.Width, group3.GetMinY() + 0.94085f * group3.Height), new CGPoint(group3.GetMinX() + 0.02853f * group3.Width, group3.GetMinY() + 0.93644f * group3.Height)); clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 0.02853f * group3.Width, group3.GetMinY() + 0.06901f * group3.Height)); clip2Path.ClosePath(); clip2Path.MoveTo(new CGPoint(group3.GetMinX() + 0.02724f * group3.Width, group3.GetMinY() + 0.06901f * group3.Height)); clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 0.02724f * group3.Width, group3.GetMinY() + 0.93099f * group3.Height)); clip2Path.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.03307f * group3.Width, group3.GetMinY() + 0.94366f * group3.Height), new CGPoint(group3.GetMinX() + 0.02724f * group3.Width, group3.GetMinY() + 0.93800f * group3.Height), new CGPoint(group3.GetMinX() + 0.02984f * group3.Width, group3.GetMinY() + 0.94366f * group3.Height)); clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 0.96953f * group3.Width, group3.GetMinY() + 0.94366f * group3.Height)); clip2Path.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.97536f * group3.Width, group3.GetMinY() + 0.93099f * group3.Height), new CGPoint(group3.GetMinX() + 0.97275f * group3.Width, group3.GetMinY() + 0.94366f * group3.Height), new CGPoint(group3.GetMinX() + 0.97536f * group3.Width, group3.GetMinY() + 0.93799f * group3.Height)); clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 0.97536f * group3.Width, group3.GetMinY() + 0.06901f * group3.Height)); clip2Path.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.96953f * group3.Width, group3.GetMinY() + 0.05634f * group3.Height), new CGPoint(group3.GetMinX() + 0.97536f * group3.Width, group3.GetMinY() + 0.06200f * group3.Height), new CGPoint(group3.GetMinX() + 0.97275f * group3.Width, group3.GetMinY() + 0.05634f * group3.Height)); clip2Path.AddLineTo(new CGPoint(group3.GetMinX() + 0.03307f * group3.Width, group3.GetMinY() + 0.05634f * group3.Height)); clip2Path.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.02724f * group3.Width, group3.GetMinY() + 0.06901f * group3.Height), new CGPoint(group3.GetMinX() + 0.02984f * group3.Width, group3.GetMinY() + 0.05634f * group3.Height), new CGPoint(group3.GetMinX() + 0.02724f * group3.Width, group3.GetMinY() + 0.06201f * group3.Height)); clip2Path.ClosePath(); clip2Path.UsesEvenOddFillRule = true; clip2Path.AddClip(); //// Group 4 { context.SaveState(); context.BeginTransparencyLayer(); //// Clip Clip UIBezierPath clipPath = new UIBezierPath(); clipPath.MoveTo(new CGPoint(group3.GetMinX() + 0.00065f * group3.Width, group3.GetMinY() + 0.00425f * group3.Height)); clipPath.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.00583f * group3.Width, group3.GetMinY() + -0.00702f * group3.Height), new CGPoint(group3.GetMinX() + 0.00065f * group3.Width, group3.GetMinY() + -0.00198f * group3.Height), new CGPoint(group3.GetMinX() + 0.00296f * group3.Width, group3.GetMinY() + -0.00702f * group3.Height)); clipPath.AddLineTo(new CGPoint(group3.GetMinX() + 0.94229f * group3.Width, group3.GetMinY() + -0.00702f * group3.Height)); clipPath.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.94747f * group3.Width, group3.GetMinY() + 0.00425f * group3.Height), new CGPoint(group3.GetMinX() + 0.94515f * group3.Width, group3.GetMinY() + -0.00702f * group3.Height), new CGPoint(group3.GetMinX() + 0.94747f * group3.Width, group3.GetMinY() + -0.00199f * group3.Height)); clipPath.AddLineTo(new CGPoint(group3.GetMinX() + 0.94747f * group3.Width, group3.GetMinY() + 0.86654f * group3.Height)); clipPath.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.94229f * group3.Width, group3.GetMinY() + 0.87781f * group3.Height), new CGPoint(group3.GetMinX() + 0.94747f * group3.Width, group3.GetMinY() + 0.87276f * group3.Height), new CGPoint(group3.GetMinX() + 0.94516f * group3.Width, group3.GetMinY() + 0.87781f * group3.Height)); clipPath.AddLineTo(new CGPoint(group3.GetMinX() + 0.00583f * group3.Width, group3.GetMinY() + 0.87781f * group3.Height)); clipPath.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.00065f * group3.Width, group3.GetMinY() + 0.86654f * group3.Height), new CGPoint(group3.GetMinX() + 0.00297f * group3.Width, group3.GetMinY() + 0.87781f * group3.Height), new CGPoint(group3.GetMinX() + 0.00065f * group3.Width, group3.GetMinY() + 0.87278f * group3.Height)); clipPath.AddLineTo(new CGPoint(group3.GetMinX() + 0.00065f * group3.Width, group3.GetMinY() + 0.00425f * group3.Height)); clipPath.ClosePath(); clipPath.UsesEvenOddFillRule = true; clipPath.AddClip(); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(group3.GetMinX() + 0.00065f * group3.Width, group3.GetMinY() + 0.00425f * group3.Height)); bezierPath.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.00583f * group3.Width, group3.GetMinY() + -0.00702f * group3.Height), new CGPoint(group3.GetMinX() + 0.00065f * group3.Width, group3.GetMinY() + -0.00198f * group3.Height), new CGPoint(group3.GetMinX() + 0.00296f * group3.Width, group3.GetMinY() + -0.00702f * group3.Height)); bezierPath.AddLineTo(new CGPoint(group3.GetMinX() + 0.94229f * group3.Width, group3.GetMinY() + -0.00702f * group3.Height)); bezierPath.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.94747f * group3.Width, group3.GetMinY() + 0.00425f * group3.Height), new CGPoint(group3.GetMinX() + 0.94515f * group3.Width, group3.GetMinY() + -0.00702f * group3.Height), new CGPoint(group3.GetMinX() + 0.94747f * group3.Width, group3.GetMinY() + -0.00199f * group3.Height)); bezierPath.AddLineTo(new CGPoint(group3.GetMinX() + 0.94747f * group3.Width, group3.GetMinY() + 0.86654f * group3.Height)); bezierPath.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.94229f * group3.Width, group3.GetMinY() + 0.87781f * group3.Height), new CGPoint(group3.GetMinX() + 0.94747f * group3.Width, group3.GetMinY() + 0.87276f * group3.Height), new CGPoint(group3.GetMinX() + 0.94516f * group3.Width, group3.GetMinY() + 0.87781f * group3.Height)); bezierPath.AddLineTo(new CGPoint(group3.GetMinX() + 0.00583f * group3.Width, group3.GetMinY() + 0.87781f * group3.Height)); bezierPath.AddCurveToPoint(new CGPoint(group3.GetMinX() + 0.00065f * group3.Width, group3.GetMinY() + 0.86654f * group3.Height), new CGPoint(group3.GetMinX() + 0.00297f * group3.Width, group3.GetMinY() + 0.87781f * group3.Height), new CGPoint(group3.GetMinX() + 0.00065f * group3.Width, group3.GetMinY() + 0.87278f * group3.Height)); bezierPath.AddLineTo(new CGPoint(group3.GetMinX() + 0.00065f * group3.Width, group3.GetMinY() + 0.00425f * group3.Height)); bezierPath.ClosePath(); fillColor.SetFill(); bezierPath.Fill(); context.EndTransparencyLayer(); context.RestoreState(); } context.EndTransparencyLayer(); context.RestoreState(); } //// Group 5 { context.SaveState(); context.BeginTransparencyLayer(); //// Clip Clip 3 UIBezierPath clip3Path = new UIBezierPath(); clip3Path.MoveTo(new CGPoint(group5.GetMinX() + 0.00131f * group5.Width, group5.GetMinY() + 0.01273f * group5.Height)); clip3Path.AddCurveToPoint(new CGPoint(group5.GetMinX() + 0.00678f * group5.Width, group5.GetMinY() + 0.00000f * group5.Height), new CGPoint(group5.GetMinX() + 0.00131f * group5.Width, group5.GetMinY() + 0.00570f * group5.Height), new CGPoint(group5.GetMinX() + 0.00375f * group5.Width, group5.GetMinY() + 0.00000f * group5.Height)); clip3Path.AddLineTo(new CGPoint(group5.GetMinX() + 0.99584f * group5.Width, group5.GetMinY() + 0.00000f * group5.Height)); clip3Path.AddCurveToPoint(new CGPoint(group5.GetMinX() + 1.00131f * group5.Width, group5.GetMinY() + 0.01273f * group5.Height), new CGPoint(group5.GetMinX() + 0.99886f * group5.Width, group5.GetMinY() + 0.00000f * group5.Height), new CGPoint(group5.GetMinX() + 1.00131f * group5.Width, group5.GetMinY() + 0.00569f * group5.Height)); clip3Path.AddLineTo(new CGPoint(group5.GetMinX() + 1.00131f * group5.Width, group5.GetMinY() + 0.98727f * group5.Height)); clip3Path.AddCurveToPoint(new CGPoint(group5.GetMinX() + 0.99584f * group5.Width, group5.GetMinY() + 1.00000f * group5.Height), new CGPoint(group5.GetMinX() + 1.00131f * group5.Width, group5.GetMinY() + 0.99430f * group5.Height), new CGPoint(group5.GetMinX() + 0.99887f * group5.Width, group5.GetMinY() + 1.00000f * group5.Height)); clip3Path.AddLineTo(new CGPoint(group5.GetMinX() + 0.00678f * group5.Width, group5.GetMinY() + 1.00000f * group5.Height)); clip3Path.AddCurveToPoint(new CGPoint(group5.GetMinX() + 0.00131f * group5.Width, group5.GetMinY() + 0.98727f * group5.Height), new CGPoint(group5.GetMinX() + 0.00376f * group5.Width, group5.GetMinY() + 1.00000f * group5.Height), new CGPoint(group5.GetMinX() + 0.00131f * group5.Width, group5.GetMinY() + 0.99431f * group5.Height)); clip3Path.AddLineTo(new CGPoint(group5.GetMinX() + 0.00131f * group5.Width, group5.GetMinY() + 0.01273f * group5.Height)); clip3Path.ClosePath(); clip3Path.UsesEvenOddFillRule = true; clip3Path.AddClip(); //// Bezier 4 Drawing UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new CGPoint(group5.GetMinX() + 0.00131f * group5.Width, group5.GetMinY() + 0.01273f * group5.Height)); bezier4Path.AddCurveToPoint(new CGPoint(group5.GetMinX() + 0.00678f * group5.Width, group5.GetMinY() + 0.00000f * group5.Height), new CGPoint(group5.GetMinX() + 0.00131f * group5.Width, group5.GetMinY() + 0.00570f * group5.Height), new CGPoint(group5.GetMinX() + 0.00375f * group5.Width, group5.GetMinY() + 0.00000f * group5.Height)); bezier4Path.AddLineTo(new CGPoint(group5.GetMinX() + 0.99584f * group5.Width, group5.GetMinY() + 0.00000f * group5.Height)); bezier4Path.AddCurveToPoint(new CGPoint(group5.GetMinX() + 1.00131f * group5.Width, group5.GetMinY() + 0.01273f * group5.Height), new CGPoint(group5.GetMinX() + 0.99886f * group5.Width, group5.GetMinY() + 0.00000f * group5.Height), new CGPoint(group5.GetMinX() + 1.00131f * group5.Width, group5.GetMinY() + 0.00569f * group5.Height)); bezier4Path.AddLineTo(new CGPoint(group5.GetMinX() + 1.00131f * group5.Width, group5.GetMinY() + 0.98727f * group5.Height)); bezier4Path.AddCurveToPoint(new CGPoint(group5.GetMinX() + 0.99584f * group5.Width, group5.GetMinY() + 1.00000f * group5.Height), new CGPoint(group5.GetMinX() + 1.00131f * group5.Width, group5.GetMinY() + 0.99430f * group5.Height), new CGPoint(group5.GetMinX() + 0.99887f * group5.Width, group5.GetMinY() + 1.00000f * group5.Height)); bezier4Path.AddLineTo(new CGPoint(group5.GetMinX() + 0.00678f * group5.Width, group5.GetMinY() + 1.00000f * group5.Height)); bezier4Path.AddCurveToPoint(new CGPoint(group5.GetMinX() + 0.00131f * group5.Width, group5.GetMinY() + 0.98727f * group5.Height), new CGPoint(group5.GetMinX() + 0.00376f * group5.Width, group5.GetMinY() + 1.00000f * group5.Height), new CGPoint(group5.GetMinX() + 0.00131f * group5.Width, group5.GetMinY() + 0.99431f * group5.Height)); bezier4Path.AddLineTo(new CGPoint(group5.GetMinX() + 0.00131f * group5.Width, group5.GetMinY() + 0.01273f * group5.Height)); bezier4Path.ClosePath(); strokeColor2.SetStroke(); bezier4Path.LineWidth = 2.0f; bezier4Path.Stroke(); context.EndTransparencyLayer(); context.RestoreState(); } //// Bezier 6 Drawing UIBezierPath bezier6Path = new UIBezierPath(); bezier6Path.MoveTo(new CGPoint(frame.GetMinX() + 0.04789f * frame.Width, frame.GetMinY() + 0.43141f * frame.Height)); bezier6Path.AddLineTo(new CGPoint(frame.GetMinX() + 0.90281f * frame.Width, frame.GetMinY() + 0.43141f * frame.Height)); bezier6Path.LineCapStyle = CGLineCap.Square; strokeColor.SetStroke(); bezier6Path.LineWidth = 1.0f; bezier6Path.Stroke(); } }
public override void Draw(CGRect rect) { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations var fillColor = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); var strokeColor = UIColor.FromRGBA(0.807f, 0.807f, 0.807f, 1.000f); var strokeColor2 = UIColor.FromRGBA(0.851f, 0.851f, 0.851f, 1.000f); //// Frames CGRect frame = new CGRect(0.0f, 0.0f, 772.0f, 356.0f); //// Group 2 { //// Group 3 { context.SaveState(); context.BeginTransparencyLayer(); //// Clip Clip 2 UIBezierPath clip2Path = new UIBezierPath(); clip2Path.MoveTo(new CGPoint(frame.GetMinX() - 41.0f, frame.GetMinY() - 45.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 730.0f, frame.GetMinY() - 45.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 730.0f, frame.GetMinY() + 310.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 41.0f, frame.GetMinY() + 310.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 41.0f, frame.GetMinY() - 45.0f)); clip2Path.ClosePath(); clip2Path.MoveTo(new CGPoint(frame.GetMinX() - 20.0f, frame.GetMinY() - 20.5f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() - 24.0f), new CGPoint(frame.GetMinX() - 20.0f, frame.GetMinY() - 22.44f), new CGPoint(frame.GetMinX() - 18.44f, frame.GetMinY() - 24.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() - 24.0f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 709.0f, frame.GetMinY() - 20.5f), new CGPoint(frame.GetMinX() + 707.44f, frame.GetMinY() - 24.0f), new CGPoint(frame.GetMinX() + 709.0f, frame.GetMinY() - 22.44f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 709.0f, frame.GetMinY() + 285.5f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() + 289.0f), new CGPoint(frame.GetMinX() + 709.0f, frame.GetMinY() + 287.44f), new CGPoint(frame.GetMinX() + 707.44f, frame.GetMinY() + 289.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() + 289.0f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 20.0f, frame.GetMinY() + 285.5f), new CGPoint(frame.GetMinX() - 18.44f, frame.GetMinY() + 289.0f), new CGPoint(frame.GetMinX() - 20.0f, frame.GetMinY() + 287.44f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 20.0f, frame.GetMinY() - 20.5f)); clip2Path.ClosePath(); clip2Path.MoveTo(new CGPoint(frame.GetMinX() - 21.0f, frame.GetMinY() - 20.5f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 21.0f, frame.GetMinY() + 285.5f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() + 290.0f), new CGPoint(frame.GetMinX() - 21.0f, frame.GetMinY() + 287.99f), new CGPoint(frame.GetMinX() - 18.99f, frame.GetMinY() + 290.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() + 290.0f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 710.0f, frame.GetMinY() + 285.5f), new CGPoint(frame.GetMinX() + 707.99f, frame.GetMinY() + 290.0f), new CGPoint(frame.GetMinX() + 710.0f, frame.GetMinY() + 287.99f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 710.0f, frame.GetMinY() - 20.5f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() - 25.0f), new CGPoint(frame.GetMinX() + 710.0f, frame.GetMinY() - 22.99f), new CGPoint(frame.GetMinX() + 707.99f, frame.GetMinY() - 25.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() - 25.0f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 21.0f, frame.GetMinY() - 20.5f), new CGPoint(frame.GetMinX() - 18.99f, frame.GetMinY() - 25.0f), new CGPoint(frame.GetMinX() - 21.0f, frame.GetMinY() - 22.99f)); clip2Path.ClosePath(); clip2Path.UsesEvenOddFillRule = true; clip2Path.AddClip(); //// Group 4 { context.SaveState(); context.BeginTransparencyLayer(); //// Clip Clip UIBezierPath clipPath = new UIBezierPath(); clipPath.MoveTo(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 20.5f)); clipPath.AddCurveToPoint(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() - 24.5f), new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 22.71f), new CGPoint(frame.GetMinX() - 18.72f, frame.GetMinY() - 24.5f)); clipPath.AddLineTo(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() - 24.5f)); clipPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() - 20.5f), new CGPoint(frame.GetMinX() + 707.71f, frame.GetMinY() - 24.5f), new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() - 22.71f)); clipPath.AddLineTo(new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() + 285.5f)); clipPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() + 289.5f), new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() + 287.71f), new CGPoint(frame.GetMinX() + 707.72f, frame.GetMinY() + 289.5f)); clipPath.AddLineTo(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() + 289.5f)); clipPath.AddCurveToPoint(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() + 285.5f), new CGPoint(frame.GetMinX() - 18.71f, frame.GetMinY() + 289.5f), new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() + 287.71f)); clipPath.AddLineTo(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 20.5f)); clipPath.ClosePath(); clipPath.UsesEvenOddFillRule = true; clipPath.AddClip(); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 20.5f)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() - 24.5f), new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 22.71f), new CGPoint(frame.GetMinX() - 18.72f, frame.GetMinY() - 24.5f)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() - 24.5f)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() - 20.5f), new CGPoint(frame.GetMinX() + 707.71f, frame.GetMinY() - 24.5f), new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() - 22.71f)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() + 285.5f)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() + 289.5f), new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() + 287.71f), new CGPoint(frame.GetMinX() + 707.72f, frame.GetMinY() + 289.5f)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() + 289.5f)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() + 285.5f), new CGPoint(frame.GetMinX() - 18.71f, frame.GetMinY() + 289.5f), new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() + 287.71f)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 20.5f)); bezierPath.ClosePath(); fillColor.SetFill(); bezierPath.Fill(); context.EndTransparencyLayer(); context.RestoreState(); } context.EndTransparencyLayer(); context.RestoreState(); } //// Group 5 { context.SaveState(); context.BeginTransparencyLayer(); //// Clip Clip 3 UIBezierPath clip3Path = new UIBezierPath(); clip3Path.MoveTo(new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() - 11.14f)); clip3Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 9.35f, frame.GetMinY() - 15.5f), new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() - 13.55f), new CGPoint(frame.GetMinX() - 11.65f, frame.GetMinY() - 15.5f)); clip3Path.AddLineTo(new CGPoint(frame.GetMinX() + 740.35f, frame.GetMinY() - 15.5f)); clip3Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() - 11.14f), new CGPoint(frame.GetMinX() + 742.64f, frame.GetMinY() - 15.5f), new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() - 13.56f)); clip3Path.AddLineTo(new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() + 322.14f)); clip3Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 740.35f, frame.GetMinY() + 326.5f), new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() + 324.55f), new CGPoint(frame.GetMinX() + 742.65f, frame.GetMinY() + 326.5f)); clip3Path.AddLineTo(new CGPoint(frame.GetMinX() - 9.35f, frame.GetMinY() + 326.5f)); clip3Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() + 322.14f), new CGPoint(frame.GetMinX() - 11.64f, frame.GetMinY() + 326.5f), new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() + 324.56f)); clip3Path.AddLineTo(new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() - 11.14f)); clip3Path.ClosePath(); clip3Path.UsesEvenOddFillRule = true; clip3Path.AddClip(); //// Bezier 4 Drawing UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() - 11.14f)); bezier4Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 9.35f, frame.GetMinY() - 15.5f), new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() - 13.55f), new CGPoint(frame.GetMinX() - 11.65f, frame.GetMinY() - 15.5f)); bezier4Path.AddLineTo(new CGPoint(frame.GetMinX() + 740.35f, frame.GetMinY() - 15.5f)); bezier4Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() - 11.14f), new CGPoint(frame.GetMinX() + 742.64f, frame.GetMinY() - 15.5f), new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() - 13.56f)); bezier4Path.AddLineTo(new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() + 322.14f)); bezier4Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 740.35f, frame.GetMinY() + 326.5f), new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() + 324.55f), new CGPoint(frame.GetMinX() + 742.65f, frame.GetMinY() + 326.5f)); bezier4Path.AddLineTo(new CGPoint(frame.GetMinX() - 9.35f, frame.GetMinY() + 326.5f)); bezier4Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() + 322.14f), new CGPoint(frame.GetMinX() - 11.64f, frame.GetMinY() + 326.5f), new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() + 324.56f)); bezier4Path.AddLineTo(new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() - 11.14f)); bezier4Path.ClosePath(); strokeColor2.SetStroke(); bezier4Path.LineWidth = 2.0f; bezier4Path.Stroke(); context.EndTransparencyLayer(); context.RestoreState(); } //// Bezier 6 Drawing UIBezierPath bezier6Path = new UIBezierPath(); bezier6Path.MoveTo(new CGPoint(frame.GetMinX() + 36.0f, frame.GetMinY() + 155.6f)); bezier6Path.AddLineTo(new CGPoint(frame.GetMinX() + 696.0f, frame.GetMinY() + 155.6f)); bezier6Path.LineCapStyle = CGLineCap.Square; strokeColor.SetStroke(); bezier6Path.LineWidth = 1.0f; bezier6Path.Stroke(); } }
public override void Draw (CGRect rect) { base.Draw (rect); var drawPath = new UIBezierPath (); drawPath.LineCapStyle = CGLineCap.Round; foreach (var line in Lines) { drawPath.MoveTo (line.Start); drawPath.AddLineTo (line.End); } drawPath.LineWidth = LineWidth; Color.SetColor (); drawPath.Stroke (); }
public override void Draw(CGRect rect) { base.Draw (rect); using (CGContext g = UIGraphics.GetCurrentContext ()) { // draw grid UIBezierPath path = new UIBezierPath(); path.LineWidth = 1.0f; UIColor.Red.SetStroke (); for ( float y = GRID_GAP; y < rect.Height; y += GRID_GAP ) { path.MoveTo( new CGPoint( 0, y ) ); path.AddLineTo( new CGPoint( rect.Width, y ) ); path.Stroke(); } UIColor.Blue.SetStroke (); foreach(var aMPathList in mPathList) { aMPathList.Stroke (); } mPath.Stroke (); } }