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 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 static void DrawEmotionStatView(CGRect frame, float angerPercentage, float contemptPercentage, float disgustPercentage, float fearPercentage, float happinessPercentage, float neutralPercentage, float sadnessPercentage, float surprisePercentage, float height) { //// General Declarations var colorSpace = CGColorSpace.CreateDeviceRGB(); var context = UIGraphics.GetCurrentContext(); //// Color Declarations var anger1 = UIColor.FromRGBA(1.000f, 0.369f, 0.227f, 1.000f); var anger2 = UIColor.FromRGBA(1.000f, 0.165f, 0.408f, 1.000f); var neutral1 = UIColor.FromRGBA(0.859f, 0.867f, 0.871f, 1.000f); var neutral2 = UIColor.FromRGBA(0.537f, 0.549f, 0.565f, 1.000f); var happy1 = UIColor.FromRGBA(1.000f, 0.859f, 0.298f, 1.000f); var happy2 = UIColor.FromRGBA(1.000f, 0.804f, 0.008f, 1.000f); var surprise1 = UIColor.FromRGBA(0.102f, 0.839f, 0.992f, 1.000f); var surprise2 = UIColor.FromRGBA(0.114f, 0.384f, 0.941f, 1.000f); var sadness1 = UIColor.FromRGBA(0.290f, 0.290f, 0.290f, 1.000f); var sadness2 = UIColor.FromRGBA(0.169f, 0.169f, 0.169f, 1.000f); var disgust1 = UIColor.FromRGBA(0.529f, 0.988f, 0.439f, 1.000f); var disgust2 = UIColor.FromRGBA(0.043f, 0.827f, 0.094f, 1.000f); var fear1 = UIColor.FromRGBA(0.776f, 0.267f, 0.988f, 1.000f); var fear2 = UIColor.FromRGBA(0.345f, 0.337f, 0.839f, 1.000f); var contempt1 = UIColor.FromRGBA(1.000f, 0.584f, 0.000f, 1.000f); var contempt2 = UIColor.FromRGBA(0.721f, 0.421f, 0.000f, 1.000f); //// Gradient Declarations var angerGradientColors = new CGColor [] {anger1.CGColor, anger2.CGColor}; var angerGradientLocations = new nfloat [] {0.0f, 1.0f}; var angerGradient = new CGGradient(colorSpace, angerGradientColors, angerGradientLocations); var neutralGradientColors = new CGColor [] {neutral1.CGColor, neutral2.CGColor}; var neutralGradientLocations = new nfloat [] {0.0f, 1.0f}; var neutralGradient = new CGGradient(colorSpace, neutralGradientColors, neutralGradientLocations); var happyGradientColors = new CGColor [] {happy1.CGColor, happy2.CGColor}; var happyGradientLocations = new nfloat [] {0.0f, 1.0f}; var happyGradient = new CGGradient(colorSpace, happyGradientColors, happyGradientLocations); var surpriseGradientColors = new CGColor [] {surprise1.CGColor, surprise2.CGColor}; var surpriseGradientLocations = new nfloat [] {0.0f, 1.0f}; var surpriseGradient = new CGGradient(colorSpace, surpriseGradientColors, surpriseGradientLocations); var sadnessGradientColors = new CGColor [] {sadness1.CGColor, sadness2.CGColor}; var sadnessGradientLocations = new nfloat [] {0.0f, 1.0f}; var sadnessGradient = new CGGradient(colorSpace, sadnessGradientColors, sadnessGradientLocations); var disgustGradientColors = new CGColor [] {disgust1.CGColor, disgust2.CGColor}; var disgustGradientLocations = new nfloat [] {0.0f, 1.0f}; var disgustGradient = new CGGradient(colorSpace, disgustGradientColors, disgustGradientLocations); var fearGradientColors = new CGColor [] {fear1.CGColor, fear2.CGColor}; var fearGradientLocations = new nfloat [] {0.0f, 1.0f}; var fearGradient = new CGGradient(colorSpace, fearGradientColors, fearGradientLocations); var contemptGradientColors = new CGColor [] {contempt1.CGColor, contempt2.CGColor}; var contemptGradientLocations = new nfloat [] {0.0f, 1.0f}; var contemptGradient = new CGGradient(colorSpace, contemptGradientColors, contemptGradientLocations); //// Variable Declarations var angerY = height - height / 100.0f * angerPercentage - 25.0f + angerPercentage * 0.25f; var contemptY = height - height / 100.0f * contemptPercentage - 25.0f + contemptPercentage * 0.25f; var disgustY = height - height / 100.0f * disgustPercentage - 25.0f + disgustPercentage * 0.25f; var fearY = height - height / 100.0f * fearPercentage - 25.0f + fearPercentage * 0.25f; var happinessY = height - height / 100.0f * happinessPercentage - 25.0f + happinessPercentage * 0.25f; var neutralY = height - height / 100.0f * neutralPercentage - 25.0f + neutralPercentage * 0.25f; var sadnessY = height - height / 100.0f * sadnessPercentage - 25.0f + sadnessPercentage * 0.25f; var surpriseY = height - height / 100.0f * surprisePercentage - 25.0f + surprisePercentage * 0.25f; //// Bezier Drawing context.SaveState(); context.TranslateCTM(0.0f, angerY); UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(50.0f, 28.5f)); bezierPath.AddCurveToPoint(new CGPoint(49.97f, 30.0f), new CGPoint(50.0f, 29.0f), new CGPoint(49.99f, 29.5f)); bezierPath.AddCurveToPoint(new CGPoint(50.0f, 301.75f), new CGPoint(50.0f, 30.0f), new CGPoint(50.0f, 301.75f)); bezierPath.AddLineTo(new CGPoint(0.22f, 301.75f)); bezierPath.AddCurveToPoint(new CGPoint(0.22f, 32.29f), new CGPoint(0.22f, 301.75f), new CGPoint(0.22f, 58.53f)); bezierPath.AddCurveToPoint(new CGPoint(0.0f, 28.5f), new CGPoint(0.07f, 31.05f), new CGPoint(-0.0f, 29.78f)); bezierPath.AddCurveToPoint(new CGPoint(9.9f, 5.79f), new CGPoint(0.0f, 19.23f), new CGPoint(3.88f, 10.99f)); bezierPath.AddCurveToPoint(new CGPoint(25.0f, 0.0f), new CGPoint(14.09f, 2.16f), new CGPoint(19.33f, -0.0f)); bezierPath.AddCurveToPoint(new CGPoint(50.0f, 28.5f), new CGPoint(38.81f, 0.0f), new CGPoint(50.0f, 12.76f)); bezierPath.ClosePath(); context.SaveState(); bezierPath.AddClip(); CGRect bezierBounds = bezierPath.CGPath.PathBoundingBox; context.DrawLinearGradient(angerGradient, new CGPoint(bezierBounds.GetMidX(), bezierBounds.GetMinY()), new CGPoint(bezierBounds.GetMidX(), bezierBounds.GetMaxY()), 0); context.RestoreState(); context.RestoreState(); //// Bezier 2 Drawing context.SaveState(); context.TranslateCTM(51.0f, sadnessY); UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new CGPoint(50.0f, 28.5f)); bezier2Path.AddCurveToPoint(new CGPoint(49.97f, 30.0f), new CGPoint(50.0f, 29.0f), new CGPoint(49.99f, 29.5f)); bezier2Path.AddCurveToPoint(new CGPoint(50.0f, 301.75f), new CGPoint(50.0f, 30.0f), new CGPoint(50.0f, 301.75f)); bezier2Path.AddLineTo(new CGPoint(0.22f, 301.75f)); bezier2Path.AddCurveToPoint(new CGPoint(0.22f, 32.29f), new CGPoint(0.22f, 301.75f), new CGPoint(0.22f, 58.53f)); bezier2Path.AddCurveToPoint(new CGPoint(0.0f, 28.5f), new CGPoint(0.07f, 31.05f), new CGPoint(-0.0f, 29.78f)); bezier2Path.AddCurveToPoint(new CGPoint(9.9f, 5.79f), new CGPoint(0.0f, 19.23f), new CGPoint(3.88f, 10.99f)); bezier2Path.AddCurveToPoint(new CGPoint(25.0f, 0.0f), new CGPoint(14.09f, 2.16f), new CGPoint(19.33f, -0.0f)); bezier2Path.AddCurveToPoint(new CGPoint(50.0f, 28.5f), new CGPoint(38.81f, 0.0f), new CGPoint(50.0f, 12.76f)); bezier2Path.ClosePath(); context.SaveState(); bezier2Path.AddClip(); CGRect bezier2Bounds = bezier2Path.CGPath.PathBoundingBox; context.DrawLinearGradient(sadnessGradient, new CGPoint(bezier2Bounds.GetMidX(), bezier2Bounds.GetMinY()), new CGPoint(bezier2Bounds.GetMidX(), bezier2Bounds.GetMaxY()), 0); context.RestoreState(); context.RestoreState(); //// Bezier 3 Drawing context.SaveState(); context.TranslateCTM(102.0f, disgustY); UIBezierPath bezier3Path = new UIBezierPath(); bezier3Path.MoveTo(new CGPoint(50.0f, 28.5f)); bezier3Path.AddCurveToPoint(new CGPoint(49.97f, 30.0f), new CGPoint(50.0f, 29.0f), new CGPoint(49.99f, 29.5f)); bezier3Path.AddCurveToPoint(new CGPoint(50.0f, 301.75f), new CGPoint(50.0f, 30.0f), new CGPoint(50.0f, 301.75f)); bezier3Path.AddLineTo(new CGPoint(0.22f, 301.75f)); bezier3Path.AddCurveToPoint(new CGPoint(0.22f, 32.29f), new CGPoint(0.22f, 301.75f), new CGPoint(0.22f, 58.53f)); bezier3Path.AddCurveToPoint(new CGPoint(0.0f, 28.5f), new CGPoint(0.07f, 31.05f), new CGPoint(-0.0f, 29.78f)); bezier3Path.AddCurveToPoint(new CGPoint(9.9f, 5.79f), new CGPoint(0.0f, 19.23f), new CGPoint(3.88f, 10.99f)); bezier3Path.AddCurveToPoint(new CGPoint(25.0f, 0.0f), new CGPoint(14.09f, 2.16f), new CGPoint(19.33f, -0.0f)); bezier3Path.AddCurveToPoint(new CGPoint(50.0f, 28.5f), new CGPoint(38.81f, 0.0f), new CGPoint(50.0f, 12.76f)); bezier3Path.ClosePath(); context.SaveState(); bezier3Path.AddClip(); CGRect bezier3Bounds = bezier3Path.CGPath.PathBoundingBox; context.DrawLinearGradient(disgustGradient, new CGPoint(bezier3Bounds.GetMidX(), bezier3Bounds.GetMinY()), new CGPoint(bezier3Bounds.GetMidX(), bezier3Bounds.GetMaxY()), 0); context.RestoreState(); context.RestoreState(); //// Bezier 4 Drawing context.SaveState(); context.TranslateCTM(153.0f, fearY); UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new CGPoint(50.0f, 28.5f)); bezier4Path.AddCurveToPoint(new CGPoint(49.97f, 30.0f), new CGPoint(50.0f, 29.0f), new CGPoint(49.99f, 29.5f)); bezier4Path.AddCurveToPoint(new CGPoint(50.0f, 301.75f), new CGPoint(50.0f, 30.0f), new CGPoint(50.0f, 301.75f)); bezier4Path.AddLineTo(new CGPoint(0.22f, 301.75f)); bezier4Path.AddCurveToPoint(new CGPoint(0.22f, 32.29f), new CGPoint(0.22f, 301.75f), new CGPoint(0.22f, 58.53f)); bezier4Path.AddCurveToPoint(new CGPoint(0.0f, 28.5f), new CGPoint(0.07f, 31.05f), new CGPoint(-0.0f, 29.78f)); bezier4Path.AddCurveToPoint(new CGPoint(9.9f, 5.79f), new CGPoint(0.0f, 19.23f), new CGPoint(3.88f, 10.99f)); bezier4Path.AddCurveToPoint(new CGPoint(25.0f, 0.0f), new CGPoint(14.09f, 2.16f), new CGPoint(19.33f, -0.0f)); bezier4Path.AddCurveToPoint(new CGPoint(50.0f, 28.5f), new CGPoint(38.81f, 0.0f), new CGPoint(50.0f, 12.76f)); bezier4Path.ClosePath(); context.SaveState(); bezier4Path.AddClip(); CGRect bezier4Bounds = bezier4Path.CGPath.PathBoundingBox; context.DrawLinearGradient(fearGradient, new CGPoint(bezier4Bounds.GetMidX(), bezier4Bounds.GetMinY()), new CGPoint(bezier4Bounds.GetMidX(), bezier4Bounds.GetMaxY()), 0); context.RestoreState(); context.RestoreState(); //// Bezier 5 Drawing context.SaveState(); context.TranslateCTM(204.0f, happinessY); UIBezierPath bezier5Path = new UIBezierPath(); bezier5Path.MoveTo(new CGPoint(50.0f, 28.5f)); bezier5Path.AddCurveToPoint(new CGPoint(49.97f, 30.0f), new CGPoint(50.0f, 29.0f), new CGPoint(49.99f, 29.5f)); bezier5Path.AddCurveToPoint(new CGPoint(50.0f, 301.75f), new CGPoint(50.0f, 30.0f), new CGPoint(50.0f, 301.75f)); bezier5Path.AddLineTo(new CGPoint(0.22f, 301.75f)); bezier5Path.AddCurveToPoint(new CGPoint(0.22f, 32.29f), new CGPoint(0.22f, 301.75f), new CGPoint(0.22f, 58.53f)); bezier5Path.AddCurveToPoint(new CGPoint(0.0f, 28.5f), new CGPoint(0.07f, 31.05f), new CGPoint(-0.0f, 29.78f)); bezier5Path.AddCurveToPoint(new CGPoint(9.9f, 5.79f), new CGPoint(0.0f, 19.23f), new CGPoint(3.88f, 10.99f)); bezier5Path.AddCurveToPoint(new CGPoint(25.0f, 0.0f), new CGPoint(14.09f, 2.16f), new CGPoint(19.33f, -0.0f)); bezier5Path.AddCurveToPoint(new CGPoint(50.0f, 28.5f), new CGPoint(38.81f, 0.0f), new CGPoint(50.0f, 12.76f)); bezier5Path.ClosePath(); context.SaveState(); bezier5Path.AddClip(); CGRect bezier5Bounds = bezier5Path.CGPath.PathBoundingBox; context.DrawLinearGradient(happyGradient, new CGPoint(bezier5Bounds.GetMidX(), bezier5Bounds.GetMinY()), new CGPoint(bezier5Bounds.GetMidX(), bezier5Bounds.GetMaxY()), 0); context.RestoreState(); context.RestoreState(); //// Bezier 6 Drawing context.SaveState(); context.TranslateCTM(255.0f, neutralY); UIBezierPath bezier6Path = new UIBezierPath(); bezier6Path.MoveTo(new CGPoint(50.0f, 28.5f)); bezier6Path.AddCurveToPoint(new CGPoint(49.97f, 30.0f), new CGPoint(50.0f, 29.0f), new CGPoint(49.99f, 29.5f)); bezier6Path.AddCurveToPoint(new CGPoint(50.0f, 301.75f), new CGPoint(50.0f, 30.0f), new CGPoint(50.0f, 301.75f)); bezier6Path.AddLineTo(new CGPoint(0.22f, 301.75f)); bezier6Path.AddCurveToPoint(new CGPoint(0.22f, 32.29f), new CGPoint(0.22f, 301.75f), new CGPoint(0.22f, 58.53f)); bezier6Path.AddCurveToPoint(new CGPoint(0.0f, 28.5f), new CGPoint(0.07f, 31.05f), new CGPoint(-0.0f, 29.78f)); bezier6Path.AddCurveToPoint(new CGPoint(9.9f, 5.79f), new CGPoint(0.0f, 19.23f), new CGPoint(3.88f, 10.99f)); bezier6Path.AddCurveToPoint(new CGPoint(25.0f, 0.0f), new CGPoint(14.09f, 2.16f), new CGPoint(19.33f, -0.0f)); bezier6Path.AddCurveToPoint(new CGPoint(50.0f, 28.5f), new CGPoint(38.81f, 0.0f), new CGPoint(50.0f, 12.76f)); bezier6Path.ClosePath(); context.SaveState(); bezier6Path.AddClip(); CGRect bezier6Bounds = bezier6Path.CGPath.PathBoundingBox; context.DrawLinearGradient(neutralGradient, new CGPoint(bezier6Bounds.GetMidX(), bezier6Bounds.GetMinY()), new CGPoint(bezier6Bounds.GetMidX(), bezier6Bounds.GetMaxY()), 0); context.RestoreState(); context.RestoreState(); //// Bezier 7 Drawing context.SaveState(); context.TranslateCTM(306.0f, surpriseY); UIBezierPath bezier7Path = new UIBezierPath(); bezier7Path.MoveTo(new CGPoint(50.0f, 28.5f)); bezier7Path.AddCurveToPoint(new CGPoint(49.97f, 30.0f), new CGPoint(50.0f, 29.0f), new CGPoint(49.99f, 29.5f)); bezier7Path.AddCurveToPoint(new CGPoint(50.0f, 301.75f), new CGPoint(50.0f, 30.0f), new CGPoint(50.0f, 301.75f)); bezier7Path.AddLineTo(new CGPoint(0.22f, 301.75f)); bezier7Path.AddCurveToPoint(new CGPoint(0.22f, 32.29f), new CGPoint(0.22f, 301.75f), new CGPoint(0.22f, 58.53f)); bezier7Path.AddCurveToPoint(new CGPoint(0.0f, 28.5f), new CGPoint(0.07f, 31.05f), new CGPoint(-0.0f, 29.78f)); bezier7Path.AddCurveToPoint(new CGPoint(9.9f, 5.79f), new CGPoint(0.0f, 19.23f), new CGPoint(3.88f, 10.99f)); bezier7Path.AddCurveToPoint(new CGPoint(25.0f, 0.0f), new CGPoint(14.09f, 2.16f), new CGPoint(19.33f, -0.0f)); bezier7Path.AddCurveToPoint(new CGPoint(50.0f, 28.5f), new CGPoint(38.81f, 0.0f), new CGPoint(50.0f, 12.76f)); bezier7Path.ClosePath(); context.SaveState(); bezier7Path.AddClip(); CGRect bezier7Bounds = bezier7Path.CGPath.PathBoundingBox; context.DrawLinearGradient(surpriseGradient, new CGPoint(bezier7Bounds.GetMidX(), bezier7Bounds.GetMinY()), new CGPoint(bezier7Bounds.GetMidX(), bezier7Bounds.GetMaxY()), 0); context.RestoreState(); context.RestoreState(); //// Bezier 8 Drawing context.SaveState(); context.TranslateCTM(357.0f, contemptY); UIBezierPath bezier8Path = new UIBezierPath(); bezier8Path.MoveTo(new CGPoint(50.0f, 28.5f)); bezier8Path.AddCurveToPoint(new CGPoint(49.97f, 30.0f), new CGPoint(50.0f, 29.0f), new CGPoint(49.99f, 29.5f)); bezier8Path.AddCurveToPoint(new CGPoint(50.0f, 301.75f), new CGPoint(50.0f, 30.0f), new CGPoint(50.0f, 301.75f)); bezier8Path.AddLineTo(new CGPoint(0.22f, 301.75f)); bezier8Path.AddCurveToPoint(new CGPoint(0.22f, 32.29f), new CGPoint(0.22f, 301.75f), new CGPoint(0.22f, 58.53f)); bezier8Path.AddCurveToPoint(new CGPoint(0.0f, 28.5f), new CGPoint(0.07f, 31.05f), new CGPoint(-0.0f, 29.78f)); bezier8Path.AddCurveToPoint(new CGPoint(9.9f, 5.79f), new CGPoint(0.0f, 19.23f), new CGPoint(3.88f, 10.99f)); bezier8Path.AddCurveToPoint(new CGPoint(25.0f, 0.0f), new CGPoint(14.09f, 2.16f), new CGPoint(19.33f, -0.0f)); bezier8Path.AddCurveToPoint(new CGPoint(50.0f, 28.5f), new CGPoint(38.81f, 0.0f), new CGPoint(50.0f, 12.76f)); bezier8Path.ClosePath(); context.SaveState(); bezier8Path.AddClip(); CGRect bezier8Bounds = bezier8Path.CGPath.PathBoundingBox; context.DrawLinearGradient(contemptGradient, new CGPoint(bezier8Bounds.GetMidX(), bezier8Bounds.GetMinY()), new CGPoint(bezier8Bounds.GetMidX(), bezier8Bounds.GetMaxY()), 0); context.RestoreState(); context.RestoreState(); }
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(); } }
private void DrawCanvas(CGRect frame, string beerName) { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations var fillColor = UIColor.FromRGBA(0.500f, 0.500f, 0.500f, 1.000f); var shadowTint = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); var fillColor2 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); var strokeColor = UIColor.FromRGBA(0.531f, 0.531f, 0.531f, 1.000f); var textForeground2 = UIColor.FromRGBA(0.408f, 0.408f, 0.408f, 1.000f); //// Shadow Declarations var shadow2 = new NSShadow(); shadow2.ShadowColor = shadowTint.ColorWithAlpha(shadowTint.CGColor.Alpha * 0.3f); shadow2.ShadowOffset = new CGSize(930.1f, -0.1f); shadow2.ShadowBlurRadius = 10.0f; //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRoundedRect(new CGRect(-921.0f, 9.0f, 395.0f, 418.0f), 8.0f); context.SaveState(); context.SetShadow(shadow2.ShadowOffset, shadow2.ShadowBlurRadius, shadow2.ShadowColor.CGColor); fillColor.SetFill(); rectanglePath.Fill(); context.RestoreState(); //// Group { context.SaveState(); context.BeginTransparencyLayer(); //// Clip Clip 2 UIBezierPath clip2Path = new UIBezierPath(); clip2Path.MoveTo(new CGPoint(-11.5f, -11.5f)); clip2Path.AddLineTo(new CGPoint(424.5f, -11.5f)); clip2Path.AddLineTo(new CGPoint(424.5f, 447.5f)); clip2Path.AddLineTo(new CGPoint(-11.5f, 447.5f)); clip2Path.AddLineTo(new CGPoint(-11.5f, -11.5f)); clip2Path.ClosePath(); clip2Path.MoveTo(new CGPoint(9.5f, 17.0f)); clip2Path.AddCurveToPoint(new CGPoint(17.0f, 9.5f), new CGPoint(9.5f, 12.86f), new CGPoint(12.86f, 9.5f)); clip2Path.AddLineTo(new CGPoint(396.0f, 9.5f)); clip2Path.AddCurveToPoint(new CGPoint(403.5f, 17.0f), new CGPoint(400.14f, 9.5f), new CGPoint(403.5f, 12.86f)); clip2Path.AddLineTo(new CGPoint(403.5f, 419.0f)); clip2Path.AddCurveToPoint(new CGPoint(396.0f, 426.5f), new CGPoint(403.5f, 423.14f), new CGPoint(400.14f, 426.5f)); clip2Path.AddLineTo(new CGPoint(17.0f, 426.5f)); clip2Path.AddCurveToPoint(new CGPoint(9.5f, 419.0f), new CGPoint(12.86f, 426.5f), new CGPoint(9.5f, 423.14f)); clip2Path.AddLineTo(new CGPoint(9.5f, 17.0f)); clip2Path.ClosePath(); clip2Path.MoveTo(new CGPoint(8.5f, 17.0f)); clip2Path.AddLineTo(new CGPoint(8.5f, 419.0f)); clip2Path.AddCurveToPoint(new CGPoint(17.0f, 427.5f), new CGPoint(8.5f, 423.69f), new CGPoint(12.31f, 427.5f)); clip2Path.AddLineTo(new CGPoint(396.0f, 427.5f)); clip2Path.AddCurveToPoint(new CGPoint(404.5f, 419.0f), new CGPoint(400.69f, 427.5f), new CGPoint(404.5f, 423.69f)); clip2Path.AddLineTo(new CGPoint(404.5f, 17.0f)); clip2Path.AddCurveToPoint(new CGPoint(396.0f, 8.5f), new CGPoint(404.5f, 12.31f), new CGPoint(400.69f, 8.5f)); clip2Path.AddLineTo(new CGPoint(17.0f, 8.5f)); clip2Path.AddCurveToPoint(new CGPoint(8.5f, 17.0f), new CGPoint(12.31f, 8.5f), new CGPoint(8.5f, 12.31f)); clip2Path.ClosePath(); clip2Path.UsesEvenOddFillRule = true; clip2Path.AddClip(); //// Group 2 { context.SaveState(); context.BeginTransparencyLayer(); //// Clip Clip var clipPath = UIBezierPath.FromRoundedRect(new CGRect(9.0f, 9.0f, 395.0f, 418.0f), 8.0f); clipPath.AddClip(); //// Rectangle 2 Drawing var rectangle2Path = UIBezierPath.FromRoundedRect(new CGRect(9.0f, 9.0f, 395.0f, 418.0f), 8.0f); fillColor2.SetFill(); rectangle2Path.Fill(); context.EndTransparencyLayer(); context.RestoreState(); } context.EndTransparencyLayer(); context.RestoreState(); } //// background { context.SaveState(); context.BeginTransparencyLayer(); //// Clip Clip 3 var clip3Path = UIBezierPath.FromRoundedRect(new CGRect(frame.GetMinX(), frame.GetMinY() + 9.0f, 395.0f, 418.0f), 8.0f); clip3Path.AddClip(); //// Rectangle 4 Drawing var rectangle4Path = UIBezierPath.FromRoundedRect(new CGRect(frame.GetMinX(), frame.GetMinY() + 9.0f, 395.0f, 418.0f), 8.0f); strokeColor.SetStroke(); rectangle4Path.LineWidth = 2.0f; rectangle4Path.Stroke(); context.EndTransparencyLayer(); context.RestoreState(); } //// title Drawing CGRect titleRect = new CGRect(frame.GetMinX() + 0.38f, frame.GetMinY() + 19.0f, 394.62f, 41.0f); textForeground2.SetFill(); var titleStyle = new NSMutableParagraphStyle (); titleStyle.Alignment = UITextAlignment.Center; var titleFontAttributes = new UIStringAttributes () {Font = UIFont.FromName("Avenir-Medium", 24.0f), ForegroundColor = textForeground2, ParagraphStyle = titleStyle}; var titleTextHeight = new NSString(beerName).GetBoundingRect(new CGSize(titleRect.Width, nfloat.MaxValue), NSStringDrawingOptions.UsesLineFragmentOrigin, titleFontAttributes, null).Height; context.SaveState(); context.ClipToRect(titleRect); new NSString(beerName).DrawString(new CGRect(titleRect.GetMinX(), titleRect.GetMinY() + (titleRect.Height - titleTextHeight) / 2.0f, titleRect.Width, titleTextHeight), UIFont.FromName("Avenir-Medium", 24.0f), UILineBreakMode.WordWrap, UITextAlignment.Center); context.RestoreState(); }