//// 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 BezierTo(Point point1, Point point2, Point point3, bool isStroked, bool isSmoothJoin) { #if XAMARIN_IOS_UNIFIED || XAMARIN_IOS bezierPath.AddCurveToPoint(point3, point1, point2); #elif XAMARIN_ANDROID var physicalPoint1 = LogicalToPhysicalNoRounding(point1); var physicalPoint2 = LogicalToPhysicalNoRounding(point2); var physicalPoint3 = LogicalToPhysicalNoRounding(point3); bezierPath.CubicTo((float)physicalPoint1.X, (float)physicalPoint1.Y, (float)physicalPoint2.X, (float)physicalPoint2.Y, (float)physicalPoint3.X, (float)physicalPoint3.Y); #endif _points.Add(point3); }
public override void BezierTo(Point point1, Point point2, Point point3, bool isStroked, bool isSmoothJoin) { #if __IOS__ bezierPath.AddCurveToPoint(point3, point1, point2); #elif __MACOS__ bezierPath.CurveTo(point3, point1, point2); #elif __ANDROID__ bezierPath.CubicTo((float)point1.X, (float)point1.Y, (float)point2.X, (float)point2.Y, (float)point3.X, (float)point3.Y); #elif __SKIA__ bezierPath.Geometry.CubicTo((float)point1.X, (float)point1.Y, (float)point2.X, (float)point2.Y, (float)point3.X, (float)point3.Y); #endif _points.Add(point3); }
void DrawCanvas(CGRect frame) { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations var color = UIColor.FromRGBA(0.851f, 0.851f, 0.851f, 1.000f); var fillColor3 = UIColor.FromRGBA(0.333f, 0.333f, 0.333f, 1.000f); var fillColor4 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); var fillColor5 = UIColor.FromRGBA(0.867f, 0.867f, 0.863f, 1.000f); var fillColor6 = UIColor.FromRGBA(0.671f, 0.671f, 0.671f, 1.000f); var fillColor7 = UIColor.FromRGBA(0.467f, 0.467f, 0.467f, 1.000f); var fillColor8 = UIColor.FromRGBA(0.918f, 0.478f, 0.149f, 1.000f); var fillColor9 = UIColor.FromRGBA(0.529f, 0.529f, 0.529f, 1.000f); var fillColor10 = UIColor.FromRGBA(0.271f, 0.271f, 0.271f, 1.000f); var color2 = UIColor.FromRGBA(0.941f, 0.941f, 0.941f, 1.000f); var color5 = UIColor.FromRGBA(0.275f, 0.275f, 0.275f, 1.000f); //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRoundedRect(new CGRect(frame.GetMinX(), frame.GetMinY() + NMath.Floor((frame.Height) * 0.00000f + 0.5f), frame.Width - 0.5f, frame.Height - NMath.Floor((frame.Height) * 0.00000f + 0.5f)), 4.0f); color2.SetFill(); rectanglePath.Fill(); color.SetStroke(); rectanglePath.LineWidth = 1.0f; rectanglePath.Stroke(); //// Group 2 { context.SaveState(); context.TranslateCTM(frame.GetMinX() + 0.43716f * frame.Width, frame.GetMinY() + 0.12195f * frame.Height); context.ScaleCTM(0.4f, 0.4f); //// Rectangle 2 Drawing var rectangle2Path = UIBezierPath.FromRect(new CGRect(0.0f, 36.0f, 112.0f, 36.0f)); fillColor3.SetFill(); rectangle2Path.Fill(); //// Rectangle 3 Drawing var rectangle3Path = UIBezierPath.FromRect(new CGRect(0.0f, 72.0f, 112.0f, 8.0f)); fillColor4.SetFill(); rectangle3Path.Fill(); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(0.0f, 80.0f)); bezierPath.AddCurveToPoint(new CGPoint(8.0f, 88.0f), new CGPoint(0.0f, 84.42f), new CGPoint(3.58f, 88.0f)); bezierPath.AddLineTo(new CGPoint(104.0f, 88.0f)); bezierPath.AddCurveToPoint(new CGPoint(112.0f, 80.0f), new CGPoint(108.42f, 88.0f), new CGPoint(112.0f, 84.42f)); bezierPath.AddLineTo(new CGPoint(0.0f, 80.0f)); bezierPath.AddLineTo(new CGPoint(0.0f, 80.0f)); bezierPath.ClosePath(); bezierPath.UsesEvenOddFillRule = true; fillColor5.SetFill(); bezierPath.Fill(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new CGPoint(56.3f, 88.0f)); bezier2Path.AddLineTo(new CGPoint(104.0f, 88.0f)); bezier2Path.AddCurveToPoint(new CGPoint(112.0f, 80.0f), new CGPoint(108.42f, 88.0f), new CGPoint(112.0f, 84.42f)); bezier2Path.AddLineTo(new CGPoint(48.3f, 80.0f)); bezier2Path.AddLineTo(new CGPoint(56.3f, 88.0f)); bezier2Path.AddLineTo(new CGPoint(56.3f, 88.0f)); bezier2Path.ClosePath(); bezier2Path.UsesEvenOddFillRule = true; fillColor6.SetFill(); bezier2Path.Fill(); //// Rectangle 4 Drawing var rectangle4Path = UIBezierPath.FromRect(new CGRect(0.0f, 28.0f, 112.0f, 8.0f)); fillColor4.SetFill(); rectangle4Path.Fill(); //// Bezier 3 Drawing UIBezierPath bezier3Path = new UIBezierPath(); bezier3Path.MoveTo(new CGPoint(104.0f, 8.0f)); bezier3Path.AddLineTo(new CGPoint(76.0f, 8.0f)); bezier3Path.AddLineTo(new CGPoint(68.0f, 0.0f)); bezier3Path.AddLineTo(new CGPoint(44.0f, 0.0f)); bezier3Path.AddLineTo(new CGPoint(36.0f, 8.0f)); bezier3Path.AddLineTo(new CGPoint(8.0f, 8.0f)); bezier3Path.AddCurveToPoint(new CGPoint(0.0f, 16.0f), new CGPoint(3.6f, 8.0f), new CGPoint(0.0f, 11.6f)); bezier3Path.AddLineTo(new CGPoint(0.0f, 28.0f)); bezier3Path.AddLineTo(new CGPoint(112.0f, 28.0f)); bezier3Path.AddLineTo(new CGPoint(112.0f, 16.0f)); bezier3Path.AddCurveToPoint(new CGPoint(104.0f, 8.0f), new CGPoint(112.0f, 11.58f), new CGPoint(108.42f, 8.0f)); bezier3Path.AddLineTo(new CGPoint(104.0f, 8.0f)); bezier3Path.ClosePath(); bezier3Path.UsesEvenOddFillRule = true; fillColor5.SetFill(); bezier3Path.Fill(); //// Oval Drawing var ovalPath = UIBezierPath.FromOval(new CGRect(28.0f, 20.0f, 56.0f, 56.0f)); fillColor7.SetFill(); ovalPath.Fill(); //// Oval 2 Drawing var oval2Path = UIBezierPath.FromOval(new CGRect(32.0f, 24.0f, 48.0f, 48.0f)); fillColor4.SetFill(); oval2Path.Fill(); //// Oval 3 Drawing var oval3Path = UIBezierPath.FromOval(new CGRect(8.0f, 16.0f, 8.0f, 8.0f)); fillColor8.SetFill(); oval3Path.Fill(); //// Group 3 { context.SaveState(); context.SetAlpha(0.4f); context.BeginTransparencyLayer(); //// Bezier 4 Drawing UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new CGPoint(104.0f, 24.0f)); bezier4Path.AddLineTo(new CGPoint(96.0f, 24.0f)); bezier4Path.AddLineTo(new CGPoint(104.0f, 16.0f)); bezier4Path.AddLineTo(new CGPoint(104.0f, 24.0f)); bezier4Path.ClosePath(); bezier4Path.UsesEvenOddFillRule = true; fillColor3.SetFill(); bezier4Path.Fill(); context.EndTransparencyLayer(); context.RestoreState(); } //// Bezier 5 Drawing UIBezierPath bezier5Path = new UIBezierPath(); bezier5Path.MoveTo(new CGPoint(96.0f, 24.0f)); bezier5Path.AddLineTo(new CGPoint(96.0f, 16.0f)); bezier5Path.AddLineTo(new CGPoint(104.0f, 16.0f)); bezier5Path.AddLineTo(new CGPoint(96.0f, 24.0f)); bezier5Path.ClosePath(); bezier5Path.UsesEvenOddFillRule = true; fillColor9.SetFill(); bezier5Path.Fill(); //// Oval 4 Drawing var oval4Path = UIBezierPath.FromOval(new CGRect(40.0f, 32.0f, 32.0f, 32.0f)); fillColor3.SetFill(); oval4Path.Fill(); //// Bezier 6 Drawing UIBezierPath bezier6Path = new UIBezierPath(); bezier6Path.MoveTo(new CGPoint(60.0f, 36.0f)); bezier6Path.AddCurveToPoint(new CGPoint(44.0f, 52.0f), new CGPoint(51.16f, 36.0f), new CGPoint(44.0f, 43.16f)); bezier6Path.AddCurveToPoint(new CGPoint(46.88f, 61.12f), new CGPoint(44.0f, 55.4f), new CGPoint(45.07f, 58.53f)); bezier6Path.AddCurveToPoint(new CGPoint(56.0f, 64.0f), new CGPoint(49.47f, 62.93f), new CGPoint(52.6f, 64.0f)); bezier6Path.AddCurveToPoint(new CGPoint(72.0f, 48.0f), new CGPoint(64.84f, 64.0f), new CGPoint(72.0f, 56.84f)); bezier6Path.AddCurveToPoint(new CGPoint(69.12f, 38.88f), new CGPoint(72.0f, 44.6f), new CGPoint(70.93f, 41.47f)); bezier6Path.AddCurveToPoint(new CGPoint(60.0f, 36.0f), new CGPoint(66.53f, 37.07f), new CGPoint(63.4f, 36.0f)); bezier6Path.AddLineTo(new CGPoint(60.0f, 36.0f)); bezier6Path.ClosePath(); bezier6Path.UsesEvenOddFillRule = true; fillColor7.SetFill(); bezier6Path.Fill(); //// Oval 5 Drawing var oval5Path = UIBezierPath.FromOval(new CGRect(48.0f, 40.0f, 12.0f, 12.0f)); fillColor6.SetFill(); oval5Path.Fill(); //// Oval 6 Drawing var oval6Path = UIBezierPath.FromOval(new CGRect(60.0f, 48.0f, 8.0f, 8.0f)); fillColor5.SetFill(); oval6Path.Fill(); //// Group 4 { context.SaveState(); context.SetAlpha(0.4f); context.BeginTransparencyLayer(); //// Bezier 7 Drawing UIBezierPath bezier7Path = new UIBezierPath(); bezier7Path.MoveTo(new CGPoint(41.65f, 72.0f)); bezier7Path.AddCurveToPoint(new CGPoint(35.96f, 67.54f), new CGPoint(39.57f, 70.75f), new CGPoint(37.65f, 69.26f)); bezier7Path.AddLineTo(new CGPoint(35.9f, 67.6f)); bezier7Path.AddLineTo(new CGPoint(40.3f, 72.0f)); bezier7Path.AddLineTo(new CGPoint(41.65f, 72.0f)); bezier7Path.AddLineTo(new CGPoint(41.65f, 72.0f)); bezier7Path.ClosePath(); bezier7Path.UsesEvenOddFillRule = true; fillColor3.SetFill(); bezier7Path.Fill(); context.EndTransparencyLayer(); context.RestoreState(); } //// Bezier 8 Drawing UIBezierPath bezier8Path = new UIBezierPath(); bezier8Path.MoveTo(new CGPoint(81.26f, 36.0f)); bezier8Path.AddCurveToPoint(new CGPoint(84.0f, 48.0f), new CGPoint(83.0f, 39.64f), new CGPoint(84.0f, 43.7f)); bezier8Path.AddCurveToPoint(new CGPoint(70.36f, 72.0f), new CGPoint(84.0f, 58.2f), new CGPoint(78.52f, 67.1f)); bezier8Path.AddLineTo(new CGPoint(112.0f, 72.0f)); bezier8Path.AddLineTo(new CGPoint(112.0f, 64.5f)); bezier8Path.AddLineTo(new CGPoint(83.5f, 36.0f)); bezier8Path.AddLineTo(new CGPoint(81.26f, 36.0f)); bezier8Path.AddLineTo(new CGPoint(81.26f, 36.0f)); bezier8Path.ClosePath(); bezier8Path.UsesEvenOddFillRule = true; fillColor10.SetFill(); bezier8Path.Fill(); context.RestoreState(); } //// Text Drawing CGRect textRect = new CGRect(frame.GetMinX() + 7.0f, frame.GetMinY() + NMath.Floor((frame.Height - 8.0f) * 0.67568f + 0.5f), frame.Width - 14.0f, frame.Height - 8.0f - NMath.Floor((frame.Height - 8.0f) * 0.67568f + 0.5f)); { var textContent = "Picture Search"; color5.SetFill(); var textStyle = new NSMutableParagraphStyle(); textStyle.Alignment = UITextAlignment.Center; var textFontAttributes = new UIStringAttributes() { Font = UIFont.FromName("Avenir-Medium", UIFont.ButtonFontSize), ForegroundColor = color5, ParagraphStyle = textStyle }; var textTextHeight = new NSString(textContent).GetBoundingRect(new CGSize(textRect.Width, nfloat.MaxValue), NSStringDrawingOptions.UsesLineFragmentOrigin, textFontAttributes, null).Height; context.SaveState(); context.ClipToRect(textRect); new NSString(textContent).DrawString(new CGRect(textRect.GetMinX(), textRect.GetMinY() + (textRect.Height - textTextHeight) / 2.0f, textRect.Width, textTextHeight), UIFont.FromName("Avenir-Medium", UIFont.ButtonFontSize), UILineBreakMode.WordWrap, UITextAlignment.Center); context.RestoreState(); } }
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 override void TouchesMoved(NSSet touches, UIEvent evt) { // base.TouchesMoved(touches, evt); if (!TrapState.Shared.HasActiveSnapshotImage) return; touchesDidMove = true; var touch = touches.AnyObject as UITouch; var point = touch.LocationInView(bufferImageView); var difX = point.X - pathStart.X; var difY = point.Y - pathStart.Y; var path = new UIBezierPath (); switch (Tool) { case Annotate.Tool.Callout: case Annotate.Tool.Color: return; case Annotate.Tool.Marker: counter++; markerPoints[counter] = point; if (counter == 4) { // move the endpoint to the middle of the line joining the second control point // of the first Bezier segment and the first control point of the second Bezier segment markerPoints[3] = new CGPoint ((markerPoints[2].X + markerPoints[4].X) / 2, (markerPoints[2].Y + markerPoints[4].Y) / 2); path = new UIBezierPath (); path.MoveTo(markerPoints[0]); path.AddCurveToPoint(markerPoints[3], markerPoints[1], markerPoints[2]); path.LineWidth = bzPath.LineWidth; // add to cached path to draw and add to undo stack bzPath.AppendPath(path); // replace points and get ready to handle the next segment markerPoints[0] = markerPoints[3]; markerPoints[1] = markerPoints[4]; counter = 1; } path.Stroke(); bufferImageView.Image = UIGraphics.GetImageFromCurrentImageContext(); break; case Annotate.Tool.Arrow: var total = Math.Sqrt(Math.Pow(difX, 2) + Math.Pow(difX, 2)); var tailL = (nfloat)(total * 0.7); var tailW = bzPath.LineWidth / 2; var headW = (nfloat)((total * 0.2) / 2); arrowPoints[0] = new CGPoint (0, tailW); arrowPoints[1] = new CGPoint (tailL, tailW); arrowPoints[2] = new CGPoint (tailL, headW); arrowPoints[3] = new CGPoint ((nfloat)total, 0); arrowPoints[4] = new CGPoint (tailL, -headW); arrowPoints[5] = new CGPoint (tailL, -tailW); arrowPoints[6] = new CGPoint (0, -tailW); nfloat cosine = (nfloat)(difX / total), sine = (nfloat)(difY / total); var transform = new CGAffineTransform (cosine, sine, -sine, cosine, pathStart.X, pathStart.Y); var cgPath = new CGPath (); cgPath.AddLines(transform, arrowPoints, 7); cgPath.CloseSubpath(); path = UIBezierPath.FromPath(cgPath); path.LineWidth = bzPath.LineWidth; // cache path to draw and add to undo stack later bzPath = path; UIGraphics.BeginImageContextWithOptions(bufferRect.Size, false, 0); strokeColor.SetFill(); path.Fill(); strokeColor.SetStroke(); path.Stroke(); bufferImageView.Image = UIGraphics.GetImageFromCurrentImageContext(); UIGraphics.EndImageContext(); break; case Annotate.Tool.Circle: case Annotate.Tool.Square: var origin = new CGPoint ((nfloat)Math.Min(pathStart.X, point.X), (nfloat)Math.Min(pathStart.Y, point.Y)); var size = new CGSize ((nfloat)Math.Abs(difX), (nfloat)Math.Abs(difY)); var rect = new CGRect (origin, size); path = Tool == Annotate.Tool.Circle ? UIBezierPath.FromOval(rect) : UIBezierPath.FromRect(rect); path.LineWidth = bzPath.LineWidth; // cache path to draw and add to undo stack later bzPath = path; UIGraphics.BeginImageContextWithOptions(bufferRect.Size, false, 0); strokeColor.SetStroke(); path.Stroke(); bufferImageView.Image = UIGraphics.GetImageFromCurrentImageContext(); UIGraphics.EndImageContext(); break; } }
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); // ------------- 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 ---------------- }
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(); }
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(); }
void DrawBeerLoader(CGRect frame, float percentage) { var fillColor4 = UIColor.FromRGBA(0.963f, 0.836f, 0.300f, 1.000f); var fillColor9 = UIColor.FromRGBA(0.833f, 0.723f, 0.260f, 1.000f); var expression = 450.0f - 360.0f / 100.0f * percentage; var expression2 = 180.0f - 360.0f / 100.0f * percentage; CGRect background = new CGRect(frame.GetMinX() + NMath.Floor(frame.Width * 0.00017f + 0.41f) + 0.09f, frame.GetMinY() + NMath.Floor(frame.Height * 0.00016f + 0.23f) + 0.27f, NMath.Floor(frame.Width * 0.99950f - 0.24f) - NMath.Floor(frame.Width * 0.00017f + 0.41f) + 0.65f, NMath.Floor(frame.Height * 0.98998f - 0.42f) - NMath.Floor(frame.Height * 0.00016f + 0.23f) + 0.65f); CGRect beer = new CGRect(frame.GetMinX() + NMath.Floor(frame.Width * 0.33565f - 0.05f) + 0.55f, frame.GetMinY() + NMath.Floor(frame.Height * 0.22329f + 0.0f) + 0.5f, NMath.Floor(frame.Width * 0.71844f - 0.4f) - NMath.Floor(frame.Width * 0.33565f - 0.05f) + 0.35f, NMath.Floor(frame.Height * 0.72339f - 0.05f) - NMath.Floor(frame.Height * 0.22329f + 0.0f) + 0.05f); { UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(background.GetMinX() + 0.94794f * background.Width, background.GetMinY() + 0.58913f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.96205f * background.Width, background.GetMinY() + 0.69140f * background.Height), new CGPoint(background.GetMinX() + 0.94178f * background.Width, background.GetMinY() + 0.62023f * background.Height), new CGPoint(background.GetMinX() + 0.97392f * background.Width, background.GetMinY() + 0.66278f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.87973f * background.Width, background.GetMinY() + 0.75370f * background.Height), new CGPoint(background.GetMinX() + 0.94998f * background.Width, background.GetMinY() + 0.72052f * background.Height), new CGPoint(background.GetMinX() + 0.89706f * background.Width, background.GetMinY() + 0.72781f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.85355f * background.Width, background.GetMinY() + 0.85355f * background.Height), new CGPoint(background.GetMinX() + 0.86227f * background.Width, background.GetMinY() + 0.77977f * background.Height), new CGPoint(background.GetMinX() + 0.87567f * background.Width, background.GetMinY() + 0.83144f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.75369f * background.Width, background.GetMinY() + 0.87973f * background.Height), new CGPoint(background.GetMinX() + 0.83144f * background.Width, background.GetMinY() + 0.87567f * background.Height), new CGPoint(background.GetMinX() + 0.77977f * background.Width, background.GetMinY() + 0.86227f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.69139f * background.Width, background.GetMinY() + 0.96205f * background.Height), new CGPoint(background.GetMinX() + 0.72781f * background.Width, background.GetMinY() + 0.89706f * background.Height), new CGPoint(background.GetMinX() + 0.72051f * background.Width, background.GetMinY() + 0.94998f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.63742f * background.Width, background.GetMinY() + 0.95593f * background.Height), new CGPoint(background.GetMinX() + 0.67609f * background.Width, background.GetMinY() + 0.96840f * background.Height), new CGPoint(background.GetMinX() + 0.65681f * background.Width, background.GetMinY() + 0.96216f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.58913f * background.Width, background.GetMinY() + 0.94793f * background.Height), new CGPoint(background.GetMinX() + 0.62055f * background.Width, background.GetMinY() + 0.95050f * background.Height), new CGPoint(background.GetMinX() + 0.60360f * background.Width, background.GetMinY() + 0.94507f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.50000f * background.Width, background.GetMinY() + 1.00000f * background.Height), new CGPoint(background.GetMinX() + 0.55894f * background.Width, background.GetMinY() + 0.95391f * background.Height), new CGPoint(background.GetMinX() + 0.53194f * background.Width, background.GetMinY() + 1.00000f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.41087f * background.Width, background.GetMinY() + 0.94793f * background.Height), new CGPoint(background.GetMinX() + 0.46806f * background.Width, background.GetMinY() + 1.00000f * background.Height), new CGPoint(background.GetMinX() + 0.44106f * background.Width, background.GetMinY() + 0.95391f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.36258f * background.Width, background.GetMinY() + 0.95593f * background.Height), new CGPoint(background.GetMinX() + 0.39640f * background.Width, background.GetMinY() + 0.94507f * background.Height), new CGPoint(background.GetMinX() + 0.37945f * background.Width, background.GetMinY() + 0.95050f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.30861f * background.Width, background.GetMinY() + 0.96205f * background.Height), new CGPoint(background.GetMinX() + 0.34319f * background.Width, background.GetMinY() + 0.96216f * background.Height), new CGPoint(background.GetMinX() + 0.32391f * background.Width, background.GetMinY() + 0.96840f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.24631f * background.Width, background.GetMinY() + 0.87973f * background.Height), new CGPoint(background.GetMinX() + 0.27949f * background.Width, background.GetMinY() + 0.94998f * background.Height), new CGPoint(background.GetMinX() + 0.27219f * background.Width, background.GetMinY() + 0.89705f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.14645f * background.Width, background.GetMinY() + 0.85355f * background.Height), new CGPoint(background.GetMinX() + 0.22023f * background.Width, background.GetMinY() + 0.86227f * background.Height), new CGPoint(background.GetMinX() + 0.16856f * background.Width, background.GetMinY() + 0.87567f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.12027f * background.Width, background.GetMinY() + 0.75369f * background.Height), new CGPoint(background.GetMinX() + 0.12433f * background.Width, background.GetMinY() + 0.83144f * background.Height), new CGPoint(background.GetMinX() + 0.13773f * background.Width, background.GetMinY() + 0.77977f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.03795f * background.Width, background.GetMinY() + 0.69139f * background.Height), new CGPoint(background.GetMinX() + 0.10294f * background.Width, background.GetMinY() + 0.72781f * background.Height), new CGPoint(background.GetMinX() + 0.05002f * background.Width, background.GetMinY() + 0.72051f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.05207f * background.Width, background.GetMinY() + 0.58913f * background.Height), new CGPoint(background.GetMinX() + 0.02608f * background.Width, background.GetMinY() + 0.66277f * background.Height), new CGPoint(background.GetMinX() + 0.05822f * background.Width, background.GetMinY() + 0.62023f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.00000f * background.Width, background.GetMinY() + 0.50000f * background.Height), new CGPoint(background.GetMinX() + 0.04609f * background.Width, background.GetMinY() + 0.55894f * background.Height), new CGPoint(background.GetMinX() + 0.00000f * background.Width, background.GetMinY() + 0.53194f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.05207f * background.Width, background.GetMinY() + 0.41087f * background.Height), new CGPoint(background.GetMinX() + 0.00000f * background.Width, background.GetMinY() + 0.46806f * background.Height), new CGPoint(background.GetMinX() + 0.04609f * background.Width, background.GetMinY() + 0.44106f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.03795f * background.Width, background.GetMinY() + 0.30861f * background.Height), new CGPoint(background.GetMinX() + 0.05822f * background.Width, background.GetMinY() + 0.37976f * background.Height), new CGPoint(background.GetMinX() + 0.02608f * background.Width, background.GetMinY() + 0.33723f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.12027f * background.Width, background.GetMinY() + 0.24631f * background.Height), new CGPoint(background.GetMinX() + 0.05002f * background.Width, background.GetMinY() + 0.27949f * background.Height), new CGPoint(background.GetMinX() + 0.10294f * background.Width, background.GetMinY() + 0.27219f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.14645f * background.Width, background.GetMinY() + 0.14644f * background.Height), new CGPoint(background.GetMinX() + 0.13773f * background.Width, background.GetMinY() + 0.22023f * background.Height), new CGPoint(background.GetMinX() + 0.12433f * background.Width, background.GetMinY() + 0.16856f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.24631f * background.Width, background.GetMinY() + 0.12027f * background.Height), new CGPoint(background.GetMinX() + 0.16856f * background.Width, background.GetMinY() + 0.12433f * background.Height), new CGPoint(background.GetMinX() + 0.22023f * background.Width, background.GetMinY() + 0.13773f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.30861f * background.Width, background.GetMinY() + 0.03795f * background.Height), new CGPoint(background.GetMinX() + 0.27219f * background.Width, background.GetMinY() + 0.10294f * background.Height), new CGPoint(background.GetMinX() + 0.27949f * background.Width, background.GetMinY() + 0.05002f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.36258f * background.Width, background.GetMinY() + 0.04407f * background.Height), new CGPoint(background.GetMinX() + 0.32391f * background.Width, background.GetMinY() + 0.03160f * background.Height), new CGPoint(background.GetMinX() + 0.34319f * background.Width, background.GetMinY() + 0.03784f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.41087f * background.Width, background.GetMinY() + 0.05206f * background.Height), new CGPoint(background.GetMinX() + 0.37945f * background.Width, background.GetMinY() + 0.04950f * background.Height), new CGPoint(background.GetMinX() + 0.39640f * background.Width, background.GetMinY() + 0.05493f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.50000f * background.Width, background.GetMinY() + 0.00000f * background.Height), new CGPoint(background.GetMinX() + 0.44106f * background.Width, background.GetMinY() + 0.04609f * background.Height), new CGPoint(background.GetMinX() + 0.46806f * background.Width, background.GetMinY() + 0.00000f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.58913f * background.Width, background.GetMinY() + 0.05206f * background.Height), new CGPoint(background.GetMinX() + 0.53194f * background.Width, background.GetMinY() + 0.00000f * background.Height), new CGPoint(background.GetMinX() + 0.55894f * background.Width, background.GetMinY() + 0.04609f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.63742f * background.Width, background.GetMinY() + 0.04407f * background.Height), new CGPoint(background.GetMinX() + 0.60360f * background.Width, background.GetMinY() + 0.05493f * background.Height), new CGPoint(background.GetMinX() + 0.62055f * background.Width, background.GetMinY() + 0.04950f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.69140f * background.Width, background.GetMinY() + 0.03795f * background.Height), new CGPoint(background.GetMinX() + 0.65681f * background.Width, background.GetMinY() + 0.03784f * background.Height), new CGPoint(background.GetMinX() + 0.67609f * background.Width, background.GetMinY() + 0.03160f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.75369f * background.Width, background.GetMinY() + 0.12027f * background.Height), new CGPoint(background.GetMinX() + 0.72051f * background.Width, background.GetMinY() + 0.05002f * background.Height), new CGPoint(background.GetMinX() + 0.72781f * background.Width, background.GetMinY() + 0.10294f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.85356f * background.Width, background.GetMinY() + 0.14645f * background.Height), new CGPoint(background.GetMinX() + 0.77977f * background.Width, background.GetMinY() + 0.13773f * background.Height), new CGPoint(background.GetMinX() + 0.83144f * background.Width, background.GetMinY() + 0.12433f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.87973f * background.Width, background.GetMinY() + 0.24631f * background.Height), new CGPoint(background.GetMinX() + 0.87567f * background.Width, background.GetMinY() + 0.16856f * background.Height), new CGPoint(background.GetMinX() + 0.86227f * background.Width, background.GetMinY() + 0.22023f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.96206f * background.Width, background.GetMinY() + 0.30861f * background.Height), new CGPoint(background.GetMinX() + 0.89706f * background.Width, background.GetMinY() + 0.27219f * background.Height), new CGPoint(background.GetMinX() + 0.94998f * background.Width, background.GetMinY() + 0.27949f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.94794f * background.Width, background.GetMinY() + 0.41087f * background.Height), new CGPoint(background.GetMinX() + 0.97392f * background.Width, background.GetMinY() + 0.33723f * background.Height), new CGPoint(background.GetMinX() + 0.94178f * background.Width, background.GetMinY() + 0.37976f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 1.00000f * background.Width, background.GetMinY() + 0.50000f * background.Height), new CGPoint(background.GetMinX() + 0.95391f * background.Width, background.GetMinY() + 0.44106f * background.Height), new CGPoint(background.GetMinX() + 1.00000f * background.Width, background.GetMinY() + 0.46806f * background.Height)); bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.94794f * background.Width, background.GetMinY() + 0.58913f * background.Height), new CGPoint(background.GetMinX() + 1.00000f * background.Width, background.GetMinY() + 0.53194f * background.Height), new CGPoint(background.GetMinX() + 0.95391f * background.Width, background.GetMinY() + 0.55894f * background.Height)); bezierPath.ClosePath(); bezierPath.UsesEvenOddFillRule = true; this.Green.SetFill(); bezierPath.Fill(); var whitePath = UIBezierPath.FromOval(new CGRect(background.GetMinX() + NMath.Floor(background.Width * 0.09115f - 0.41f) + 0.91f, background.GetMinY() + NMath.Floor(background.Height * 0.09203f + 0.47f) + 0.03f, NMath.Floor(background.Width * 0.91052f - 0.11f) - NMath.Floor(background.Width * 0.09115f - 0.41f) - 0.3f, NMath.Floor(background.Height * 0.90967f - 0.23f) - NMath.Floor(background.Height * 0.09203f + 0.47f) + 0.7f)); this.SimpleWhite.SetFill(); whitePath.Fill(); var white2Rect = new CGRect(background.GetMinX() + NMath.Floor(background.Width * 0.08925f - 0.41f) + 0.91f, background.GetMinY() + NMath.Floor(background.Height * 0.09011f + 0.47f) + 0.03f, NMath.Floor(background.Width * 0.91052f - 0.11f) - NMath.Floor(background.Width * 0.08925f - 0.41f) - 0.3f, NMath.Floor(background.Height * 0.90967f - 0.23f) - NMath.Floor(background.Height * 0.09011f + 0.47f) + 0.7f); var white2Path = new UIBezierPath(); white2Path.AddArc(new CGPoint(0.0f, 0.0f), white2Rect.Width / 2.0f, (nfloat)(-expression * NMath.PI/180), (nfloat)(-expression2 * NMath.PI/180.0f), true); white2Path.AddLineTo(new CGPoint(0.0f, 0.0f)); white2Path.ClosePath(); var white2Transform = CGAffineTransform.MakeScale(1.0f, white2Rect.Height / white2Rect.Width); white2Transform.Translate(white2Rect.GetMidX(), white2Rect.GetMidY()); white2Path.ApplyTransform(white2Transform); this.Green.SetFill(); white2Path.Fill(); var greenFillerPath = UIBezierPath.FromOval(new CGRect(background.GetMinX() + NMath.Floor(background.Width * 0.09686f - 0.41f) + 0.91f, background.GetMinY() + NMath.Floor(background.Height * 0.09780f - 0.23f) + 0.73f, NMath.Floor(background.Width * 0.90348f - 0.41f) - NMath.Floor(background.Width * 0.09686f - 0.41f), NMath.Floor(background.Height * 0.90257f - 0.23f) - NMath.Floor(background.Height * 0.09780f - 0.23f))); this.Green.SetFill(); greenFillerPath.Fill(); } { var ovalPath = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.07499f + 0.4f) + 0.1f, beer.GetMinY() + NMath.Floor(beer.Height * 0.06273f + 0.45f) + 0.05f, NMath.Floor(beer.Width * 0.26124f - 0.1f) - NMath.Floor(beer.Width * 0.07499f + 0.4f) + 0.5f, NMath.Floor(beer.Height * 0.20908f - 0.05f) - NMath.Floor(beer.Height * 0.06273f + 0.45f) + 0.5f)); OffWhite.SetFill(); ovalPath.Fill(); var oval2Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.00000f + 0.5f), beer.GetMinY() + NMath.Floor(beer.Height * 0.15263f + 0.1f) + 0.4f, NMath.Floor(beer.Width * 0.18624f) - NMath.Floor(beer.Width * 0.00000f + 0.5f) + 0.5f, NMath.Floor(beer.Height * 0.29899f - 0.4f) - NMath.Floor(beer.Height * 0.15263f + 0.1f) + 0.5f)); OffWhite.SetFill(); oval2Path.Fill(); var oval3Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.00000f + 0.5f), beer.GetMinY() + NMath.Floor(beer.Height * 0.24881f + 0.5f) + 0.0f, NMath.Floor(beer.Width * 0.13211f - 0.1f) - NMath.Floor(beer.Width * 0.00000f + 0.5f) + 0.6f, NMath.Floor(beer.Height * 0.35373f - 0.1f) - NMath.Floor(beer.Height * 0.24881f + 0.5f) + 0.6f)); OffWhite.SetFill(); oval3Path.Fill(); var oval4Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.00000f + 0.5f), beer.GetMinY() + NMath.Floor(beer.Height * 0.32541f - 0.35f) + 0.85f, NMath.Floor(beer.Width * 0.13211f - 0.1f) - NMath.Floor(beer.Width * 0.00000f + 0.5f) + 0.6f, NMath.Floor(beer.Height * 0.43033f + 0.05f) - NMath.Floor(beer.Height * 0.32541f - 0.35f) - 0.4f)); OffWhite.SetFill(); oval4Path.Fill(); var oval5Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.03526f + 0.4f) + 0.1f, beer.GetMinY() + NMath.Floor(beer.Height * 0.40068f + 0.45f) + 0.05f, NMath.Floor(beer.Width * 0.16737f - 0.2f) - NMath.Floor(beer.Width * 0.03526f + 0.4f) + 0.6f, NMath.Floor(beer.Height * 0.50560f - 0.15f) - NMath.Floor(beer.Height * 0.40068f + 0.45f) + 0.6f)); OffWhite.SetFill(); oval5Path.Fill(); UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new CGPoint(beer.GetMinX() + 0.71340f * beer.Width, beer.GetMinY() + 0.27402f * beer.Height)); bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.75623f * beer.Width, beer.GetMinY() + 0.31182f * beer.Height), new CGPoint(beer.GetMinX() + 0.71340f * beer.Width, beer.GetMinY() + 0.27402f * beer.Height), new CGPoint(beer.GetMinX() + 0.72564f * beer.Width, beer.GetMinY() + 0.30342f * beer.Height)); bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.91991f * beer.Width, beer.GetMinY() + 0.33162f * beer.Height), new CGPoint(beer.GetMinX() + 0.78618f * beer.Width, beer.GetMinY() + 0.32004f * beer.Height), new CGPoint(beer.GetMinX() + 0.85931f * beer.Width, beer.GetMinY() + 0.30847f * beer.Height)); bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.99028f * beer.Width, beer.GetMinY() + 0.67241f * beer.Height), new CGPoint(beer.GetMinX() + 0.97956f * beer.Width, beer.GetMinY() + 0.35442f * beer.Height), new CGPoint(beer.GetMinX() + 1.01934f * beer.Width, beer.GetMinY() + 0.58000f * beer.Height)); bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.74374f * beer.Width, beer.GetMinY() + 0.90110f * beer.Height), new CGPoint(beer.GetMinX() + 0.96121f * beer.Width, beer.GetMinY() + 0.76480f * beer.Height), new CGPoint(beer.GetMinX() + 0.71157f * beer.Width, beer.GetMinY() + 0.83870f * beer.Height)); bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.70703f * beer.Width, beer.GetMinY() + 0.67071f * beer.Height), new CGPoint(beer.GetMinX() + 0.71927f * beer.Width, beer.GetMinY() + 0.95149f * beer.Height), new CGPoint(beer.GetMinX() + 0.68742f * beer.Width, beer.GetMinY() + 0.70678f * beer.Height)); bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.86866f * beer.Width, beer.GetMinY() + 0.70181f * beer.Height), new CGPoint(beer.GetMinX() + 0.72080f * beer.Width, beer.GetMinY() + 0.74270f * beer.Height), new CGPoint(beer.GetMinX() + 0.83654f * beer.Width, beer.GetMinY() + 0.72700f * beer.Height)); bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.91685f * beer.Width, beer.GetMinY() + 0.55481f * beer.Height), new CGPoint(beer.GetMinX() + 0.90079f * beer.Width, beer.GetMinY() + 0.67660f * beer.Height), new CGPoint(beer.GetMinX() + 0.93284f * beer.Width, beer.GetMinY() + 0.65992f * beer.Height)); bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.87095f * beer.Width, beer.GetMinY() + 0.38322f * beer.Height), new CGPoint(beer.GetMinX() + 0.90085f * beer.Width, beer.GetMinY() + 0.44970f * beer.Height), new CGPoint(beer.GetMinX() + 0.90002f * beer.Width, beer.GetMinY() + 0.39521f * beer.Height)); bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.76540f * beer.Width, beer.GetMinY() + 0.38082f * beer.Height), new CGPoint(beer.GetMinX() + 0.84188f * beer.Width, beer.GetMinY() + 0.37122f * beer.Height), new CGPoint(beer.GetMinX() + 0.78988f * beer.Width, beer.GetMinY() + 0.37602f * beer.Height)); bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.70116f * beer.Width, beer.GetMinY() + 0.43331f * beer.Height), new CGPoint(beer.GetMinX() + 0.74093f * beer.Width, beer.GetMinY() + 0.38562f * beer.Height), new CGPoint(beer.GetMinX() + 0.70116f * beer.Width, beer.GetMinY() + 0.43331f * beer.Height)); bezier2Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.71340f * beer.Width, beer.GetMinY() + 0.27402f * beer.Height)); bezier2Path.ClosePath(); bezier2Path.UsesEvenOddFillRule = true; SimpleWhite.SetFill(); bezier2Path.Fill(); UIBezierPath bezier3Path = new UIBezierPath(); bezier3Path.MoveTo(new CGPoint(beer.GetMinX() + 0.08316f * beer.Width, beer.GetMinY() + 0.83800f * beer.Height)); bezier3Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.05563f * beer.Width, beer.GetMinY() + 0.95199f * beer.Height)); bezier3Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.40975f * beer.Width, beer.GetMinY() + 0.98741f * beer.Height), new CGPoint(beer.GetMinX() + 0.05563f * beer.Width, beer.GetMinY() + 0.95199f * beer.Height), new CGPoint(beer.GetMinX() + 0.10382f * beer.Width, beer.GetMinY() + 0.98741f * beer.Height)); bezier3Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.75623f * beer.Width, beer.GetMinY() + 0.95199f * beer.Height), new CGPoint(beer.GetMinX() + 0.71569f * beer.Width, beer.GetMinY() + 0.98741f * beer.Height), new CGPoint(beer.GetMinX() + 0.75623f * beer.Width, beer.GetMinY() + 0.95199f * beer.Height)); bezier3Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.73787f * beer.Width, beer.GetMinY() + 0.83800f * beer.Height)); bezier3Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.41893f * beer.Width, beer.GetMinY() + 0.86680f * beer.Height), new CGPoint(beer.GetMinX() + 0.73787f * beer.Width, beer.GetMinY() + 0.83800f * beer.Height), new CGPoint(beer.GetMinX() + 0.68510f * beer.Width, beer.GetMinY() + 0.86680f * beer.Height)); bezier3Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.08316f * beer.Width, beer.GetMinY() + 0.83800f * beer.Height), new CGPoint(beer.GetMinX() + 0.15277f * beer.Width, beer.GetMinY() + 0.86680f * beer.Height), new CGPoint(beer.GetMinX() + 0.08316f * beer.Width, beer.GetMinY() + 0.83800f * beer.Height)); bezier3Path.ClosePath(); bezier3Path.UsesEvenOddFillRule = true; SimpleWhite.SetFill(); bezier3Path.Fill(); UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new CGPoint(beer.GetMinX() + 0.08189f * beer.Width, beer.GetMinY() + 0.84290f * beer.Height)); bezier4Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.11024f * beer.Width, beer.GetMinY() + 0.26059f * beer.Height), new CGPoint(beer.GetMinX() + 0.08189f * beer.Width, beer.GetMinY() + 0.84290f * beer.Height), new CGPoint(beer.GetMinX() + 0.11789f * beer.Width, beer.GetMinY() + 0.37817f * beer.Height)); bezier4Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.72869f * beer.Width, beer.GetMinY() + 0.28120f * beer.Height), new CGPoint(beer.GetMinX() + 0.56915f * beer.Width, beer.GetMinY() + 0.27150f * beer.Height), new CGPoint(beer.GetMinX() + 0.72869f * beer.Width, beer.GetMinY() + 0.28120f * beer.Height)); bezier4Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.71951f * beer.Width, beer.GetMinY() + 0.56362f * beer.Height), new CGPoint(beer.GetMinX() + 0.72869f * beer.Width, beer.GetMinY() + 0.28120f * beer.Height), new CGPoint(beer.GetMinX() + 0.71951f * beer.Width, beer.GetMinY() + 0.43635f * beer.Height)); bezier4Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.73787f * beer.Width, beer.GetMinY() + 0.83756f * beer.Height), new CGPoint(beer.GetMinX() + 0.71951f * beer.Width, beer.GetMinY() + 0.69090f * beer.Height), new CGPoint(beer.GetMinX() + 0.73787f * beer.Width, beer.GetMinY() + 0.83756f * beer.Height)); bezier4Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.40593f * beer.Width, beer.GetMinY() + 0.88119f * beer.Height), new CGPoint(beer.GetMinX() + 0.73787f * beer.Width, beer.GetMinY() + 0.83756f * beer.Height), new CGPoint(beer.GetMinX() + 0.63538f * beer.Width, beer.GetMinY() + 0.88726f * beer.Height)); bezier4Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.08189f * beer.Width, beer.GetMinY() + 0.84290f * beer.Height), new CGPoint(beer.GetMinX() + 0.17648f * beer.Width, beer.GetMinY() + 0.87513f * beer.Height), new CGPoint(beer.GetMinX() + 0.08189f * beer.Width, beer.GetMinY() + 0.84290f * beer.Height)); bezier4Path.ClosePath(); bezier4Path.UsesEvenOddFillRule = true; fillColor4.SetFill(); bezier4Path.Fill(); UIBezierPath bezier5Path = new UIBezierPath(); bezier5Path.MoveTo(new CGPoint(beer.GetMinX() + 0.72835f * beer.Width, beer.GetMinY() + 0.29331f * beer.Height)); bezier5Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.72835f * beer.Width, beer.GetMinY() + 0.19362f * beer.Height)); bezier5Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.11621f * beer.Width, beer.GetMinY() + 0.19110f * beer.Height)); bezier5Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.11073f * beer.Width, beer.GetMinY() + 0.28260f * beer.Height)); bezier5Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.72835f * beer.Width, beer.GetMinY() + 0.29331f * beer.Height)); bezier5Path.ClosePath(); bezier5Path.UsesEvenOddFillRule = true; SimpleWhite.SetFill(); bezier5Path.Fill(); UIBezierPath bezier6Path = new UIBezierPath(); bezier6Path.MoveTo(new CGPoint(beer.GetMinX() + 0.07471f * beer.Width, beer.GetMinY() + 0.94603f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.40975f * beer.Width, beer.GetMinY() + 0.97479f * beer.Height), new CGPoint(beer.GetMinX() + 0.09876f * beer.Width, beer.GetMinY() + 0.95447f * beer.Height), new CGPoint(beer.GetMinX() + 0.18051f * beer.Width, beer.GetMinY() + 0.97479f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.73863f * beer.Width, beer.GetMinY() + 0.94607f * beer.Height), new CGPoint(beer.GetMinX() + 0.64454f * beer.Width, beer.GetMinY() + 0.97479f * beer.Height), new CGPoint(beer.GetMinX() + 0.71869f * beer.Width, beer.GetMinY() + 0.95411f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.72181f * beer.Width, beer.GetMinY() + 0.83863f * beer.Height), new CGPoint(beer.GetMinX() + 0.73399f * beer.Width, beer.GetMinY() + 0.92454f * beer.Height), new CGPoint(beer.GetMinX() + 0.72199f * beer.Width, beer.GetMinY() + 0.86626f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.70346f * beer.Width, beer.GetMinY() + 0.56681f * beer.Height), new CGPoint(beer.GetMinX() + 0.72051f * beer.Width, beer.GetMinY() + 0.82816f * beer.Height), new CGPoint(beer.GetMinX() + 0.70346f * beer.Width, beer.GetMinY() + 0.68784f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.70999f * beer.Width, beer.GetMinY() + 0.21141f * beer.Height), new CGPoint(beer.GetMinX() + 0.70346f * beer.Width, beer.GetMinY() + 0.45862f * beer.Height), new CGPoint(beer.GetMinX() + 0.70858f * beer.Width, beer.GetMinY() + 0.26290f * beer.Height)); bezier6Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.13157f * beer.Width, beer.GetMinY() + 0.20390f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.09795f * beer.Width, beer.GetMinY() + 0.84329f * beer.Height), new CGPoint(beer.GetMinX() + 0.12671f * beer.Width, beer.GetMinY() + 0.29022f * beer.Height), new CGPoint(beer.GetMinX() + 0.09795f * beer.Width, beer.GetMinY() + 0.80316f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.07471f * beer.Width, beer.GetMinY() + 0.94603f * beer.Height), new CGPoint(beer.GetMinX() + 0.09795f * beer.Width, beer.GetMinY() + 0.87907f * beer.Height), new CGPoint(beer.GetMinX() + 0.08216f * beer.Width, beer.GetMinY() + 0.92590f * beer.Height)); bezier6Path.ClosePath(); bezier6Path.MoveTo(new CGPoint(beer.GetMinX() + 0.40975f * beer.Width, beer.GetMinY() + 1.00000f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.04465f * beer.Width, beer.GetMinY() + 0.96119f * beer.Height), new CGPoint(beer.GetMinX() + 0.10624f * beer.Width, beer.GetMinY() + 1.00000f * beer.Height), new CGPoint(beer.GetMinX() + 0.05006f * beer.Width, beer.GetMinY() + 0.96517f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.04033f * beer.Width, beer.GetMinY() + 0.94815f * beer.Height), new CGPoint(beer.GetMinX() + 0.04013f * beer.Width, beer.GetMinY() + 0.95786f * beer.Height), new CGPoint(beer.GetMinX() + 0.03844f * beer.Width, beer.GetMinY() + 0.95279f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.06583f * beer.Width, beer.GetMinY() + 0.84329f * beer.Height), new CGPoint(beer.GetMinX() + 0.04059f * beer.Width, beer.GetMinY() + 0.94752f * beer.Height), new CGPoint(beer.GetMinX() + 0.06583f * beer.Width, beer.GetMinY() + 0.88517f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.10017f * beer.Width, beer.GetMinY() + 0.19054f * beer.Height), new CGPoint(beer.GetMinX() + 0.06583f * beer.Width, beer.GetMinY() + 0.79913f * beer.Height), new CGPoint(beer.GetMinX() + 0.09876f * beer.Width, beer.GetMinY() + 0.21537f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.11648f * beer.Width, beer.GetMinY() + 0.17850f * beer.Height), new CGPoint(beer.GetMinX() + 0.10055f * beer.Width, beer.GetMinY() + 0.18373f * beer.Height), new CGPoint(beer.GetMinX() + 0.10770f * beer.Width, beer.GetMinY() + 0.17845f * beer.Height)); bezier6Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.72667f * beer.Width, beer.GetMinY() + 0.18643f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.73798f * beer.Width, beer.GetMinY() + 0.19029f * beer.Height), new CGPoint(beer.GetMinX() + 0.73094f * beer.Width, beer.GetMinY() + 0.18648f * beer.Height), new CGPoint(beer.GetMinX() + 0.73501f * beer.Width, beer.GetMinY() + 0.18787f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.74246f * beer.Width, beer.GetMinY() + 0.19931f * beer.Height), new CGPoint(beer.GetMinX() + 0.74094f * beer.Width, beer.GetMinY() + 0.19271f * beer.Height), new CGPoint(beer.GetMinX() + 0.74255f * beer.Width, beer.GetMinY() + 0.19595f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.73559f * beer.Width, beer.GetMinY() + 0.56681f * beer.Height), new CGPoint(beer.GetMinX() + 0.74239f * beer.Width, beer.GetMinY() + 0.20172f * beer.Height), new CGPoint(beer.GetMinX() + 0.73559f * beer.Width, beer.GetMinY() + 0.44240f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.75155f * beer.Width, beer.GetMinY() + 0.81696f * beer.Height), new CGPoint(beer.GetMinX() + 0.73559f * beer.Width, beer.GetMinY() + 0.66362f * beer.Height), new CGPoint(beer.GetMinX() + 0.74661f * beer.Width, beer.GetMinY() + 0.77302f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.75393f * beer.Width, beer.GetMinY() + 0.82358f * beer.Height), new CGPoint(beer.GetMinX() + 0.75305f * beer.Width, beer.GetMinY() + 0.81888f * beer.Height), new CGPoint(beer.GetMinX() + 0.75393f * beer.Width, beer.GetMinY() + 0.82115f * beer.Height)); bezier6Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.75393f * beer.Width, beer.GetMinY() + 0.83800f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.77205f * beer.Width, beer.GetMinY() + 0.94980f * beer.Height), new CGPoint(beer.GetMinX() + 0.75393f * beer.Width, beer.GetMinY() + 0.86897f * beer.Height), new CGPoint(beer.GetMinX() + 0.77186f * beer.Width, beer.GetMinY() + 0.94900f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.76818f * beer.Width, beer.GetMinY() + 0.96041f * beer.Height), new CGPoint(beer.GetMinX() + 0.77291f * beer.Width, beer.GetMinY() + 0.95363f * beer.Height), new CGPoint(beer.GetMinX() + 0.77148f * beer.Width, beer.GetMinY() + 0.95754f * beer.Height)); bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.40975f * beer.Width, beer.GetMinY() + 1.00000f * beer.Height), new CGPoint(beer.GetMinX() + 0.76061f * beer.Width, beer.GetMinY() + 0.96702f * beer.Height), new CGPoint(beer.GetMinX() + 0.70776f * beer.Width, beer.GetMinY() + 1.00000f * beer.Height)); bezier6Path.ClosePath(); bezier6Path.UsesEvenOddFillRule = true; SimpleWhite.SetFill(); bezier6Path.Fill(); UIBezierPath bezier7Path = new UIBezierPath(); bezier7Path.MoveTo(new CGPoint(beer.GetMinX() + 0.70988f * beer.Width, beer.GetMinY() + 0.21792f * beer.Height)); bezier7Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.13068f * beer.Width, beer.GetMinY() + 0.21792f * beer.Height)); bezier7Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.13068f * beer.Width, beer.GetMinY() + 0.16404f * beer.Height)); bezier7Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.70988f * beer.Width, beer.GetMinY() + 0.17446f * beer.Height)); bezier7Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.70988f * beer.Width, beer.GetMinY() + 0.21792f * beer.Height)); bezier7Path.ClosePath(); bezier7Path.UsesEvenOddFillRule = true; SimpleWhite.SetFill(); bezier7Path.Fill(); var oval6Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.42910f + 0.1f) + 0.4f, beer.GetMinY() + NMath.Floor(beer.Height * 0.65196f - 0.45f) + 0.95f, NMath.Floor(beer.Width * 0.48175f + 0.5f) - NMath.Floor(beer.Width * 0.42910f + 0.1f) - 0.4f, NMath.Floor(beer.Height * 0.69226f - 0.05f) - NMath.Floor(beer.Height * 0.65196f - 0.45f) - 0.4f)); fillColor9.SetFill(); oval6Path.Fill(); var oval7Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.34542f - 0.05f) + 0.55f, beer.GetMinY() + NMath.Floor(beer.Height * 0.55521f - 0.3f) + 0.8f, NMath.Floor(beer.Width * 0.42091f - 0.25f) - NMath.Floor(beer.Width * 0.34542f - 0.05f) + 0.2f, NMath.Floor(beer.Height * 0.61300f + 0.5f) - NMath.Floor(beer.Height * 0.55521f - 0.3f) - 0.8f)); fillColor9.SetFill(); oval7Path.Fill(); var oval8Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.14651f) + 0.5f, beer.GetMinY() + NMath.Floor(beer.Height * 0.76810f - 0.4f) + 0.9f, NMath.Floor(beer.Width * 0.23144f - 0.1f) - NMath.Floor(beer.Width * 0.14651f) + 0.1f, NMath.Floor(beer.Height * 0.83311f + 0.5f) - NMath.Floor(beer.Height * 0.76810f - 0.4f) - 0.9f)); fillColor9.SetFill(); oval8Path.Fill(); var oval9Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.61162f + 0.35f) + 0.15f, beer.GetMinY() + NMath.Floor(beer.Height * 0.74700f + 0.05f) + 0.45f, NMath.Floor(beer.Width * 0.66725f + 0.15f) - NMath.Floor(beer.Width * 0.61162f + 0.35f) + 0.2f, NMath.Floor(beer.Height * 0.78920f - 0.05f) - NMath.Floor(beer.Height * 0.74700f + 0.05f) + 0.1f)); fillColor9.SetFill(); oval9Path.Fill(); var oval10Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.56891f - 0.05f) + 0.55f, beer.GetMinY() + NMath.Floor(beer.Height * 0.62250f + 0.2f) + 0.3f, NMath.Floor(beer.Width * 0.63348f - 0.05f) - NMath.Floor(beer.Width * 0.56891f - 0.05f), NMath.Floor(beer.Height * 0.67192f + 0.2f) - NMath.Floor(beer.Height * 0.62250f + 0.2f))); fillColor9.SetFill(); oval10Path.Fill(); var oval11Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.34393f + 0.25f) + 0.25f, beer.GetMinY() + NMath.Floor(beer.Height * 0.75631f + 0.2f) + 0.3f, NMath.Floor(beer.Width * 0.42240f + 0.45f) - NMath.Floor(beer.Width * 0.34393f + 0.25f) - 0.2f, NMath.Floor(beer.Height * 0.81638f + 0.4f) - NMath.Floor(beer.Height * 0.75631f + 0.2f) - 0.2f)); fillColor9.SetFill(); oval11Path.Fill(); var oval12Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.61162f + 0.35f) + 0.15f, beer.GetMinY() + NMath.Floor(beer.Height * 0.43661f + 0.5f) + 0.0f, NMath.Floor(beer.Width * 0.64242f + 0.15f) - NMath.Floor(beer.Width * 0.61162f + 0.35f) + 0.2f, NMath.Floor(beer.Height * 0.46018f + 0.3f) - NMath.Floor(beer.Height * 0.43661f + 0.5f) + 0.2f)); fillColor9.SetFill(); oval12Path.Fill(); var oval13Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.22821f - 0.45f) + 0.95f, beer.GetMinY() + NMath.Floor(beer.Height * 0.42482f + 0.4f) + 0.1f, NMath.Floor(beer.Width * 0.25900f + 0.35f) - NMath.Floor(beer.Width * 0.22821f - 0.45f) - 0.8f, NMath.Floor(beer.Height * 0.44839f + 0.2f) - NMath.Floor(beer.Height * 0.42482f + 0.4f) + 0.2f)); fillColor9.SetFill(); oval13Path.Fill(); var oval14Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.43705f + 0.5f), beer.GetMinY() + NMath.Floor(beer.Height * 0.44820f - 0.45f) + 0.95f, NMath.Floor(beer.Width * 0.46784f + 0.3f) - NMath.Floor(beer.Width * 0.43705f + 0.5f) + 0.2f, NMath.Floor(beer.Height * 0.47177f + 0.35f) - NMath.Floor(beer.Height * 0.44820f - 0.45f) - 0.8f)); fillColor9.SetFill(); oval14Path.Fill(); var oval15Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.15818f - 0.35f) + 0.85f, beer.GetMinY() + NMath.Floor(beer.Height * 0.50940f - 0.35f) + 0.85f, NMath.Floor(beer.Width * 0.18897f + 0.45f) - NMath.Floor(beer.Width * 0.15818f - 0.35f) - 0.8f, NMath.Floor(beer.Height * 0.53297f + 0.45f) - NMath.Floor(beer.Height * 0.50940f - 0.35f) - 0.8f)); fillColor9.SetFill(); oval15Path.Fill(); var oval16Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.52794f + 0.2f) + 0.3f, beer.GetMinY() + NMath.Floor(beer.Height * 0.52803f - 0.45f) + 0.95f, NMath.Floor(beer.Width * 0.55873f) - NMath.Floor(beer.Width * 0.52794f + 0.2f) + 0.2f, NMath.Floor(beer.Height * 0.55160f + 0.35f) - NMath.Floor(beer.Height * 0.52803f - 0.45f) - 0.8f)); fillColor9.SetFill(); oval16Path.Fill(); var oval17Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.25875f + 0.4f) + 0.1f, beer.GetMinY() + NMath.Floor(beer.Height * 0.69207f - 0.3f) + 0.8f, NMath.Floor(beer.Width * 0.28955f + 0.2f) - NMath.Floor(beer.Width * 0.25875f + 0.4f) + 0.2f, NMath.Floor(beer.Height * 0.71564f + 0.5f) - NMath.Floor(beer.Height * 0.69207f - 0.3f) - 0.8f)); fillColor9.SetFill(); oval17Path.Fill(); var oval18Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.50013f - 0.2f) + 0.7f, beer.GetMinY() + NMath.Floor(beer.Height * 0.81638f - 0.1f) + 0.6f, NMath.Floor(beer.Width * 0.54333f + 0.1f) - NMath.Floor(beer.Width * 0.50013f - 0.2f) - 0.3f, NMath.Floor(beer.Height * 0.84945f + 0.2f) - NMath.Floor(beer.Height * 0.81638f - 0.1f) - 0.3f)); fillColor9.SetFill(); oval18Path.Fill(); var oval19Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.20512f + 0.2f) + 0.3f, beer.GetMinY() + NMath.Floor(beer.Height * 0.55863f - 0.0f) + 0.5f, NMath.Floor(beer.Width * 0.25776f - 0.4f) - NMath.Floor(beer.Width * 0.20512f + 0.2f) + 0.6f, NMath.Floor(beer.Height * 0.59893f + 0.4f) - NMath.Floor(beer.Height * 0.55863f - 0.0f) - 0.4f)); fillColor9.SetFill(); oval19Path.Fill(); var oval20Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.55004f - 0.25f) + 0.75f, beer.GetMinY() + NMath.Floor(beer.Height * 0.07318f + 0.2f) + 0.3f, NMath.Floor(beer.Width * 0.73628f + 0.25f) - NMath.Floor(beer.Width * 0.55004f - 0.25f) - 0.5f, NMath.Floor(beer.Height * 0.21954f - 0.3f) - NMath.Floor(beer.Height * 0.07318f + 0.2f) + 0.5f)); OffWhite.SetFill(); oval20Path.Fill(); var oval21Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.52148f + 0.5f), beer.GetMinY() + NMath.Floor(beer.Height * 0.11272f - 0.4f) + 0.9f, NMath.Floor(beer.Width * 0.70772f) - NMath.Floor(beer.Width * 0.52148f + 0.5f) + 0.5f, NMath.Floor(beer.Height * 0.25907f + 0.1f) - NMath.Floor(beer.Height * 0.11272f - 0.4f) - 0.5f)); OffWhite.SetFill(); oval21Path.Fill(); var oval22Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.45568f - 0.25f) + 0.75f, beer.GetMinY() + NMath.Floor(beer.Height * 0.01673f + 0.35f) + 0.15f, NMath.Floor(beer.Width * 0.64192f + 0.25f) - NMath.Floor(beer.Width * 0.45568f - 0.25f) - 0.5f, NMath.Floor(beer.Height * 0.16309f - 0.15f) - NMath.Floor(beer.Height * 0.01673f + 0.35f) + 0.5f)); OffWhite.SetFill(); oval22Path.Fill(); var oval23Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.30097f - 0.1f) + 0.6f, beer.GetMinY() + NMath.Floor(beer.Height * 0.00000f - 0.05f) + 0.55f, NMath.Floor(beer.Width * 0.48721f + 0.4f) - NMath.Floor(beer.Width * 0.30097f - 0.1f) - 0.5f, NMath.Floor(beer.Height * 0.14636f + 0.45f) - NMath.Floor(beer.Height * 0.00000f - 0.05f) - 0.5f)); OffWhite.SetFill(); oval23Path.Fill(); var oval24Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.15843f - 0.4f) + 0.9f, beer.GetMinY() + NMath.Floor(beer.Height * 0.01178f + 0.05f) + 0.45f, NMath.Floor(beer.Width * 0.34467f + 0.1f) - NMath.Floor(beer.Width * 0.15843f - 0.4f) - 0.5f, NMath.Floor(beer.Height * 0.15814f - 0.45f) - NMath.Floor(beer.Height * 0.01178f + 0.05f) + 0.5f)); OffWhite.SetFill(); oval24Path.Fill(); var oval25Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.23169f - 0.15f) + 0.65f, beer.GetMinY() + NMath.Floor(beer.Height * 0.14199f + 0.3f) + 0.2f, NMath.Floor(beer.Width * 0.41793f + 0.35f) - NMath.Floor(beer.Width * 0.23169f - 0.15f) - 0.5f, NMath.Floor(beer.Height * 0.28835f - 0.2f) - NMath.Floor(beer.Height * 0.14199f + 0.3f) + 0.5f)); OffWhite.SetFill(); oval25Path.Fill(); var oval26Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.25329f + 0.5f), beer.GetMinY() + NMath.Floor(beer.Height * 0.09504f - 0.05f) + 0.55f, NMath.Floor(beer.Width * 0.43953f) - NMath.Floor(beer.Width * 0.25329f + 0.5f) + 0.5f, NMath.Floor(beer.Height * 0.24140f + 0.45f) - NMath.Floor(beer.Height * 0.09504f - 0.05f) - 0.5f)); OffWhite.SetFill(); oval26Path.Fill(); var oval27Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.12218f - 0.1f) + 0.6f, beer.GetMinY() + NMath.Floor(beer.Height * 0.09504f - 0.05f) + 0.55f, NMath.Floor(beer.Width * 0.30842f + 0.4f) - NMath.Floor(beer.Width * 0.12218f - 0.1f) - 0.5f, NMath.Floor(beer.Height * 0.24140f + 0.45f) - NMath.Floor(beer.Height * 0.09504f - 0.05f) - 0.5f)); OffWhite.SetFill(); oval27Path.Fill(); var oval28Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.36702f - 0.4f) + 0.9f, beer.GetMinY() + NMath.Floor(beer.Height * 0.10910f - 0.35f) + 0.85f, NMath.Floor(beer.Width * 0.55327f + 0.1f) - NMath.Floor(beer.Width * 0.36702f - 0.4f) - 0.5f, NMath.Floor(beer.Height * 0.25546f + 0.15f) - NMath.Floor(beer.Height * 0.10910f - 0.35f) - 0.5f)); OffWhite.SetFill(); oval28Path.Fill(); } }
public override void 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 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(); } }