public override void Draw(RectangleF frame) { return; //// General Declarations var colorSpace = CGColorSpace.CreateDeviceRGB(); var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor gradientColor = UIColor.FromRGBA(0.462f, 0.838f, 1.000f, 1.000f); UIColor blueBorder = UIColor.FromRGBA(0.000f, 0.590f, 1.000f, 1.000f); //// Gradient Declarations var gradientColors = new CGColor [] { UIColor.White.CGColor, UIColor.FromRGBA(0.748f, 0.920f, 1.000f, 1.000f).CGColor, gradientColor.CGColor }; var gradientLocations = new float [] { 0, 0.71f, 1 }; var gradient = new CGGradient(colorSpace, gradientColors, gradientLocations); //// Frames //// Abstracted Attributes var textContent = _controller.Title; //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(frame.GetMinX() + 0.99530f * frame.Width, frame.GetMinY() + 0.27632f * frame.Height)); bezierPath.AddLineTo(new PointF(frame.GetMinX() + 0.99530f * frame.Width, frame.GetMinY() + 0.32895f * frame.Height)); bezierPath.AddLineTo(new PointF(frame.GetMinX() + 0.99530f * frame.Width, frame.GetMinY() + 0.96053f * frame.Height)); bezierPath.AddLineTo(new PointF(frame.GetMinX() + 0.00352f * frame.Width, frame.GetMinY() + 0.96053f * frame.Height)); bezierPath.AddLineTo(new PointF(frame.GetMinX() + 0.00352f * frame.Width, frame.GetMinY() + 0.38158f * frame.Height)); bezierPath.AddLineTo(new PointF(frame.GetMinX() + 0.00352f * frame.Width, frame.GetMinY() + 0.27632f * frame.Height)); bezierPath.AddCurveToPoint(new PointF(frame.GetMinX() + 0.07487f * frame.Width, frame.GetMinY() + 0.01316f * frame.Height), new PointF(frame.GetMinX() + 0.00352f * frame.Width, frame.GetMinY() + 0.13098f * frame.Height), new PointF(frame.GetMinX() + 0.03547f * frame.Width, frame.GetMinY() + 0.01316f * frame.Height)); bezierPath.AddLineTo(new PointF(frame.GetMinX() + 0.92395f * frame.Width, frame.GetMinY() + 0.01316f * frame.Height)); bezierPath.AddCurveToPoint(new PointF(frame.GetMinX() + 0.99530f * frame.Width, frame.GetMinY() + 0.27632f * frame.Height), new PointF(frame.GetMinX() + 0.96335f * frame.Width, frame.GetMinY() + 0.01316f * frame.Height), new PointF(frame.GetMinX() + 0.99530f * frame.Width, frame.GetMinY() + 0.13098f * frame.Height)); bezierPath.ClosePath(); context.SaveState(); bezierPath.AddClip(); var bezierBounds = bezierPath.Bounds; context.DrawLinearGradient(gradient, new PointF(bezierBounds.GetMidX(), bezierBounds.GetMinY()), new PointF(bezierBounds.GetMidX(), bezierBounds.GetMaxY()), 0); context.RestoreState(); blueBorder.SetStroke(); bezierPath.LineWidth = 1; bezierPath.Stroke(); //// Text Drawing var textRect = new RectangleF(frame.GetMinX() + (float)Math.Floor(frame.Width * 0.02410f + 0.5f), frame.GetMinY() + (float)Math.Floor(frame.Height * 0.25000f + 0.5f), (float)Math.Floor(frame.Width * 0.94578f + 0.5f) - (float)Math.Floor(frame.Width * 0.02410f + 0.5f), (float)Math.Floor(frame.Height * 0.91667f + 0.5f) - (float)Math.Floor(frame.Height * 0.25000f + 0.5f)); UIColor.Black.SetFill(); new NSString(textContent).DrawString(textRect, UIFont.FromName("Helvetica", 12), UILineBreakMode.WordWrap, UITextAlignment.Center); }
public Stream GetArcPartFromSquareImage(Stream ms, int partNumber, int nbParts) { Stream result = null; int diameter = 0; using (UIImage image = UIImage.LoadFromData(NSData.FromStream(ms))) { diameter = (int)image.Size.Width; } float arcAngle = 360 / nbParts; float arcStart = 90 + (partNumber - 1) * arcAngle; if (nbParts > 2) { arcStart += (180 / nbParts); } float x = (float)(diameter / 2 - ((diameter * Math.Cos(DegreeToRadian(arcStart + arcAngle / 2)) + diameter) / 2)) / 2; float y = (float)(diameter / 2 - ((diameter * Math.Sin(DegreeToRadian(arcStart + arcAngle / 2)) + diameter) / 2)) / 2; float startX = (float)((diameter * Math.Cos(DegreeToRadian(arcStart)) + diameter) / 2); float startY = (float)((diameter * Math.Sin(DegreeToRadian(arcStart)) + diameter) / 2); ms.Seek(0, SeekOrigin.Begin); Stream moved = GetTranslated(ms, -x, y); using (UIImage temp = UIImage.LoadFromData(NSData.FromStream(moved))) { UIGraphics.BeginImageContext(new SizeF(temp.CGImage.Width, temp.CGImage.Height)); using (UIBezierPath path = new UIBezierPath()) { path.MoveTo(new CGPoint(diameter / 2, diameter / 2)); path.AddLineTo(new CGPoint(startX, startY)); path.AddArc(new CGPoint(diameter / 2, diameter / 2), diameter / 2, DegreeToRadian(arcStart), DegreeToRadian(arcStart + arcAngle), true); path.AddLineTo(new CGPoint(diameter / 2, diameter / 2)); path.AddClip(); temp.Draw(new Rectangle(0, 0, (int)temp.CGImage.Width, (int)temp.CGImage.Height)); var resultImage = UIGraphics.GetImageFromCurrentImageContext(); UIGraphics.EndImageContext(); NSData data = resultImage.AsPNG(); result = data.AsStream(); } } return(result); }
void DrawBackground(CGRect rect, CGContext context, CGColor color, UIBezierPath roundedRectanglePath) { context.SaveState(); context.BeginTransparencyLayer(null); if (roundedRectanglePath != null) { roundedRectanglePath.AddClip(); } context.SetFillColor(color); context.FillRect(rect); context.EndTransparencyLayer(); context.RestoreState(); }
public UIImage getThumbnailFromImage(UIImage image) // Return void for Archiving method of saving { CGSize origImageSize = image.Size; // The Rectangle of the thumbnail CGRect newRect = new CGRect(0, 0, 40, 40); // Figure out a scaling ration to make sure we maintain the same aspect ratio nfloat ratio = (nfloat)Math.Max(newRect.Size.Width / origImageSize.Width, newRect.Size.Height / origImageSize.Height); // Create a transparent bitmap context with a scaling factor equal to that of the screen UIGraphics.BeginImageContextWithOptions(newRect.Size, false, 0.0f); // Create a path that is a rounded rectangle UIBezierPath path = UIBezierPath.FromRoundedRect(newRect, 5.0f); // Make all subsequent drawing clip to this rounded rectangle path.AddClip(); // Center the image in the thumbnail rectangle CGRect projectRect = new CGRect(); projectRect.Width = ratio * origImageSize.Width; projectRect.Height = ratio * origImageSize.Height; projectRect.X = (newRect.Size.Width - projectRect.Size.Width) / 2.0f; projectRect.Y = (newRect.Size.Height - projectRect.Size.Height) / 2.0f; // Draw the image to the context image.Draw(projectRect); // Get the image from the image context, keep it as our thumbnail UIImage smallImage = UIGraphics.GetImageFromCurrentImageContext(); // thumbnail = smallImage; // Archiving method of saving // // Get the PNG representation of the image and set it as our archivable data // Archiving method of saving // NSData data = smallImage.AsPNG(); // Archiving method of saving // thumbnailData = data; // Archiving method of saving // Clean up image context resources, we're done UIGraphics.EndImageContext(); // return thumbnail image // Archiving method of saving return(smallImage); // remove for Archiving method of saving }
public static UIImage ImageWithColor(UIColor imageColor, float cornerRadius) { float minEdgeSize = EdgeSizeFromCornerRadius(cornerRadius); RectangleF rect = new RectangleF(0, 0, minEdgeSize, minEdgeSize); UIBezierPath roundedRect = UIBezierPath.FromRoundedRect(rect, cornerRadius); roundedRect.LineWidth = 0; UIGraphics.BeginImageContextWithOptions(rect.Size, false, 0.0f); imageColor.SetFill(); roundedRect.Fill(); roundedRect.Stroke(); roundedRect.AddClip(); UIImage image = UIGraphics.GetImageFromCurrentImageContext(); UIGraphics.EndImageContext(); return(image.CreateResizableImage(new UIEdgeInsets(cornerRadius, cornerRadius, cornerRadius, cornerRadius))); }
void DrawCrayon(CGContext context, Crayon crayon) { // I <3 Paintcode //// Color Declarations var gradientColor = UIColor.FromRGBA(crayon.R / 255f, crayon.G / 255f, crayon.B / 255f, 1.00f); var gradientColor2 = UIColor.FromRGBA(crayon.R / 255f, crayon.G / 255f, crayon.B / 255f, 0.69f); var gradientColor3 = UIColor.FromRGBA(crayon.R / 255f, crayon.G / 255f, crayon.B / 255f, 0.37f); //// Gradient Declarations var gradientColors = new CGColor [] { gradientColor.CGColor, gradientColor2.CGColor, gradientColor3.CGColor, gradientColor2.CGColor, gradientColor.CGColor }; var gradientLocations = new float [] { 0, 0.37f, 0.66f, 1, 1 }; var gradient = new CGGradient(colorSpace, gradientColors, gradientLocations); //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRoundedRect(new RectangleF(0.5f, 20.5f, 25, 100), UIRectCorner.TopLeft | UIRectCorner.TopRight, new SizeF(8, 8)); context.SaveState(); rectanglePath.AddClip(); context.DrawLinearGradient(gradient, new PointF(0.5f, 70.5f), new PointF(25.5f, 70.5f), 0); context.RestoreState(); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(3.5f, 24.5f)); bezierPath.AddCurveToPoint(new PointF(12, 0.09f), new PointF(6.5f, 17.57f), new PointF(9.79f, -4.27f)); bezierPath.AddCurveToPoint(new PointF(22.5f, 24.5f), new PointF(16.3f, 8.57f), new PointF(22.5f, 24.5f)); context.SaveState(); bezierPath.AddClip(); context.DrawLinearGradient(gradient, new PointF(3.5f, 12.01f), new PointF(22.5f, 12.01f), 0); context.RestoreState(); }
public override void Draw(CGRect rect) { base.Draw(rect); using (var context = UIGraphics.GetCurrentContext()) { CGRect contentRect = rect.Inset(Element.CornerRadius, Element.CornerRadius); UIBezierPath roundedPath = UIBezierPath.FromRoundedRect(contentRect, Element.CornerRadius); context.SetFillColor(UIColor.White.CGColor); context.SetShadow(new CGSize(0, 0), Element.CornerRadius, UIColor.Black.ColorWithAlpha(0.5f).CGColor); roundedPath.Fill(); roundedPath.AddClip(); context.SetStrokeColor(UIColor.Black.ColorWithAlpha(0.6f).CGColor); context.SetBlendMode(CGBlendMode.Overlay); context.MoveTo(contentRect.GetMinX(), contentRect.GetMinY() + 0.5f); context.AddLineToPoint(contentRect.GetMinX(), contentRect.GetMinY() + 0.5f); context.StrokePath(); } }
public UIImage TouchImage() { if (touchImage == null) { UIBezierPath clipPath = UIBezierPath.FromRect(new CGRect(0, 0, 50, 50)); UIGraphics.BeginImageContextWithOptions(clipPath.Bounds.Size, false, 0); UIBezierPath drawPath = UIBezierPath.FromArc(new CGPoint(25, 25), 22, 0, 2 * (nfloat)Math.PI, true); drawPath.LineWidth = 2; strokeColor.SetStroke(); fillColor.SetFill(); drawPath.Stroke(); drawPath.Fill(); clipPath.AddClip(); touchImage = UIGraphics.GetImageFromCurrentImageContext(); UIGraphics.EndImageContext(); } return(touchImage); }
protected virtual void DrawStroke(CGContext context, UIBezierPath roundedRectanglePath) { context.SaveState(); roundedRectanglePath.LineWidth = _strokeLineWidth; var strokeLineColor = _strokeLineColor; strokeLineColor.SetStroke(); roundedRectanglePath.AddClip(); context.AddPath(roundedRectanglePath.CGPath); context.StrokePath(); context.RestoreState(); //we remove the bottom line drawn by the roundedRect bezier path to remove the doubled line effect if (FirstRowOfTwoRowsTable) { context.SaveState(); roundedRectanglePath.LineWidth = _strokeLineWidth; UIColor.White.SetStroke(); context.MoveTo(0, 40); context.AddLineToPoint(300, 40); context.StrokePath(); context.RestoreState(); } }
public override void DrawRect (RectangleF area, UIViewPrintFormatter formatter) { base.DrawRect (area, formatter); //General Declarations CGContext context = UIGraphics.GetCurrentContext (); // Color Declarations UIColor mmFill = new UIColor (0F, 0F, 0F, 0.196F); UIColor shape1DropShadowColor = new UIColor (1F, 1F, 1F, 0.4F); UIColor shape1InnerShadowColor = new UIColor (0F, 0F, 0F, 0.392F); // Shadow Declarations UIColor mmDropShadow = shape1DropShadowColor; SizeF mmDropShadowOffset = new SizeF (0.1F, 1.1F); Single mmDropShadowBlurRadius = 0; UIColor mmInnerShadow = shape1InnerShadowColor; SizeF mmInnerShadowOffset = new SizeF (0.1F, 1.1F); Single mmInnerShadowBlurRadius = 0; // Frames RectangleF frame = this.Bounds; // mmGroup { // mmShape Drawing UIBezierPath mmShapePath = new UIBezierPath (); mmShapePath.MoveTo (new PointF (frame.GetMinX () + 0.51759F * frame.Width, frame.GetMinY () + 0.96761F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.37558F * frame.Width, frame.GetMinY() + 0.91398F * frame.Height), new PointF (frame.GetMinX() + 0.46395F * frame.Width, frame.GetMinY() + 0.96761F * frame.Height), new PointF (frame.GetMinX() + 0.41351F * frame.Width, frame.GetMinY() + 0.94854F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.31759F * frame.Width, frame.GetMinY() + 0.76824F * frame.Height), new PointF (frame.GetMinX() + 0.33346F * frame.Width, frame.GetMinY() + 0.87556F * frame.Height), new PointF (frame.GetMinX() + 0.31234F * frame.Width, frame.GetMinY() + 0.82249F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.31904F * frame.Width, frame.GetMinY() + 0.75325F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.30262F * frame.Width, frame.GetMinY() + 0.75459F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.28470F * frame.Width, frame.GetMinY() + 0.75535F * frame.Height), new PointF (frame.GetMinX() + 0.29666F * frame.Width, frame.GetMinY() + 0.75510F * frame.Height), new PointF (frame.GetMinX() + 0.29065F * frame.Width, frame.GetMinY() + 0.75535F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.14274F * frame.Width, frame.GetMinY() + 0.70173F * frame.Height), new PointF (frame.GetMinX() + 0.23106F * frame.Width, frame.GetMinY() + 0.75535F * frame.Height), new PointF (frame.GetMinX() + 0.18067F * frame.Width, frame.GetMinY() + 0.73625F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.14274F * frame.Width, frame.GetMinY() + 0.44291F * frame.Height), new PointF (frame.GetMinX() + 0.06451F * frame.Width, frame.GetMinY() + 0.63038F * frame.Height), new PointF (frame.GetMinX() + 0.06451F * frame.Width, frame.GetMinY() + 0.51425F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.45528F * frame.Width, frame.GetMinY() + 0.15799F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.48085F * frame.Width, frame.GetMinY() + 0.14832F * frame.Height), new PointF (frame.GetMinX() + 0.46207F * frame.Width, frame.GetMinY() + 0.15176F * frame.Height), new PointF (frame.GetMinX() + 0.47120F * frame.Width, frame.GetMinY() + 0.14832F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.50639F * frame.Width, frame.GetMinY() + 0.15799F * frame.Height), new PointF (frame.GetMinX() + 0.49051F * frame.Width, frame.GetMinY() + 0.14832F * frame.Height), new PointF (frame.GetMinX() + 0.49957F * frame.Width, frame.GetMinY() + 0.15176F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.50639F * frame.Width, frame.GetMinY() + 0.20462F * frame.Height), new PointF (frame.GetMinX() + 0.52050F * frame.Width, frame.GetMinY() + 0.17087F * frame.Height), new PointF (frame.GetMinX() + 0.52050F * frame.Width, frame.GetMinY() + 0.19177F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.19390F * frame.Width, frame.GetMinY() + 0.48951F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.19386F * frame.Width, frame.GetMinY() + 0.65510F * frame.Height), new PointF (frame.GetMinX() + 0.14397F * frame.Width, frame.GetMinY() + 0.53518F * frame.Height), new PointF (frame.GetMinX() + 0.14397F * frame.Width, frame.GetMinY() + 0.60942F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.28476F * frame.Width, frame.GetMinY() + 0.68936F * frame.Height), new PointF (frame.GetMinX() + 0.21821F * frame.Width, frame.GetMinY() + 0.67720F * frame.Height), new PointF (frame.GetMinX() + 0.25047F * frame.Width, frame.GetMinY() + 0.68936F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.37557F * frame.Width, frame.GetMinY() + 0.65514F * frame.Height), new PointF (frame.GetMinX() + 0.31904F * frame.Width, frame.GetMinY() + 0.68936F * frame.Height), new PointF (frame.GetMinX() + 0.35128F * frame.Width, frame.GetMinY() + 0.67720F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.68812F * frame.Width, frame.GetMinY() + 0.37025F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.71365F * frame.Width, frame.GetMinY() + 0.36056F * frame.Height), new PointF (frame.GetMinX() + 0.69491F * frame.Width, frame.GetMinY() + 0.36401F * frame.Height), new PointF (frame.GetMinX() + 0.70403F * frame.Width, frame.GetMinY() + 0.36056F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.73923F * frame.Width, frame.GetMinY() + 0.37025F * frame.Height), new PointF (frame.GetMinX() + 0.72332F * frame.Width, frame.GetMinY() + 0.36056F * frame.Height), new PointF (frame.GetMinX() + 0.73241F * frame.Width, frame.GetMinY() + 0.36401F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.73923F * frame.Width, frame.GetMinY() + 0.41681F * frame.Height), new PointF (frame.GetMinX() + 0.75333F * frame.Width, frame.GetMinY() + 0.38310F * frame.Height), new PointF (frame.GetMinX() + 0.75333F * frame.Width, frame.GetMinY() + 0.40399F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.42673F * frame.Width, frame.GetMinY() + 0.70173F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.42670F * frame.Width, frame.GetMinY() + 0.86737F * frame.Height), new PointF (frame.GetMinX() + 0.37681F * frame.Width, frame.GetMinY() + 0.74744F * frame.Height), new PointF (frame.GetMinX() + 0.37681F * frame.Width, frame.GetMinY() + 0.82172F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.51759F * frame.Width, frame.GetMinY() + 0.90159F * frame.Height), new PointF (frame.GetMinX() + 0.45104F * frame.Width, frame.GetMinY() + 0.88944F * frame.Height), new PointF (frame.GetMinX() + 0.48328F * frame.Width, frame.GetMinY() + 0.90159F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.60840F * frame.Width, frame.GetMinY() + 0.86743F * frame.Height), new PointF (frame.GetMinX() + 0.55183F * frame.Width, frame.GetMinY() + 0.90159F * frame.Height), new PointF (frame.GetMinX() + 0.58413F * frame.Width, frame.GetMinY() + 0.88944F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.92092F * frame.Width, frame.GetMinY() + 0.58246F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.94646F * frame.Width, frame.GetMinY() + 0.57284F * frame.Height), new PointF (frame.GetMinX() + 0.92773F * frame.Width, frame.GetMinY() + 0.57623F * frame.Height), new PointF (frame.GetMinX() + 0.93682F * frame.Width, frame.GetMinY() + 0.57284F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.97208F * frame.Width, frame.GetMinY() + 0.58246F * frame.Height), new PointF (frame.GetMinX() + 0.95617F * frame.Width, frame.GetMinY() + 0.57284F * frame.Height), new PointF (frame.GetMinX() + 0.96523F * frame.Width, frame.GetMinY() + 0.57623F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.97208F * frame.Width, frame.GetMinY() + 0.62912F * frame.Height), new PointF (frame.GetMinX() + 0.98615F * frame.Width, frame.GetMinY() + 0.59535F * frame.Height), new PointF (frame.GetMinX() + 0.98615F * frame.Width, frame.GetMinY() + 0.61626F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.65956F * frame.Width, frame.GetMinY() + 0.91398F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.51759F * frame.Width, frame.GetMinY() + 0.96761F * frame.Height), new PointF (frame.GetMinX() + 0.62160F * frame.Width, frame.GetMinY() + 0.94854F * frame.Height), new PointF (frame.GetMinX() + 0.57117F * frame.Width, frame.GetMinY() + 0.96761F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.51759F * frame.Width, frame.GetMinY() + 0.96761F * frame.Height)); mmShapePath.ClosePath (); mmShapePath.MoveTo (new PointF (frame.GetMinX() + 0.51965F * frame.Width, frame.GetMinY() + 0.81940F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.49408F * frame.Width, frame.GetMinY() + 0.80982F * frame.Height), new PointF (frame.GetMinX() + 0.50999F * frame.Width, frame.GetMinY() + 0.81940F * frame.Height), new PointF (frame.GetMinX() + 0.50091F * frame.Width, frame.GetMinY() + 0.81600F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.49408F * frame.Width, frame.GetMinY() + 0.76313F * frame.Height), new PointF (frame.GetMinX() + 0.48000F * frame.Width, frame.GetMinY() + 0.79686F * frame.Height), new PointF (frame.GetMinX() + 0.48000F * frame.Width, frame.GetMinY() + 0.77600F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.80659F * frame.Width, frame.GetMinY() + 0.47824F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.80662F * frame.Width, frame.GetMinY() + 0.31264F * frame.Height), new PointF (frame.GetMinX() + 0.85650F * frame.Width, frame.GetMinY() + 0.43259F * frame.Height), new PointF (frame.GetMinX() + 0.85650F * frame.Width, frame.GetMinY() + 0.35831F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.71574F * frame.Width, frame.GetMinY() + 0.27840F * frame.Height), new PointF (frame.GetMinX() + 0.78226F * frame.Width, frame.GetMinY() + 0.29053F * frame.Height), new PointF (frame.GetMinX() + 0.75001F * frame.Width, frame.GetMinY() + 0.27840F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.62493F * frame.Width, frame.GetMinY() + 0.31260F * frame.Height), new PointF (frame.GetMinX() + 0.68146F * frame.Width, frame.GetMinY() + 0.27840F * frame.Height), new PointF (frame.GetMinX() + 0.64921F * frame.Width, frame.GetMinY() + 0.29053F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.31239F * frame.Width, frame.GetMinY() + 0.59752F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.28684F * frame.Width, frame.GetMinY() + 0.60718F * frame.Height), new PointF (frame.GetMinX() + 0.30556F * frame.Width, frame.GetMinY() + 0.60378F * frame.Height), new PointF (frame.GetMinX() + 0.29644F * frame.Width, frame.GetMinY() + 0.60718F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.26125F * frame.Width, frame.GetMinY() + 0.59752F * frame.Height), new PointF (frame.GetMinX() + 0.27718F * frame.Width, frame.GetMinY() + 0.60718F * frame.Height), new PointF (frame.GetMinX() + 0.26808F * frame.Width, frame.GetMinY() + 0.60378F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.26125F * frame.Width, frame.GetMinY() + 0.55093F * frame.Height), new PointF (frame.GetMinX() + 0.24715F * frame.Width, frame.GetMinY() + 0.58467F * frame.Height), new PointF (frame.GetMinX() + 0.24715F * frame.Width, frame.GetMinY() + 0.56377F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.57377F * frame.Width, frame.GetMinY() + 0.26601F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.57380F * frame.Width, frame.GetMinY() + 0.10041F * frame.Height), new PointF (frame.GetMinX() + 0.62368F * frame.Width, frame.GetMinY() + 0.22029F * frame.Height), new PointF (frame.GetMinX() + 0.62368F * frame.Width, frame.GetMinY() + 0.14606F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.48291F * frame.Width, frame.GetMinY() + 0.06617F * frame.Height), new PointF (frame.GetMinX() + 0.54946F * frame.Width, frame.GetMinY() + 0.07832F * frame.Height), new PointF (frame.GetMinX() + 0.51721F * frame.Width, frame.GetMinY() + 0.06617F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.39208F * frame.Width, frame.GetMinY() + 0.10040F * frame.Height), new PointF (frame.GetMinX() + 0.44863F * frame.Width, frame.GetMinY() + 0.06617F * frame.Height), new PointF (frame.GetMinX() + 0.41637F * frame.Width, frame.GetMinY() + 0.07832F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.07956F * frame.Width, frame.GetMinY() + 0.38530F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.05400F * frame.Width, frame.GetMinY() + 0.39496F * frame.Height), new PointF (frame.GetMinX() + 0.07274F * frame.Width, frame.GetMinY() + 0.39149F * frame.Height), new PointF (frame.GetMinX() + 0.06365F * frame.Width, frame.GetMinY() + 0.39496F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.02841F * frame.Width, frame.GetMinY() + 0.38530F * frame.Height), new PointF (frame.GetMinX() + 0.04434F * frame.Width, frame.GetMinY() + 0.39496F * frame.Height), new PointF (frame.GetMinX() + 0.03525F * frame.Width, frame.GetMinY() + 0.39149F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.02841F * frame.Width, frame.GetMinY() + 0.33867F * frame.Height), new PointF (frame.GetMinX() + 0.01434F * frame.Width, frame.GetMinY() + 0.37241F * frame.Height), new PointF (frame.GetMinX() + 0.01434F * frame.Width, frame.GetMinY() + 0.35151F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.34095F * frame.Width, frame.GetMinY() + 0.05378F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.48291F * frame.Width, frame.GetMinY() + 0.00013F * frame.Height), new PointF (frame.GetMinX() + 0.37888F * frame.Width, frame.GetMinY() + 0.01919F * frame.Height), new PointF (frame.GetMinX() + 0.42931F * frame.Width, frame.GetMinY() + 0.00013F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.62491F * frame.Width, frame.GetMinY() + 0.05378F * frame.Height), new PointF (frame.GetMinX() + 0.53657F * frame.Width, frame.GetMinY() + 0.00013F * frame.Height), new PointF (frame.GetMinX() + 0.58700F * frame.Width, frame.GetMinY() + 0.01919F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.68292F * frame.Width, frame.GetMinY() + 0.19950F * frame.Height), new PointF (frame.GetMinX() + 0.66705F * frame.Width, frame.GetMinY() + 0.09219F * frame.Height), new PointF (frame.GetMinX() + 0.68815F * frame.Width, frame.GetMinY() + 0.14529F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.68143F * frame.Width, frame.GetMinY() + 0.21454F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.69786F * frame.Width, frame.GetMinY() + 0.21318F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.71580F * frame.Width, frame.GetMinY() + 0.21244F * frame.Height), new PointF (frame.GetMinX() + 0.70379F * frame.Width, frame.GetMinY() + 0.21269F * frame.Height), new PointF (frame.GetMinX() + 0.70984F * frame.Width, frame.GetMinY() + 0.21244F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.85774F * frame.Width, frame.GetMinY() + 0.26604F * frame.Height), new PointF (frame.GetMinX() + 0.76941F * frame.Width, frame.GetMinY() + 0.21244F * frame.Height), new PointF (frame.GetMinX() + 0.81981F * frame.Width, frame.GetMinY() + 0.23147F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.85774F * frame.Width, frame.GetMinY() + 0.52485F * frame.Height), new PointF (frame.GetMinX() + 0.93599F * frame.Width, frame.GetMinY() + 0.33738F * frame.Height), new PointF (frame.GetMinX() + 0.93599F * frame.Width, frame.GetMinY() + 0.45349F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.54521F * frame.Width, frame.GetMinY() + 0.80977F * frame.Height)); mmShapePath.AddCurveToPoint ( new PointF (frame.GetMinX() + 0.51965F * frame.Width, frame.GetMinY() + 0.81940F * frame.Height), new PointF (frame.GetMinX() + 0.53840F * frame.Width, frame.GetMinY() + 0.81600F * frame.Height), new PointF (frame.GetMinX() + 0.52930F * frame.Width, frame.GetMinY() + 0.81940F * frame.Height)); mmShapePath.AddLineTo (new PointF (frame.GetMinX() + 0.51965F * frame.Width, frame.GetMinY() + 0.81940F * frame.Height)); mmShapePath.ClosePath (); context.SaveState (); context.SetShadowWithColor (mmDropShadowOffset, mmDropShadowBlurRadius, mmDropShadow.CGColor); context.SetBlendMode (CGBlendMode.Overlay); mmFill.SetFill (); mmShapePath.Fill (); RectangleF mmShapeBorderRect = RectangleF.Inflate (mmShapePath.Bounds, mmInnerShadowBlurRadius, mmInnerShadowBlurRadius); mmShapeBorderRect.Offset (mmInnerShadowOffset.Width, mmInnerShadowOffset.Height); mmShapeBorderRect.UnionWith (mmShapePath.Bounds); UIBezierPath mmShapeNegativePath = UIBezierPath.FromRect (mmShapeBorderRect); mmShapeNegativePath.AppendPath (mmShapePath); mmShapeNegativePath.UsesEvenOddFillRule = true; context.SaveState (); { Single xOffset = mmInnerShadowOffset.Width + (float) Math.Round (mmShapeBorderRect.Size.Width); Single yOffset = mmInnerShadowOffset.Height; context.SetShadowWithColor (new SizeF (xOffset + CopySign (0.1F, xOffset), yOffset + CopySign (0.1F, yOffset)), mmInnerShadowBlurRadius, mmInnerShadow.CGColor); mmShapePath.AddClip (); CGAffineTransform transform = CGAffineTransform.MakeTranslation ((float)-Math.Round (mmShapeBorderRect.Size.Width), 0F); mmShapeNegativePath.ApplyTransform (transform); UIColor.Gray.SetFill (); mmShapeNegativePath.Fill (); } context.RestoreState (); context.RestoreState (); } }
//// Drawing Methods public static void DrawSiriRemote(string pressed, string arrow) { //// General Declarations var colorSpace = CGColorSpace.CreateDeviceRGB(); var context = UIGraphics.GetCurrentContext(); //// Color Declarations var gradientColor = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); var gradientColor2 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); var gradientColor3 = UIColor.FromRGBA(0.368f, 0.368f, 0.368f, 1.000f); var gradientColor4 = UIColor.FromRGBA(0.147f, 0.147f, 0.147f, 1.000f); var strokeColor = UIColor.FromRGBA(0.521f, 0.521f, 0.521f, 1.000f); var strokeColor2 = UIColor.FromRGBA(0.264f, 0.260f, 0.260f, 1.000f); var fillColor = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); var textForeground = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); var strokeColor3 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); var fillColor2 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); var pressedColor = UIColor.FromRGBA(0.847f, 0.187f, 0.187f, 1.000f); var gradientColor5 = UIColor.FromRGBA(0.401f, 0.015f, 0.015f, 1.000f); //// Gradient Declarations var radialGradient1Colors = new CGColor [] { gradientColor.CGColor, gradientColor2.CGColor }; var radialGradient1Locations = new nfloat [] { 0.0f, 1.0f }; var radialGradient1 = new CGGradient(colorSpace, radialGradient1Colors, radialGradient1Locations); var touchGradientColors = new CGColor [] { gradientColor3.CGColor, gradientColor4.CGColor }; var touchGradientLocations = new nfloat [] { 0.0f, 1.0f }; var touchGradient = new CGGradient(colorSpace, touchGradientColors, touchGradientLocations); var pressedGradientColors = new CGColor [] { pressedColor.CGColor, gradientColor5.CGColor }; var pressedGradientLocations = new nfloat [] { 0.0f, 1.0f }; var pressedGradient = new CGGradient(colorSpace, pressedGradientColors, pressedGradientLocations); //// Variable Declarations var menuPressed = pressed == "Menu" ? pressedColor : fillColor; var homePressed = pressed == "Home" ? pressedColor : fillColor; var siriPressed = pressed == "Siri" ? pressedColor : fillColor; var volumePressed = pressed == "Volume" ? pressedColor : fillColor; var playPausePressed = pressed == "PlayPause" ? pressedColor : fillColor; var touchSurfacePressed = pressed == "Touch" ? pressedGradient : touchGradient; var upArrow = arrow == "Up" ? true : false; var downArrow = arrow == "Down" ? true : false; var leftArrow = arrow == "Left" ? true : false; var rightArrow = arrow == "Right" ? true : false; //// Page-1 { //// Intro01 { //// Siri-Remote-Render { //// Rectangle-4 Drawing var rectangle4Path = UIBezierPath.FromRoundedRect(new CGRect(1.0f, 0.0f, 253.0f, 747.0f), 40.0f); context.SaveState(); rectangle4Path.AddClip(); context.DrawRadialGradient(radialGradient1, new CGPoint(8.62f, 234.62f), 0.0f, new CGPoint(8.62f, 234.62f), 567.36f, CGGradientDrawingOptions.DrawsBeforeStartLocation | CGGradientDrawingOptions.DrawsAfterEndLocation); context.RestoreState(); strokeColor.SetStroke(); rectangle4Path.LineWidth = 3.0f; rectangle4Path.Stroke(); //// Rectangle-4-Copy Drawing UIBezierPath rectangle4CopyPath = new UIBezierPath(); rectangle4CopyPath.MoveTo(new CGPoint(254.0f, 312.0f)); rectangle4CopyPath.AddLineTo(new CGPoint(254.0f, 40.0f)); rectangle4CopyPath.AddCurveToPoint(new CGPoint(214.0f, 0.0f), new CGPoint(254.0f, 17.91f), new CGPoint(236.09f, 0.0f)); rectangle4CopyPath.AddLineTo(new CGPoint(41.0f, 0.0f)); rectangle4CopyPath.AddCurveToPoint(new CGPoint(1.0f, 40.0f), new CGPoint(18.92f, 0.0f), new CGPoint(1.0f, 17.91f)); rectangle4CopyPath.AddLineTo(new CGPoint(1.0f, 312.0f)); rectangle4CopyPath.AddLineTo(new CGPoint(254.0f, 312.0f)); rectangle4CopyPath.ClosePath(); rectangle4CopyPath.MiterLimit = 4.0f; rectangle4CopyPath.UsesEvenOddFillRule = true; context.SaveState(); rectangle4CopyPath.AddClip(); context.DrawLinearGradient(touchSurfacePressed, new CGPoint(127.5f, 0.0f), new CGPoint(127.5f, 312.0f), CGGradientDrawingOptions.DrawsBeforeStartLocation | CGGradientDrawingOptions.DrawsAfterEndLocation); context.RestoreState(); strokeColor2.SetStroke(); rectangle4CopyPath.LineWidth = 3.0f; rectangle4CopyPath.Stroke(); //// Menu-Button { //// Oval-1 Drawing var oval1Path = UIBezierPath.FromOval(new CGRect(18.0f, 214.0f, 87.0f, 87.0f)); menuPressed.SetFill(); oval1Path.Fill(); //// Label Drawing CGRect labelRect = new CGRect(31.42f, 243.0f, 71.58f, 30.0f); textForeground.SetFill(); new NSString("MENU").DrawString(labelRect, UIFont.BoldSystemFontOfSize(20.0f), UILineBreakMode.WordWrap, UITextAlignment.Left); if (upArrow) { //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(105.5f, 74.5f)); bezierPath.AddLineTo(new CGPoint(149.5f, 74.5f)); bezierPath.AddLineTo(new CGPoint(127.5f, 44.5f)); bezierPath.AddLineTo(new CGPoint(105.5f, 74.5f)); pressedColor.SetFill(); bezierPath.Fill(); } if (downArrow) { //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new CGPoint(106.0f, 180.0f)); bezier2Path.AddLineTo(new CGPoint(150.0f, 180.0f)); bezier2Path.AddLineTo(new CGPoint(128.0f, 210.0f)); bezier2Path.AddLineTo(new CGPoint(106.0f, 180.0f)); pressedColor.SetFill(); bezier2Path.Fill(); } if (rightArrow) { //// Bezier 3 Drawing context.SaveState(); context.TranslateCTM(212.0f, 129.0f); context.RotateCTM(90.0f * NMath.PI / 180.0f); UIBezierPath bezier3Path = new UIBezierPath(); bezier3Path.MoveTo(new CGPoint(-22.0f, 15.0f)); bezier3Path.AddLineTo(new CGPoint(22.0f, 15.0f)); bezier3Path.AddLineTo(new CGPoint(0.0f, -15.0f)); bezier3Path.AddLineTo(new CGPoint(-22.0f, 15.0f)); pressedColor.SetFill(); bezier3Path.Fill(); context.RestoreState(); } if (leftArrow) { //// Bezier 4 Drawing context.SaveState(); context.TranslateCTM(38.0f, 129.0f); context.RotateCTM(-90.0f * NMath.PI / 180.0f); UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new CGPoint(-22.0f, 15.0f)); bezier4Path.AddLineTo(new CGPoint(22.0f, 15.0f)); bezier4Path.AddLineTo(new CGPoint(0.0f, -15.0f)); bezier4Path.AddLineTo(new CGPoint(-22.0f, 15.0f)); pressedColor.SetFill(); bezier4Path.Fill(); context.RestoreState(); } } //// Home-Button { //// Oval-1-Copy Drawing var oval1CopyPath = UIBezierPath.FromOval(new CGRect(147.0f, 214.0f, 87.0f, 87.0f)); homePressed.SetFill(); oval1CopyPath.Fill(); //// Rectangle-1-+-Line { //// Rectangle-1 Drawing var rectangle1Path = UIBezierPath.FromRect(new CGRect(166.0f, 239.0f, 49.0f, 32.0f)); strokeColor3.SetStroke(); rectangle1Path.LineWidth = 2.0f; rectangle1Path.Stroke(); //// Line Drawing UIBezierPath linePath = new UIBezierPath(); linePath.MoveTo(new CGPoint(174.5f, 276.0f)); linePath.AddLineTo(new CGPoint(205.56f, 276.0f)); linePath.MiterLimit = 4.0f; linePath.LineCapStyle = CGLineCap.Square; linePath.UsesEvenOddFillRule = true; strokeColor3.SetStroke(); linePath.LineWidth = 2.0f; linePath.Stroke(); } } //// Volume-Button { //// Rectangle- 6 Drawing var rectangle6Path = UIBezierPath.FromRoundedRect(new CGRect(147.0f, 321.0f, 87.0f, 197.0f), 40.0f); volumePressed.SetFill(); rectangle6Path.Fill(); //// Label 2 Drawing CGRect label2Rect = new CGRect(174.96f, 329.0f, 31.08f, 71.0f); textForeground.SetFill(); new NSString("+\n").DrawString(label2Rect, UIFont.BoldSystemFontOfSize(48.0f), UILineBreakMode.WordWrap, UITextAlignment.Left); //// Label 3 Drawing CGRect label3Rect = new CGRect(179.89f, 436.0f, 21.21f, 71.0f); textForeground.SetFill(); new NSString("-").DrawString(label3Rect, UIFont.BoldSystemFontOfSize(48.0f), UILineBreakMode.WordWrap, UITextAlignment.Left); } //// Siri-Button { //// Oval-1-Copy-2 Drawing var oval1Copy2Path = UIBezierPath.FromOval(new CGRect(18.0f, 321.0f, 87.0f, 87.0f)); siriPressed.SetFill(); oval1Copy2Path.Fill(); //// Group 11 { //// Rectangle- 10 Drawing var rectangle10Path = UIBezierPath.FromRoundedRect(new CGRect(49.52f, 338.0f, 22.55f, 38.57f), 11.27f); fillColor2.SetFill(); rectangle10Path.Fill(); //// Path-2 Drawing UIBezierPath path2Path = new UIBezierPath(); path2Path.MoveTo(new CGPoint(46.0f, 363.63f)); path2Path.AddCurveToPoint(new CGPoint(61.24f, 381.48f), new CGPoint(46.0f, 363.63f), new CGPoint(45.67f, 381.58f)); path2Path.AddCurveToPoint(new CGPoint(76.81f, 363.25f), new CGPoint(76.81f, 381.38f), new CGPoint(76.81f, 363.25f)); path2Path.MiterLimit = 4.0f; path2Path.UsesEvenOddFillRule = true; strokeColor3.SetStroke(); path2Path.LineWidth = 4.0f; path2Path.Stroke(); //// Line 2 Drawing UIBezierPath line2Path = new UIBezierPath(); line2Path.MoveTo(new CGPoint(61.5f, 381.83f)); line2Path.AddLineTo(new CGPoint(61.5f, 389.55f)); line2Path.MiterLimit = 4.0f; line2Path.LineCapStyle = CGLineCap.Square; line2Path.UsesEvenOddFillRule = true; strokeColor3.SetStroke(); line2Path.LineWidth = 4.0f; line2Path.Stroke(); //// Line 3 Drawing UIBezierPath line3Path = new UIBezierPath(); line3Path.MoveTo(new CGPoint(49.88f, 390.6f)); line3Path.AddLineTo(new CGPoint(72.46f, 390.6f)); line3Path.MiterLimit = 4.0f; line3Path.LineCapStyle = CGLineCap.Square; line3Path.UsesEvenOddFillRule = true; strokeColor3.SetStroke(); line3Path.LineWidth = 4.0f; line3Path.Stroke(); } } //// Play/Pause-Button { //// Oval-1-Copy-3 Drawing var oval1Copy3Path = UIBezierPath.FromOval(new CGRect(18.0f, 428.0f, 87.0f, 87.0f)); playPausePressed.SetFill(); oval1Copy3Path.Fill(); //// Path-5-+-Line-+-Line-Copy { //// Path-5 Drawing UIBezierPath path5Path = new UIBezierPath(); path5Path.MoveTo(new CGPoint(40.98f, 457.24f)); path5Path.AddLineTo(new CGPoint(40.98f, 485.25f)); path5Path.AddLineTo(new CGPoint(59.77f, 471.25f)); path5Path.AddLineTo(new CGPoint(40.98f, 457.24f)); path5Path.ClosePath(); path5Path.MiterLimit = 4.0f; path5Path.UsesEvenOddFillRule = true; fillColor2.SetFill(); path5Path.Fill(); //// Line 4 Drawing UIBezierPath line4Path = new UIBezierPath(); line4Path.MoveTo(new CGPoint(69.18f, 457.72f)); line4Path.AddLineTo(new CGPoint(69.18f, 484.8f)); line4Path.MiterLimit = 4.0f; line4Path.LineCapStyle = CGLineCap.Square; line4Path.UsesEvenOddFillRule = true; strokeColor3.SetStroke(); line4Path.LineWidth = 4.0f; line4Path.Stroke(); //// Line-Copy Drawing UIBezierPath lineCopyPath = new UIBezierPath(); lineCopyPath.MoveTo(new CGPoint(79.61f, 457.72f)); lineCopyPath.AddLineTo(new CGPoint(79.61f, 484.8f)); lineCopyPath.MiterLimit = 4.0f; lineCopyPath.LineCapStyle = CGLineCap.Square; lineCopyPath.UsesEvenOddFillRule = true; strokeColor3.SetStroke(); lineCopyPath.LineWidth = 4.0f; lineCopyPath.Stroke(); } } //// Rectangle- 12 Drawing var rectangle12Path = UIBezierPath.FromRoundedRect(new CGRect(110.0f, 13.0f, 34.0f, 13.0f), 6.5f); fillColor.SetFill(); rectangle12Path.Fill(); strokeColor.SetStroke(); rectangle12Path.LineWidth = 1.0f; rectangle12Path.Stroke(); } } } }
private void drawBackground(RectangleF frame, CGContext context) { float R0 = 0.267f, G0 = 0.303f, B0 = 0.335f; float R1 = 0.040f, G1 = 0.040f, B1 = 0.040f; //UIColor tintColor = KxMenu.tintColor; float X0 = frame.X; float X1 = frame.X + frame.Width; float Y0 = frame.Y; float Y1 = frame.Y + frame.Height; // render arrow UIBezierPath arrowPath = new UIBezierPath(); // fix the issue with gap of arrow's base if on the edge const float kEmbedFix = 3f; if (_arrowDirection == ArrowDirection.Up) { float arrowXM = _arrowPosition; float arrowX0 = arrowXM - kArrowSize; float arrowX1 = arrowXM + kArrowSize; float arrowY0 = Y0; float arrowY1 = Y0 + kArrowSize + kEmbedFix; arrowPath.MoveTo(new PointF(arrowXM, arrowY0)); arrowPath.AddLineTo(new PointF(arrowX1, arrowY1)); arrowPath.AddLineTo(new PointF(arrowX0, arrowY1)); arrowPath.AddLineTo(new PointF(arrowXM, arrowY0)); UIColor.FromRGBA(R0, G0, B0, 1).SetFill(); Y0 += kArrowSize; } else if (_arrowDirection == ArrowDirection.Down) { float arrowXM = _arrowPosition; float arrowX0 = arrowXM - kArrowSize; float arrowX1 = arrowXM + kArrowSize; float arrowY0 = Y1 - kArrowSize - kEmbedFix; float arrowY1 = Y1; arrowPath.MoveTo(new PointF(arrowXM, arrowY1)); arrowPath.AddLineTo(new PointF(arrowX1, arrowY0)); arrowPath.AddLineTo(new PointF(arrowX0, arrowY0)); arrowPath.AddLineTo(new PointF(arrowXM, arrowY1)); UIColor.FromRGBA(R1, G1, B1, 1).SetFill(); Y1 -= kArrowSize; } else if (_arrowDirection == ArrowDirection.Left) { float arrowYM = _arrowPosition; float arrowX0 = X0; float arrowX1 = X0 + kArrowSize + kEmbedFix; float arrowY0 = arrowYM - kArrowSize; ; float arrowY1 = arrowYM + kArrowSize; arrowPath.MoveTo(new PointF(arrowX0, arrowYM)); arrowPath.AddLineTo(new PointF(arrowX1, arrowY0)); arrowPath.AddLineTo(new PointF(arrowX1, arrowY1)); arrowPath.AddLineTo(new PointF(arrowX0, arrowYM)); UIColor.FromRGBA(R0, G0, B0, 1).SetFill(); X0 += kArrowSize; } else if (_arrowDirection == ArrowDirection.Right) { float arrowYM = _arrowPosition; float arrowX0 = X1; float arrowX1 = X1 - kArrowSize - kEmbedFix; float arrowY0 = arrowYM - kArrowSize; ; float arrowY1 = arrowYM + kArrowSize; arrowPath.MoveTo(new PointF(arrowX0, arrowYM)); arrowPath.AddLineTo(new PointF(arrowX1, arrowY0)); arrowPath.AddLineTo(new PointF(arrowX1, arrowY1)); arrowPath.AddLineTo(new PointF(arrowX0, arrowYM)); UIColor.FromRGBA(R1, G1, B1, 1).SetFill(); X1 -= kArrowSize; } arrowPath.Fill(); // render body RectangleF bodyFrame = new RectangleF(X0, Y0, X1 - X0, Y1 - Y0); UIBezierPath borderPath = UIBezierPath.FromRoundedRect(bodyFrame, 8); float[] locations = new[] { 0f, 1f }; float[] components = new[] { R0, G0, B0, 1, R1, G1, B1, 1, }; CGColorSpace colorSpace = CGColorSpace.CreateDeviceRGB(); CGGradient gradient = new CGGradient(colorSpace, components, locations); borderPath.AddClip(); PointF start, end; if (_arrowDirection == ArrowDirection.Left || _arrowDirection == ArrowDirection.Right) { start = new PointF(X0, Y0); end = new PointF(X1, Y0); } else { start = new PointF(X0, Y0); end = new PointF(X0, Y1); } context.DrawLinearGradient(gradient, start, end, 0); }
static void paintCodeNonRetina() { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor color3 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); UIColor color4 = UIColor.FromRGBA(0.429f, 0.000f, 0.000f, 1.000f); UIColor color5 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); UIColor color6 = UIColor.FromRGBA(0.456f, 0.456f, 0.456f, 1.000f); //// Shadow Declarations var shadow = UIColor.Black.CGColor; var shadowOffset = new SizeF(0.1f, -1.1f); var shadowBlurRadius = 8.5f; var shadow2 = color6.CGColor; var shadow2Offset = new SizeF(0.1f, -0.1f); var shadow2BlurRadius = 3.5f; //// Abstracted Attributes //var textContent = "Hello, World!"; //// Group { //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(16.77f, 10.57f)); bezier2Path.AddLineTo(new PointF(16.77f, 32.23f)); bezier2Path.AddLineTo(new PointF(25, 32.23f)); bezier2Path.AddLineTo(new PointF(24.03f, 12.12f)); bezier2Path.AddLineTo(new PointF(16.77f, 10.57f)); bezier2Path.ClosePath(); color4.SetFill(); bezier2Path.Fill(); ////// Bezier 2 Inner Shadow var bezier2BorderRect = bezier2Path.Bounds; bezier2BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier2BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier2BorderRect = RectangleF.Union(bezier2BorderRect, bezier2Path.Bounds); bezier2BorderRect.Inflate(1, 1); var bezier2NegativePath = UIBezierPath.FromRect(bezier2BorderRect); bezier2NegativePath.AppendPath(bezier2Path); bezier2NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier2BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier2Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier2BorderRect.Width), 0); bezier2NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier2NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezier2Path.LineWidth = 1; bezier2Path.Stroke(); //// Bezier 18 Drawing UIBezierPath bezier18Path = new UIBezierPath(); bezier18Path.MoveTo(new PointF(24.03f, 32.21f)); bezier18Path.AddLineTo(new PointF(24.03f, 13.19f)); bezier18Path.AddLineTo(new PointF(47.76f, 11.6f)); bezier18Path.AddLineTo(new PointF(47.76f, 32.74f)); bezier18Path.AddLineTo(new PointF(24.03f, 32.21f)); bezier18Path.ClosePath(); color4.SetFill(); bezier18Path.Fill(); ////// Bezier 18 Inner Shadow var bezier18BorderRect = bezier18Path.Bounds; bezier18BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier18BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier18BorderRect = RectangleF.Union(bezier18BorderRect, bezier18Path.Bounds); bezier18BorderRect.Inflate(1, 1); var bezier18NegativePath = UIBezierPath.FromRect(bezier18BorderRect); bezier18NegativePath.AppendPath(bezier18Path); bezier18NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier18BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier18Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier18BorderRect.Width), 0); bezier18NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier18NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezier18Path.LineWidth = 1; bezier18Path.Stroke(); //// Bezier 6 Drawing UIBezierPath bezier6Path = new UIBezierPath(); bezier6Path.MoveTo(new PointF(42.43f, 2.84f)); bezier6Path.AddLineTo(new PointF(47.27f, 5.57f)); bezier6Path.AddLineTo(new PointF(47.27f, 10.57f)); bezier6Path.AddLineTo(new PointF(42.43f, 2.84f)); bezier6Path.ClosePath(); color4.SetFill(); bezier6Path.Fill(); ////// Bezier 6 Inner Shadow var bezier6BorderRect = bezier6Path.Bounds; bezier6BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier6BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier6BorderRect = RectangleF.Union(bezier6BorderRect, bezier6Path.Bounds); bezier6BorderRect.Inflate(1, 1); var bezier6NegativePath = UIBezierPath.FromRect(bezier6BorderRect); bezier6NegativePath.AppendPath(bezier6Path); bezier6NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier6BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier6Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier6BorderRect.Width), 0); bezier6NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier6NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezier6Path.LineWidth = 1; bezier6Path.Stroke(); //// Bezier 5 Drawing UIBezierPath bezier5Path = new UIBezierPath(); bezier5Path.MoveTo(new PointF(23.06f, 13.15f)); bezier5Path.AddLineTo(new PointF(47.76f, 11.35f)); bezier5Path.AddLineTo(new PointF(42.07f, 2.84f)); bezier5Path.AddLineTo(new PointF(19.67f, 6.96f)); bezier5Path.AddLineTo(new PointF(23.06f, 13.15f)); bezier5Path.ClosePath(); color4.SetFill(); bezier5Path.Fill(); ////// Bezier 5 Inner Shadow var bezier5BorderRect = bezier5Path.Bounds; bezier5BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier5BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier5BorderRect = RectangleF.Union(bezier5BorderRect, bezier5Path.Bounds); bezier5BorderRect.Inflate(1, 1); var bezier5NegativePath = UIBezierPath.FromRect(bezier5BorderRect); bezier5NegativePath.AppendPath(bezier5Path); bezier5NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier5BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier5Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier5BorderRect.Width), 0); bezier5NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier5NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezier5Path.LineWidth = 1; bezier5Path.Stroke(); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(4.66f, 13.66f)); bezierPath.AddLineTo(new PointF(4.66f, 32.23f)); bezierPath.AddLineTo(new PointF(16.28f, 32.23f)); bezierPath.AddLineTo(new PointF(16.28f, 11.6f)); bezierPath.AddLineTo(new PointF(4.66f, 13.66f)); bezierPath.ClosePath(); color4.SetFill(); bezierPath.Fill(); ////// Bezier Inner Shadow var bezierBorderRect = bezierPath.Bounds; bezierBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezierBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezierBorderRect = RectangleF.Union(bezierBorderRect, bezierPath.Bounds); bezierBorderRect.Inflate(1, 1); var bezierNegativePath = UIBezierPath.FromRect(bezierBorderRect); bezierNegativePath.AppendPath(bezierPath); bezierNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezierBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezierPath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezierBorderRect.Width), 0); bezierNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezierNegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezierPath.LineWidth = 1; bezierPath.Stroke(); //// Text Drawing // var textRect = new RectangleF(17, 12, 0, 0); // UIColor.Black.SetFill(); // new NSString(textContent).DrawString(textRect, UIFont.FromName("Helvetica", 12), UILineBreakMode.WordWrap, UITextAlignment.Center); //// Bezier 3 Drawing UIBezierPath bezier3Path = new UIBezierPath(); bezier3Path.MoveTo(new PointF(16.77f, 11.09f)); bezier3Path.AddLineTo(new PointF(2.24f, 13.66f)); bezier3Path.AddLineTo(new PointF(16.77f, 0.26f)); bezier3Path.AddLineTo(new PointF(16.77f, 11.09f)); color4.SetFill(); bezier3Path.Fill(); ////// Bezier 3 Inner Shadow var bezier3BorderRect = bezier3Path.Bounds; bezier3BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier3BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier3BorderRect = RectangleF.Union(bezier3BorderRect, bezier3Path.Bounds); bezier3BorderRect.Inflate(1, 1); var bezier3NegativePath = UIBezierPath.FromRect(bezier3BorderRect); bezier3NegativePath.AppendPath(bezier3Path); bezier3NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier3BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier3Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier3BorderRect.Width), 0); bezier3NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier3NegativePath.Fill(); } context.RestoreState(); color3.SetStroke(); bezier3Path.LineWidth = 1; bezier3Path.Stroke(); //// Bezier 4 Drawing UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new PointF(16.28f, 0.26f)); bezier4Path.AddLineTo(new PointF(25.48f, 13.15f)); bezier4Path.AddLineTo(new PointF(16.28f, 11.6f)); bezier4Path.AddLineTo(new PointF(16.28f, 0.26f)); bezier4Path.ClosePath(); color4.SetFill(); bezier4Path.Fill(); ////// Bezier 4 Inner Shadow var bezier4BorderRect = bezier4Path.Bounds; bezier4BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier4BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier4BorderRect = RectangleF.Union(bezier4BorderRect, bezier4Path.Bounds); bezier4BorderRect.Inflate(1, 1); var bezier4NegativePath = UIBezierPath.FromRect(bezier4BorderRect); bezier4NegativePath.AppendPath(bezier4Path); bezier4NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier4BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier4Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier4BorderRect.Width), 0); bezier4NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier4NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezier4Path.LineWidth = 1; bezier4Path.Stroke(); //// Rectangle 2 Drawing var rectangle2Path = UIBezierPath.FromRect(new RectangleF(6.5f, 16.5f, 4, 10)); color3.SetFill(); rectangle2Path.Fill(); UIColor.Black.SetStroke(); rectangle2Path.LineWidth = 1; rectangle2Path.Stroke(); //// Bezier 7 Drawing UIBezierPath bezier7Path = new UIBezierPath(); bezier7Path.MoveTo(new PointF(10.96f, 18.3f)); bezier7Path.AddCurveToPoint(new PointF(6.6f, 18.3f), new PointF(7.08f, 18.3f), new PointF(6.6f, 18.3f)); color5.SetStroke(); bezier7Path.LineWidth = 1; bezier7Path.Stroke(); //// Bezier 8 Drawing UIBezierPath bezier8Path = new UIBezierPath(); bezier8Path.MoveTo(new PointF(10.96f, 20.37f)); bezier8Path.AddCurveToPoint(new PointF(6.6f, 20.37f), new PointF(7.08f, 20.37f), new PointF(6.6f, 20.37f)); color5.SetStroke(); bezier8Path.LineWidth = 1; bezier8Path.Stroke(); //// Bezier 9 Drawing UIBezierPath bezier9Path = new UIBezierPath(); bezier9Path.MoveTo(new PointF(10.96f, 22.43f)); bezier9Path.AddCurveToPoint(new PointF(6.6f, 22.43f), new PointF(7.08f, 22.43f), new PointF(6.6f, 22.43f)); color5.SetStroke(); bezier9Path.LineWidth = 1; bezier9Path.Stroke(); //// Bezier 10 Drawing UIBezierPath bezier10Path = new UIBezierPath(); bezier10Path.MoveTo(new PointF(10.96f, 23.98f)); bezier10Path.AddCurveToPoint(new PointF(6.6f, 23.98f), new PointF(7.08f, 23.98f), new PointF(6.6f, 23.98f)); color5.SetStroke(); bezier10Path.LineWidth = 1; bezier10Path.Stroke(); //// Bezier 11 Drawing UIBezierPath bezier11Path = new UIBezierPath(); bezier11Path.MoveTo(new PointF(9.99f, 16.76f)); bezier11Path.AddCurveToPoint(new PointF(9.99f, 26.55f), new PointF(9.99f, 26.55f), new PointF(9.99f, 26.55f)); color5.SetStroke(); bezier11Path.LineWidth = 1; bezier11Path.Stroke(); //// Bezier 12 Drawing UIBezierPath bezier12Path = new UIBezierPath(); bezier12Path.MoveTo(new PointF(8.05f, 16.76f)); bezier12Path.AddCurveToPoint(new PointF(8.05f, 26.55f), new PointF(8.05f, 26.55f), new PointF(8.05f, 26.55f)); color5.SetStroke(); bezier12Path.LineWidth = 1; bezier12Path.Stroke(); //// Rectangle 3 Drawing var rectangle3Path = UIBezierPath.FromRect(new RectangleF(19.5f, 20.5f, 3, 11)); color3.SetFill(); rectangle3Path.Fill(); UIColor.Black.SetStroke(); rectangle3Path.LineWidth = 1; rectangle3Path.Stroke(); //// Bezier 13 Drawing UIBezierPath bezier13Path = new UIBezierPath(); bezier13Path.MoveTo(new PointF(19.67f, 21.91f)); bezier13Path.AddLineTo(new PointF(22.58f, 21.91f)); color5.SetFill(); bezier13Path.Fill(); color5.SetStroke(); bezier13Path.LineWidth = 1; bezier13Path.Stroke(); //// Bezier 14 Drawing UIBezierPath bezier14Path = new UIBezierPath(); bezier14Path.MoveTo(new PointF(19.67f, 23.98f)); bezier14Path.AddLineTo(new PointF(22.58f, 23.98f)); color5.SetFill(); bezier14Path.Fill(); color5.SetStroke(); bezier14Path.LineWidth = 1; bezier14Path.Stroke(); //// Bezier 15 Drawing UIBezierPath bezier15Path = new UIBezierPath(); bezier15Path.MoveTo(new PointF(19.67f, 26.55f)); bezier15Path.AddLineTo(new PointF(22.58f, 26.55f)); color5.SetFill(); bezier15Path.Fill(); color5.SetStroke(); bezier15Path.LineWidth = 1; bezier15Path.Stroke(); //// Bezier 16 Drawing UIBezierPath bezier16Path = new UIBezierPath(); bezier16Path.MoveTo(new PointF(19.67f, 29.13f)); bezier16Path.AddLineTo(new PointF(22.58f, 29.13f)); color5.SetFill(); bezier16Path.Fill(); color5.SetStroke(); bezier16Path.LineWidth = 1; bezier16Path.Stroke(); //// Bezier 17 Drawing UIBezierPath bezier17Path = new UIBezierPath(); bezier17Path.MoveTo(new PointF(21.13f, 20.37f)); bezier17Path.AddLineTo(new PointF(21.13f, 31.2f)); color5.SetFill(); bezier17Path.Fill(); color5.SetStroke(); bezier17Path.LineWidth = 1; bezier17Path.Stroke(); //// Rectangle 8 Drawing var rectangle8Path = UIBezierPath.FromRect(new RectangleF(39.5f, 27.5f, 3, 5)); color3.SetFill(); rectangle8Path.Fill(); ////// Rectangle 8 Inner Shadow var rectangle8BorderRect = rectangle8Path.Bounds; rectangle8BorderRect.Inflate(shadow2BlurRadius, shadow2BlurRadius); rectangle8BorderRect.Offset(-shadow2Offset.Width, -shadow2Offset.Height); rectangle8BorderRect = RectangleF.Union(rectangle8BorderRect, rectangle8Path.Bounds); rectangle8BorderRect.Inflate(1, 1); var rectangle8NegativePath = UIBezierPath.FromRect(rectangle8BorderRect); rectangle8NegativePath.AppendPath(rectangle8Path); rectangle8NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadow2Offset.Width + (float)Math.Round(rectangle8BorderRect.Width); var yOffset = shadow2Offset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadow2BlurRadius, shadow2); rectangle8Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle8BorderRect.Width), 0); rectangle8NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle8NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); rectangle8Path.LineWidth = 1; rectangle8Path.Stroke(); //// Rectangle 5 Drawing var rectangle5Path = UIBezierPath.FromRect(new RectangleF(26.5f, 15.5f, 3, 3)); color3.SetFill(); rectangle5Path.Fill(); UIColor.Black.SetStroke(); rectangle5Path.LineWidth = 1; rectangle5Path.Stroke(); //// Bezier 19 Drawing UIBezierPath bezier19Path = new UIBezierPath(); bezier19Path.MoveTo(new PointF(26.94f, 16.24f)); bezier19Path.AddCurveToPoint(new PointF(29.84f, 16.24f), new PointF(29.84f, 16.24f), new PointF(29.84f, 16.24f)); color5.SetStroke(); bezier19Path.LineWidth = 1; bezier19Path.Stroke(); //// Bezier 20 Drawing UIBezierPath bezier20Path = new UIBezierPath(); bezier20Path.MoveTo(new PointF(26.94f, 18.3f)); bezier20Path.AddLineTo(new PointF(29.84f, 18.3f)); color5.SetStroke(); bezier20Path.LineWidth = 1; bezier20Path.Stroke(); //// Bezier 21 Drawing UIBezierPath bezier21Path = new UIBezierPath(); bezier21Path.MoveTo(new PointF(28.39f, 15.21f)); bezier21Path.AddLineTo(new PointF(28.39f, 18.82f)); color5.SetStroke(); bezier21Path.LineWidth = 1; bezier21Path.Stroke(); //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRect(new RectangleF(32.5f, 15.5f, 3, 3)); color3.SetFill(); rectanglePath.Fill(); UIColor.Black.SetStroke(); rectanglePath.LineWidth = 1; rectanglePath.Stroke(); //// Bezier 22 Drawing UIBezierPath bezier22Path = new UIBezierPath(); bezier22Path.MoveTo(new PointF(32.26f, 16.24f)); bezier22Path.AddCurveToPoint(new PointF(35.17f, 16.24f), new PointF(35.17f, 16.24f), new PointF(35.17f, 16.24f)); color5.SetStroke(); bezier22Path.LineWidth = 1; bezier22Path.Stroke(); //// Bezier 23 Drawing UIBezierPath bezier23Path = new UIBezierPath(); bezier23Path.MoveTo(new PointF(32.26f, 18.3f)); bezier23Path.AddLineTo(new PointF(35.17f, 18.3f)); color5.SetStroke(); bezier23Path.LineWidth = 1; bezier23Path.Stroke(); //// Bezier 24 Drawing UIBezierPath bezier24Path = new UIBezierPath(); bezier24Path.MoveTo(new PointF(33.72f, 15.21f)); bezier24Path.AddLineTo(new PointF(33.72f, 18.82f)); color5.SetStroke(); bezier24Path.LineWidth = 1; bezier24Path.Stroke(); //// Rectangle 4 Drawing var rectangle4Path = UIBezierPath.FromRect(new RectangleF(38.5f, 14.5f, 2, 4)); color3.SetFill(); rectangle4Path.Fill(); UIColor.Black.SetStroke(); rectangle4Path.LineWidth = 1; rectangle4Path.Stroke(); //// Bezier 25 Drawing UIBezierPath bezier25Path = new UIBezierPath(); bezier25Path.MoveTo(new PointF(38.07f, 15.73f)); bezier25Path.AddCurveToPoint(new PointF(40.98f, 15.73f), new PointF(40.98f, 15.73f), new PointF(40.98f, 15.73f)); color5.SetStroke(); bezier25Path.LineWidth = 1; bezier25Path.Stroke(); //// Bezier 26 Drawing UIBezierPath bezier26Path = new UIBezierPath(); bezier26Path.MoveTo(new PointF(38.07f, 17.79f)); bezier26Path.AddLineTo(new PointF(40.98f, 17.79f)); color5.SetStroke(); bezier26Path.LineWidth = 1; bezier26Path.Stroke(); //// Bezier 27 Drawing UIBezierPath bezier27Path = new UIBezierPath(); bezier27Path.MoveTo(new PointF(39.53f, 14.7f)); bezier27Path.AddLineTo(new PointF(39.53f, 18.3f)); color5.SetStroke(); bezier27Path.LineWidth = 1; bezier27Path.Stroke(); } }
public override void Draw(CGRect rect) { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations var fillColor = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); var strokeColor = UIColor.FromRGBA(0.807f, 0.807f, 0.807f, 1.000f); var strokeColor2 = UIColor.FromRGBA(0.851f, 0.851f, 0.851f, 1.000f); //// Frames CGRect frame = new CGRect(0.0f, 0.0f, 772.0f, 356.0f); //// Group 2 { //// Group 3 { context.SaveState(); context.BeginTransparencyLayer(); //// Clip Clip 2 UIBezierPath clip2Path = new UIBezierPath(); clip2Path.MoveTo(new CGPoint(frame.GetMinX() - 41.0f, frame.GetMinY() - 45.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 730.0f, frame.GetMinY() - 45.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 730.0f, frame.GetMinY() + 310.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 41.0f, frame.GetMinY() + 310.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 41.0f, frame.GetMinY() - 45.0f)); clip2Path.ClosePath(); clip2Path.MoveTo(new CGPoint(frame.GetMinX() - 20.0f, frame.GetMinY() - 20.5f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() - 24.0f), new CGPoint(frame.GetMinX() - 20.0f, frame.GetMinY() - 22.44f), new CGPoint(frame.GetMinX() - 18.44f, frame.GetMinY() - 24.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() - 24.0f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 709.0f, frame.GetMinY() - 20.5f), new CGPoint(frame.GetMinX() + 707.44f, frame.GetMinY() - 24.0f), new CGPoint(frame.GetMinX() + 709.0f, frame.GetMinY() - 22.44f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 709.0f, frame.GetMinY() + 285.5f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() + 289.0f), new CGPoint(frame.GetMinX() + 709.0f, frame.GetMinY() + 287.44f), new CGPoint(frame.GetMinX() + 707.44f, frame.GetMinY() + 289.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() + 289.0f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 20.0f, frame.GetMinY() + 285.5f), new CGPoint(frame.GetMinX() - 18.44f, frame.GetMinY() + 289.0f), new CGPoint(frame.GetMinX() - 20.0f, frame.GetMinY() + 287.44f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 20.0f, frame.GetMinY() - 20.5f)); clip2Path.ClosePath(); clip2Path.MoveTo(new CGPoint(frame.GetMinX() - 21.0f, frame.GetMinY() - 20.5f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 21.0f, frame.GetMinY() + 285.5f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() + 290.0f), new CGPoint(frame.GetMinX() - 21.0f, frame.GetMinY() + 287.99f), new CGPoint(frame.GetMinX() - 18.99f, frame.GetMinY() + 290.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() + 290.0f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 710.0f, frame.GetMinY() + 285.5f), new CGPoint(frame.GetMinX() + 707.99f, frame.GetMinY() + 290.0f), new CGPoint(frame.GetMinX() + 710.0f, frame.GetMinY() + 287.99f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() + 710.0f, frame.GetMinY() - 20.5f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() - 25.0f), new CGPoint(frame.GetMinX() + 710.0f, frame.GetMinY() - 22.99f), new CGPoint(frame.GetMinX() + 707.99f, frame.GetMinY() - 25.0f)); clip2Path.AddLineTo(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() - 25.0f)); clip2Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 21.0f, frame.GetMinY() - 20.5f), new CGPoint(frame.GetMinX() - 18.99f, frame.GetMinY() - 25.0f), new CGPoint(frame.GetMinX() - 21.0f, frame.GetMinY() - 22.99f)); clip2Path.ClosePath(); clip2Path.UsesEvenOddFillRule = true; clip2Path.AddClip(); //// Group 4 { context.SaveState(); context.BeginTransparencyLayer(); //// Clip Clip UIBezierPath clipPath = new UIBezierPath(); clipPath.MoveTo(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 20.5f)); clipPath.AddCurveToPoint(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() - 24.5f), new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 22.71f), new CGPoint(frame.GetMinX() - 18.72f, frame.GetMinY() - 24.5f)); clipPath.AddLineTo(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() - 24.5f)); clipPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() - 20.5f), new CGPoint(frame.GetMinX() + 707.71f, frame.GetMinY() - 24.5f), new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() - 22.71f)); clipPath.AddLineTo(new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() + 285.5f)); clipPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() + 289.5f), new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() + 287.71f), new CGPoint(frame.GetMinX() + 707.72f, frame.GetMinY() + 289.5f)); clipPath.AddLineTo(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() + 289.5f)); clipPath.AddCurveToPoint(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() + 285.5f), new CGPoint(frame.GetMinX() - 18.71f, frame.GetMinY() + 289.5f), new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() + 287.71f)); clipPath.AddLineTo(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 20.5f)); clipPath.ClosePath(); clipPath.UsesEvenOddFillRule = true; clipPath.AddClip(); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 20.5f)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() - 24.5f), new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 22.71f), new CGPoint(frame.GetMinX() - 18.72f, frame.GetMinY() - 24.5f)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() - 24.5f)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() - 20.5f), new CGPoint(frame.GetMinX() + 707.71f, frame.GetMinY() - 24.5f), new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() - 22.71f)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() + 285.5f)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() + 705.51f, frame.GetMinY() + 289.5f), new CGPoint(frame.GetMinX() + 709.5f, frame.GetMinY() + 287.71f), new CGPoint(frame.GetMinX() + 707.72f, frame.GetMinY() + 289.5f)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() - 16.51f, frame.GetMinY() + 289.5f)); bezierPath.AddCurveToPoint(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() + 285.5f), new CGPoint(frame.GetMinX() - 18.71f, frame.GetMinY() + 289.5f), new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() + 287.71f)); bezierPath.AddLineTo(new CGPoint(frame.GetMinX() - 20.5f, frame.GetMinY() - 20.5f)); bezierPath.ClosePath(); fillColor.SetFill(); bezierPath.Fill(); context.EndTransparencyLayer(); context.RestoreState(); } context.EndTransparencyLayer(); context.RestoreState(); } //// Group 5 { context.SaveState(); context.BeginTransparencyLayer(); //// Clip Clip 3 UIBezierPath clip3Path = new UIBezierPath(); clip3Path.MoveTo(new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() - 11.14f)); clip3Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 9.35f, frame.GetMinY() - 15.5f), new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() - 13.55f), new CGPoint(frame.GetMinX() - 11.65f, frame.GetMinY() - 15.5f)); clip3Path.AddLineTo(new CGPoint(frame.GetMinX() + 740.35f, frame.GetMinY() - 15.5f)); clip3Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() - 11.14f), new CGPoint(frame.GetMinX() + 742.64f, frame.GetMinY() - 15.5f), new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() - 13.56f)); clip3Path.AddLineTo(new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() + 322.14f)); clip3Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 740.35f, frame.GetMinY() + 326.5f), new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() + 324.55f), new CGPoint(frame.GetMinX() + 742.65f, frame.GetMinY() + 326.5f)); clip3Path.AddLineTo(new CGPoint(frame.GetMinX() - 9.35f, frame.GetMinY() + 326.5f)); clip3Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() + 322.14f), new CGPoint(frame.GetMinX() - 11.64f, frame.GetMinY() + 326.5f), new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() + 324.56f)); clip3Path.AddLineTo(new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() - 11.14f)); clip3Path.ClosePath(); clip3Path.UsesEvenOddFillRule = true; clip3Path.AddClip(); //// Bezier 4 Drawing UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() - 11.14f)); bezier4Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 9.35f, frame.GetMinY() - 15.5f), new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() - 13.55f), new CGPoint(frame.GetMinX() - 11.65f, frame.GetMinY() - 15.5f)); bezier4Path.AddLineTo(new CGPoint(frame.GetMinX() + 740.35f, frame.GetMinY() - 15.5f)); bezier4Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() - 11.14f), new CGPoint(frame.GetMinX() + 742.64f, frame.GetMinY() - 15.5f), new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() - 13.56f)); bezier4Path.AddLineTo(new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() + 322.14f)); bezier4Path.AddCurveToPoint(new CGPoint(frame.GetMinX() + 740.35f, frame.GetMinY() + 326.5f), new CGPoint(frame.GetMinX() + 744.5f, frame.GetMinY() + 324.55f), new CGPoint(frame.GetMinX() + 742.65f, frame.GetMinY() + 326.5f)); bezier4Path.AddLineTo(new CGPoint(frame.GetMinX() - 9.35f, frame.GetMinY() + 326.5f)); bezier4Path.AddCurveToPoint(new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() + 322.14f), new CGPoint(frame.GetMinX() - 11.64f, frame.GetMinY() + 326.5f), new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() + 324.56f)); bezier4Path.AddLineTo(new CGPoint(frame.GetMinX() - 13.5f, frame.GetMinY() - 11.14f)); bezier4Path.ClosePath(); strokeColor2.SetStroke(); bezier4Path.LineWidth = 2.0f; bezier4Path.Stroke(); context.EndTransparencyLayer(); context.RestoreState(); } //// Bezier 6 Drawing UIBezierPath bezier6Path = new UIBezierPath(); bezier6Path.MoveTo(new CGPoint(frame.GetMinX() + 36.0f, frame.GetMinY() + 155.6f)); bezier6Path.AddLineTo(new CGPoint(frame.GetMinX() + 696.0f, frame.GetMinY() + 155.6f)); bezier6Path.LineCapStyle = CGLineCap.Square; strokeColor.SetStroke(); bezier6Path.LineWidth = 1.0f; bezier6Path.Stroke(); } }
static void paintCodeRetina() { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor shadowColor2 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 0.413f); UIColor color5 = UIColor.FromRGBA(0.200f, 0.067f, 0.000f, 1.000f); //// Shadow Declarations var shadow = shadowColor2.CGColor; var shadowOffset = new SizeF(0.1f, 1.1f); var shadowBlurRadius = 10; //// Rectangle 5 Drawing UIBezierPath rectangle5Path = new UIBezierPath(); rectangle5Path.MoveTo(new PointF(6.09f, 11.75f)); rectangle5Path.AddLineTo(new PointF(6.09f, 11.85f)); rectangle5Path.AddLineTo(new PointF(6.09f, 11.75f)); rectangle5Path.ClosePath(); rectangle5Path.MoveTo(new PointF(6.94f, 20.6f)); rectangle5Path.AddLineTo(new PointF(6.94f, 2)); rectangle5Path.AddLineTo(new PointF(9.27f, 5.28f)); rectangle5Path.AddLineTo(new PointF(9.47f, 26.07f)); rectangle5Path.AddLineTo(new PointF(6.94f, 20.6f)); rectangle5Path.ClosePath(); color5.SetFill(); rectangle5Path.Fill(); ////// Rectangle 5 Inner Shadow var rectangle5BorderRect = rectangle5Path.Bounds; rectangle5BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle5BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle5BorderRect = RectangleF.Union(rectangle5BorderRect, rectangle5Path.Bounds); rectangle5BorderRect.Inflate(1, 1); var rectangle5NegativePath = UIBezierPath.FromRect(rectangle5BorderRect); rectangle5NegativePath.AppendPath(rectangle5Path); rectangle5NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle5BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectangle5Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle5BorderRect.Width), 0); rectangle5NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle5NegativePath.Fill(); } context.RestoreState(); color5.SetStroke(); rectangle5Path.LineWidth = 1; rectangle5Path.Stroke(); //// Rectangle 4 Drawing UIBezierPath rectangle4Path = new UIBezierPath(); rectangle4Path.MoveTo(new PointF(77.17f, 46.2f)); rectangle4Path.AddLineTo(new PointF(77.17f, 46.2f)); rectangle4Path.AddLineTo(new PointF(77.17f, 46.2f)); rectangle4Path.ClosePath(); rectangle4Path.MoveTo(new PointF(77.54f, 58.04f)); rectangle4Path.AddLineTo(new PointF(77.54f, 34.62f)); rectangle4Path.AddLineTo(new PointF(83.98f, 37.55f)); rectangle4Path.AddLineTo(new PointF(83.98f, 63.9f)); rectangle4Path.AddLineTo(new PointF(77.54f, 58.04f)); rectangle4Path.ClosePath(); color5.SetFill(); rectangle4Path.Fill(); ////// Rectangle 4 Inner Shadow var rectangle4BorderRect = rectangle4Path.Bounds; rectangle4BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle4BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle4BorderRect = RectangleF.Union(rectangle4BorderRect, rectangle4Path.Bounds); rectangle4BorderRect.Inflate(1, 1); var rectangle4NegativePath = UIBezierPath.FromRect(rectangle4BorderRect); rectangle4NegativePath.AppendPath(rectangle4Path); rectangle4NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle4BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectangle4Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle4BorderRect.Width), 0); rectangle4NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle4NegativePath.Fill(); } context.RestoreState(); color5.SetStroke(); rectangle4Path.LineWidth = 1; rectangle4Path.Stroke(); //// Rectangle 6 Drawing UIBezierPath rectangle6Path = new UIBezierPath(); rectangle6Path.MoveTo(new PointF(26.89f, 48.27f)); rectangle6Path.AddLineTo(new PointF(26.89f, 48.27f)); rectangle6Path.AddLineTo(new PointF(26.89f, 48.27f)); rectangle6Path.ClosePath(); rectangle6Path.MoveTo(new PointF(27.14f, 58.73f)); rectangle6Path.AddLineTo(new PointF(27.14f, 31)); rectangle6Path.AddLineTo(new PointF(31.51f, 40.63f)); rectangle6Path.AddLineTo(new PointF(31.51f, 63.9f)); rectangle6Path.AddLineTo(new PointF(27.14f, 58.73f)); rectangle6Path.ClosePath(); color5.SetFill(); rectangle6Path.Fill(); ////// Rectangle 6 Inner Shadow var rectangle6BorderRect = rectangle6Path.Bounds; rectangle6BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle6BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle6BorderRect = RectangleF.Union(rectangle6BorderRect, rectangle6Path.Bounds); rectangle6BorderRect.Inflate(1, 1); var rectangle6NegativePath = UIBezierPath.FromRect(rectangle6BorderRect); rectangle6NegativePath.AppendPath(rectangle6Path); rectangle6NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle6BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectangle6Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle6BorderRect.Width), 0); rectangle6NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle6NegativePath.Fill(); } context.RestoreState(); color5.SetStroke(); rectangle6Path.LineWidth = 1; rectangle6Path.Stroke(); //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRect(new RectangleF(31.5f, 39.5f, 11, 24)); color5.SetFill(); rectanglePath.Fill(); ////// Rectangle Inner Shadow var rectangleBorderRect = rectanglePath.Bounds; rectangleBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangleBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangleBorderRect = RectangleF.Union(rectangleBorderRect, rectanglePath.Bounds); rectangleBorderRect.Inflate(1, 1); var rectangleNegativePath = UIBezierPath.FromRect(rectangleBorderRect); rectangleNegativePath.AppendPath(rectanglePath); rectangleNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangleBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectanglePath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangleBorderRect.Width), 0); rectangleNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangleNegativePath.Fill(); } context.RestoreState(); color5.SetStroke(); rectanglePath.LineWidth = 1; rectanglePath.Stroke(); //// Rectangle 2 Drawing var rectangle2Path = UIBezierPath.FromRect(new RectangleF(9.5f, 7.5f, 7, 19)); color5.SetFill(); rectangle2Path.Fill(); ////// Rectangle 2 Inner Shadow var rectangle2BorderRect = rectangle2Path.Bounds; rectangle2BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle2BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle2BorderRect = RectangleF.Union(rectangle2BorderRect, rectangle2Path.Bounds); rectangle2BorderRect.Inflate(1, 1); var rectangle2NegativePath = UIBezierPath.FromRect(rectangle2BorderRect); rectangle2NegativePath.AppendPath(rectangle2Path); rectangle2NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle2BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectangle2Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle2BorderRect.Width), 0); rectangle2NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle2NegativePath.Fill(); } context.RestoreState(); color5.SetStroke(); rectangle2Path.LineWidth = 1; rectangle2Path.Stroke(); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(7.47f, 2.1f)); bezierPath.AddLineTo(new PointF(30.42f, 38.52f)); bezierPath.AddLineTo(new PointF(93.81f, 38.52f)); bezierPath.AddLineTo(new PointF(53.37f, 2.1f)); bezierPath.AddLineTo(new PointF(10.74f, 2.1f)); bezierPath.AddLineTo(new PointF(7.47f, 2.1f)); bezierPath.ClosePath(); color5.SetFill(); bezierPath.Fill(); ////// Bezier Inner Shadow var bezierBorderRect = bezierPath.Bounds; bezierBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezierBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezierBorderRect = RectangleF.Union(bezierBorderRect, bezierPath.Bounds); bezierBorderRect.Inflate(1, 1); var bezierNegativePath = UIBezierPath.FromRect(bezierBorderRect); bezierNegativePath.AppendPath(bezierPath); bezierNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezierBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezierPath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezierBorderRect.Width), 0); bezierNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezierNegativePath.Fill(); } context.RestoreState(); color5.SetStroke(); bezierPath.LineWidth = 2; bezierPath.Stroke(); //// Rectangle 3 Drawing var rectangle3Path = UIBezierPath.FromRect(new RectangleF(83.5f, 39.5f, 11, 24)); color5.SetFill(); rectangle3Path.Fill(); ////// Rectangle 3 Inner Shadow var rectangle3BorderRect = rectangle3Path.Bounds; rectangle3BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle3BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle3BorderRect = RectangleF.Union(rectangle3BorderRect, rectangle3Path.Bounds); rectangle3BorderRect.Inflate(1, 1); var rectangle3NegativePath = UIBezierPath.FromRect(rectangle3BorderRect); rectangle3NegativePath.AppendPath(rectangle3Path); rectangle3NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle3BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectangle3Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle3BorderRect.Width), 0); rectangle3NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle3NegativePath.Fill(); } context.RestoreState(); color5.SetStroke(); rectangle3Path.LineWidth = 1; rectangle3Path.Stroke(); }
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 DrawRect(RectangleF area, UIViewPrintFormatter formatter) { base.DrawRect(area, formatter); //General Declarations CGContext context = UIGraphics.GetCurrentContext(); // Color Declarations UIColor mmFill = new UIColor(0F, 0F, 0F, 0.196F); UIColor shape1DropShadowColor = new UIColor(1F, 1F, 1F, 0.4F); UIColor shape1InnerShadowColor = new UIColor(0F, 0F, 0F, 0.392F); // Shadow Declarations UIColor mmDropShadow = shape1DropShadowColor; SizeF mmDropShadowOffset = new SizeF(0.1F, 1.1F); Single mmDropShadowBlurRadius = 0; UIColor mmInnerShadow = shape1InnerShadowColor; SizeF mmInnerShadowOffset = new SizeF(0.1F, 1.1F); Single mmInnerShadowBlurRadius = 0; // Frames RectangleF frame = this.Bounds; // mmGroup { // mmShape Drawing UIBezierPath mmShapePath = new UIBezierPath(); mmShapePath.MoveTo(new PointF(frame.GetMinX() + 0.51759F * frame.Width, frame.GetMinY() + 0.96761F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.37558F * frame.Width, frame.GetMinY() + 0.91398F * frame.Height), new PointF(frame.GetMinX() + 0.46395F * frame.Width, frame.GetMinY() + 0.96761F * frame.Height), new PointF(frame.GetMinX() + 0.41351F * frame.Width, frame.GetMinY() + 0.94854F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.31759F * frame.Width, frame.GetMinY() + 0.76824F * frame.Height), new PointF(frame.GetMinX() + 0.33346F * frame.Width, frame.GetMinY() + 0.87556F * frame.Height), new PointF(frame.GetMinX() + 0.31234F * frame.Width, frame.GetMinY() + 0.82249F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.31904F * frame.Width, frame.GetMinY() + 0.75325F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.30262F * frame.Width, frame.GetMinY() + 0.75459F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.28470F * frame.Width, frame.GetMinY() + 0.75535F * frame.Height), new PointF(frame.GetMinX() + 0.29666F * frame.Width, frame.GetMinY() + 0.75510F * frame.Height), new PointF(frame.GetMinX() + 0.29065F * frame.Width, frame.GetMinY() + 0.75535F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.14274F * frame.Width, frame.GetMinY() + 0.70173F * frame.Height), new PointF(frame.GetMinX() + 0.23106F * frame.Width, frame.GetMinY() + 0.75535F * frame.Height), new PointF(frame.GetMinX() + 0.18067F * frame.Width, frame.GetMinY() + 0.73625F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.14274F * frame.Width, frame.GetMinY() + 0.44291F * frame.Height), new PointF(frame.GetMinX() + 0.06451F * frame.Width, frame.GetMinY() + 0.63038F * frame.Height), new PointF(frame.GetMinX() + 0.06451F * frame.Width, frame.GetMinY() + 0.51425F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.45528F * frame.Width, frame.GetMinY() + 0.15799F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.48085F * frame.Width, frame.GetMinY() + 0.14832F * frame.Height), new PointF(frame.GetMinX() + 0.46207F * frame.Width, frame.GetMinY() + 0.15176F * frame.Height), new PointF(frame.GetMinX() + 0.47120F * frame.Width, frame.GetMinY() + 0.14832F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.50639F * frame.Width, frame.GetMinY() + 0.15799F * frame.Height), new PointF(frame.GetMinX() + 0.49051F * frame.Width, frame.GetMinY() + 0.14832F * frame.Height), new PointF(frame.GetMinX() + 0.49957F * frame.Width, frame.GetMinY() + 0.15176F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.50639F * frame.Width, frame.GetMinY() + 0.20462F * frame.Height), new PointF(frame.GetMinX() + 0.52050F * frame.Width, frame.GetMinY() + 0.17087F * frame.Height), new PointF(frame.GetMinX() + 0.52050F * frame.Width, frame.GetMinY() + 0.19177F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.19390F * frame.Width, frame.GetMinY() + 0.48951F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.19386F * frame.Width, frame.GetMinY() + 0.65510F * frame.Height), new PointF(frame.GetMinX() + 0.14397F * frame.Width, frame.GetMinY() + 0.53518F * frame.Height), new PointF(frame.GetMinX() + 0.14397F * frame.Width, frame.GetMinY() + 0.60942F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.28476F * frame.Width, frame.GetMinY() + 0.68936F * frame.Height), new PointF(frame.GetMinX() + 0.21821F * frame.Width, frame.GetMinY() + 0.67720F * frame.Height), new PointF(frame.GetMinX() + 0.25047F * frame.Width, frame.GetMinY() + 0.68936F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.37557F * frame.Width, frame.GetMinY() + 0.65514F * frame.Height), new PointF(frame.GetMinX() + 0.31904F * frame.Width, frame.GetMinY() + 0.68936F * frame.Height), new PointF(frame.GetMinX() + 0.35128F * frame.Width, frame.GetMinY() + 0.67720F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.68812F * frame.Width, frame.GetMinY() + 0.37025F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.71365F * frame.Width, frame.GetMinY() + 0.36056F * frame.Height), new PointF(frame.GetMinX() + 0.69491F * frame.Width, frame.GetMinY() + 0.36401F * frame.Height), new PointF(frame.GetMinX() + 0.70403F * frame.Width, frame.GetMinY() + 0.36056F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.73923F * frame.Width, frame.GetMinY() + 0.37025F * frame.Height), new PointF(frame.GetMinX() + 0.72332F * frame.Width, frame.GetMinY() + 0.36056F * frame.Height), new PointF(frame.GetMinX() + 0.73241F * frame.Width, frame.GetMinY() + 0.36401F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.73923F * frame.Width, frame.GetMinY() + 0.41681F * frame.Height), new PointF(frame.GetMinX() + 0.75333F * frame.Width, frame.GetMinY() + 0.38310F * frame.Height), new PointF(frame.GetMinX() + 0.75333F * frame.Width, frame.GetMinY() + 0.40399F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.42673F * frame.Width, frame.GetMinY() + 0.70173F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.42670F * frame.Width, frame.GetMinY() + 0.86737F * frame.Height), new PointF(frame.GetMinX() + 0.37681F * frame.Width, frame.GetMinY() + 0.74744F * frame.Height), new PointF(frame.GetMinX() + 0.37681F * frame.Width, frame.GetMinY() + 0.82172F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.51759F * frame.Width, frame.GetMinY() + 0.90159F * frame.Height), new PointF(frame.GetMinX() + 0.45104F * frame.Width, frame.GetMinY() + 0.88944F * frame.Height), new PointF(frame.GetMinX() + 0.48328F * frame.Width, frame.GetMinY() + 0.90159F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.60840F * frame.Width, frame.GetMinY() + 0.86743F * frame.Height), new PointF(frame.GetMinX() + 0.55183F * frame.Width, frame.GetMinY() + 0.90159F * frame.Height), new PointF(frame.GetMinX() + 0.58413F * frame.Width, frame.GetMinY() + 0.88944F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.92092F * frame.Width, frame.GetMinY() + 0.58246F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.94646F * frame.Width, frame.GetMinY() + 0.57284F * frame.Height), new PointF(frame.GetMinX() + 0.92773F * frame.Width, frame.GetMinY() + 0.57623F * frame.Height), new PointF(frame.GetMinX() + 0.93682F * frame.Width, frame.GetMinY() + 0.57284F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.97208F * frame.Width, frame.GetMinY() + 0.58246F * frame.Height), new PointF(frame.GetMinX() + 0.95617F * frame.Width, frame.GetMinY() + 0.57284F * frame.Height), new PointF(frame.GetMinX() + 0.96523F * frame.Width, frame.GetMinY() + 0.57623F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.97208F * frame.Width, frame.GetMinY() + 0.62912F * frame.Height), new PointF(frame.GetMinX() + 0.98615F * frame.Width, frame.GetMinY() + 0.59535F * frame.Height), new PointF(frame.GetMinX() + 0.98615F * frame.Width, frame.GetMinY() + 0.61626F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.65956F * frame.Width, frame.GetMinY() + 0.91398F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.51759F * frame.Width, frame.GetMinY() + 0.96761F * frame.Height), new PointF(frame.GetMinX() + 0.62160F * frame.Width, frame.GetMinY() + 0.94854F * frame.Height), new PointF(frame.GetMinX() + 0.57117F * frame.Width, frame.GetMinY() + 0.96761F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.51759F * frame.Width, frame.GetMinY() + 0.96761F * frame.Height)); mmShapePath.ClosePath(); mmShapePath.MoveTo(new PointF(frame.GetMinX() + 0.51965F * frame.Width, frame.GetMinY() + 0.81940F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.49408F * frame.Width, frame.GetMinY() + 0.80982F * frame.Height), new PointF(frame.GetMinX() + 0.50999F * frame.Width, frame.GetMinY() + 0.81940F * frame.Height), new PointF(frame.GetMinX() + 0.50091F * frame.Width, frame.GetMinY() + 0.81600F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.49408F * frame.Width, frame.GetMinY() + 0.76313F * frame.Height), new PointF(frame.GetMinX() + 0.48000F * frame.Width, frame.GetMinY() + 0.79686F * frame.Height), new PointF(frame.GetMinX() + 0.48000F * frame.Width, frame.GetMinY() + 0.77600F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.80659F * frame.Width, frame.GetMinY() + 0.47824F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.80662F * frame.Width, frame.GetMinY() + 0.31264F * frame.Height), new PointF(frame.GetMinX() + 0.85650F * frame.Width, frame.GetMinY() + 0.43259F * frame.Height), new PointF(frame.GetMinX() + 0.85650F * frame.Width, frame.GetMinY() + 0.35831F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.71574F * frame.Width, frame.GetMinY() + 0.27840F * frame.Height), new PointF(frame.GetMinX() + 0.78226F * frame.Width, frame.GetMinY() + 0.29053F * frame.Height), new PointF(frame.GetMinX() + 0.75001F * frame.Width, frame.GetMinY() + 0.27840F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.62493F * frame.Width, frame.GetMinY() + 0.31260F * frame.Height), new PointF(frame.GetMinX() + 0.68146F * frame.Width, frame.GetMinY() + 0.27840F * frame.Height), new PointF(frame.GetMinX() + 0.64921F * frame.Width, frame.GetMinY() + 0.29053F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.31239F * frame.Width, frame.GetMinY() + 0.59752F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.28684F * frame.Width, frame.GetMinY() + 0.60718F * frame.Height), new PointF(frame.GetMinX() + 0.30556F * frame.Width, frame.GetMinY() + 0.60378F * frame.Height), new PointF(frame.GetMinX() + 0.29644F * frame.Width, frame.GetMinY() + 0.60718F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.26125F * frame.Width, frame.GetMinY() + 0.59752F * frame.Height), new PointF(frame.GetMinX() + 0.27718F * frame.Width, frame.GetMinY() + 0.60718F * frame.Height), new PointF(frame.GetMinX() + 0.26808F * frame.Width, frame.GetMinY() + 0.60378F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.26125F * frame.Width, frame.GetMinY() + 0.55093F * frame.Height), new PointF(frame.GetMinX() + 0.24715F * frame.Width, frame.GetMinY() + 0.58467F * frame.Height), new PointF(frame.GetMinX() + 0.24715F * frame.Width, frame.GetMinY() + 0.56377F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.57377F * frame.Width, frame.GetMinY() + 0.26601F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.57380F * frame.Width, frame.GetMinY() + 0.10041F * frame.Height), new PointF(frame.GetMinX() + 0.62368F * frame.Width, frame.GetMinY() + 0.22029F * frame.Height), new PointF(frame.GetMinX() + 0.62368F * frame.Width, frame.GetMinY() + 0.14606F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.48291F * frame.Width, frame.GetMinY() + 0.06617F * frame.Height), new PointF(frame.GetMinX() + 0.54946F * frame.Width, frame.GetMinY() + 0.07832F * frame.Height), new PointF(frame.GetMinX() + 0.51721F * frame.Width, frame.GetMinY() + 0.06617F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.39208F * frame.Width, frame.GetMinY() + 0.10040F * frame.Height), new PointF(frame.GetMinX() + 0.44863F * frame.Width, frame.GetMinY() + 0.06617F * frame.Height), new PointF(frame.GetMinX() + 0.41637F * frame.Width, frame.GetMinY() + 0.07832F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.07956F * frame.Width, frame.GetMinY() + 0.38530F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.05400F * frame.Width, frame.GetMinY() + 0.39496F * frame.Height), new PointF(frame.GetMinX() + 0.07274F * frame.Width, frame.GetMinY() + 0.39149F * frame.Height), new PointF(frame.GetMinX() + 0.06365F * frame.Width, frame.GetMinY() + 0.39496F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.02841F * frame.Width, frame.GetMinY() + 0.38530F * frame.Height), new PointF(frame.GetMinX() + 0.04434F * frame.Width, frame.GetMinY() + 0.39496F * frame.Height), new PointF(frame.GetMinX() + 0.03525F * frame.Width, frame.GetMinY() + 0.39149F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.02841F * frame.Width, frame.GetMinY() + 0.33867F * frame.Height), new PointF(frame.GetMinX() + 0.01434F * frame.Width, frame.GetMinY() + 0.37241F * frame.Height), new PointF(frame.GetMinX() + 0.01434F * frame.Width, frame.GetMinY() + 0.35151F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.34095F * frame.Width, frame.GetMinY() + 0.05378F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.48291F * frame.Width, frame.GetMinY() + 0.00013F * frame.Height), new PointF(frame.GetMinX() + 0.37888F * frame.Width, frame.GetMinY() + 0.01919F * frame.Height), new PointF(frame.GetMinX() + 0.42931F * frame.Width, frame.GetMinY() + 0.00013F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.62491F * frame.Width, frame.GetMinY() + 0.05378F * frame.Height), new PointF(frame.GetMinX() + 0.53657F * frame.Width, frame.GetMinY() + 0.00013F * frame.Height), new PointF(frame.GetMinX() + 0.58700F * frame.Width, frame.GetMinY() + 0.01919F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.68292F * frame.Width, frame.GetMinY() + 0.19950F * frame.Height), new PointF(frame.GetMinX() + 0.66705F * frame.Width, frame.GetMinY() + 0.09219F * frame.Height), new PointF(frame.GetMinX() + 0.68815F * frame.Width, frame.GetMinY() + 0.14529F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.68143F * frame.Width, frame.GetMinY() + 0.21454F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.69786F * frame.Width, frame.GetMinY() + 0.21318F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.71580F * frame.Width, frame.GetMinY() + 0.21244F * frame.Height), new PointF(frame.GetMinX() + 0.70379F * frame.Width, frame.GetMinY() + 0.21269F * frame.Height), new PointF(frame.GetMinX() + 0.70984F * frame.Width, frame.GetMinY() + 0.21244F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.85774F * frame.Width, frame.GetMinY() + 0.26604F * frame.Height), new PointF(frame.GetMinX() + 0.76941F * frame.Width, frame.GetMinY() + 0.21244F * frame.Height), new PointF(frame.GetMinX() + 0.81981F * frame.Width, frame.GetMinY() + 0.23147F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.85774F * frame.Width, frame.GetMinY() + 0.52485F * frame.Height), new PointF(frame.GetMinX() + 0.93599F * frame.Width, frame.GetMinY() + 0.33738F * frame.Height), new PointF(frame.GetMinX() + 0.93599F * frame.Width, frame.GetMinY() + 0.45349F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.54521F * frame.Width, frame.GetMinY() + 0.80977F * frame.Height)); mmShapePath.AddCurveToPoint( new PointF(frame.GetMinX() + 0.51965F * frame.Width, frame.GetMinY() + 0.81940F * frame.Height), new PointF(frame.GetMinX() + 0.53840F * frame.Width, frame.GetMinY() + 0.81600F * frame.Height), new PointF(frame.GetMinX() + 0.52930F * frame.Width, frame.GetMinY() + 0.81940F * frame.Height)); mmShapePath.AddLineTo(new PointF(frame.GetMinX() + 0.51965F * frame.Width, frame.GetMinY() + 0.81940F * frame.Height)); mmShapePath.ClosePath(); context.SaveState(); context.SetShadowWithColor(mmDropShadowOffset, mmDropShadowBlurRadius, mmDropShadow.CGColor); context.SetBlendMode(CGBlendMode.Overlay); mmFill.SetFill(); mmShapePath.Fill(); RectangleF mmShapeBorderRect = RectangleF.Inflate(mmShapePath.Bounds, mmInnerShadowBlurRadius, mmInnerShadowBlurRadius); mmShapeBorderRect.Offset(mmInnerShadowOffset.Width, mmInnerShadowOffset.Height); mmShapeBorderRect.UnionWith(mmShapePath.Bounds); UIBezierPath mmShapeNegativePath = UIBezierPath.FromRect(mmShapeBorderRect); mmShapeNegativePath.AppendPath(mmShapePath); mmShapeNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { Single xOffset = mmInnerShadowOffset.Width + (float)Math.Round(mmShapeBorderRect.Size.Width); Single yOffset = mmInnerShadowOffset.Height; context.SetShadowWithColor(new SizeF(xOffset + CopySign(0.1F, xOffset), yOffset + CopySign(0.1F, yOffset)), mmInnerShadowBlurRadius, mmInnerShadow.CGColor); mmShapePath.AddClip(); CGAffineTransform transform = CGAffineTransform.MakeTranslation((float)-Math.Round(mmShapeBorderRect.Size.Width), 0F); mmShapeNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); mmShapeNegativePath.Fill(); } context.RestoreState(); context.RestoreState(); } }
static void paintCodeRetina() { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor color3 = UIColor.FromRGBA(0.000f, 0.200f, 0.067f, 1.000f); UIColor color5 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); UIColor color6 = UIColor.FromRGBA(0.200f, 0.067f, 0.000f, 1.000f); UIColor color7 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 0.000f); UIColor color8 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); //// Shadow Declarations var shadow = color6.CGColor; var shadowOffset = new SizeF(0.1f, 1.1f); var shadowBlurRadius = 11.5f; //// Bezier 17 Drawing UIBezierPath bezier17Path = new UIBezierPath(); bezier17Path.MoveTo(new PointF(31.5f, 57.5f)); bezier17Path.AddCurveToPoint(new PointF(34.47f, 57.42f), new PointF(32.56f, 57.47f), new PointF(33.55f, 57.44f)); bezier17Path.AddCurveToPoint(new PointF(55.5f, 56.5f), new PointF(46.81f, 57.12f), new PointF(46.72f, 57.4f)); bezier17Path.AddCurveToPoint(new PointF(79.5f, 53.5f), new PointF(64.93f, 55.53f), new PointF(79.5f, 53.5f)); color6.SetStroke(); bezier17Path.LineWidth = 3; bezier17Path.Stroke(); //// Eyelash { //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(8.5f, 32.5f)); bezierPath.AddCurveToPoint(new PointF(37.44f, 16.5f), new PointF(14.12f, 32.02f), new PointF(25.32f, 20.81f)); bezierPath.AddCurveToPoint(new PointF(69.13f, 16.5f), new PointF(52.35f, 11.19f), new PointF(67.2f, 16.63f)); bezierPath.AddCurveToPoint(new PointF(95.77f, 32.5f), new PointF(72.68f, 16.25f), new PointF(95.77f, 32.5f)); color6.SetStroke(); bezierPath.LineWidth = 3; bezierPath.Stroke(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(0.23f, 16.5f)); bezier2Path.AddCurveToPoint(new PointF(6.71f, 24.6f), new PointF(0.23f, 16.5f), new PointF(4.58f, 22.88f)); bezier2Path.AddCurveToPoint(new PointF(14.01f, 30.5f), new PointF(14.01f, 30.5f), new PointF(14.01f, 30.5f)); color6.SetStroke(); bezier2Path.LineWidth = 3; bezier2Path.Stroke(); //// Bezier 3 Drawing UIBezierPath bezier3Path = new UIBezierPath(); bezier3Path.MoveTo(new PointF(3.9f, 11.5f)); bezier3Path.AddCurveToPoint(new PointF(10.38f, 19.6f), new PointF(3.9f, 11.5f), new PointF(8.25f, 17.88f)); bezier3Path.AddCurveToPoint(new PointF(18.6f, 26.5f), new PointF(17.68f, 25.5f), new PointF(18.6f, 26.5f)); color6.SetStroke(); bezier3Path.LineWidth = 3; bezier3Path.Stroke(); //// Bezier 4 Drawing UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new PointF(10.79f, 9.5f)); bezier4Path.AddCurveToPoint(new PointF(17.27f, 17.6f), new PointF(10.79f, 9.5f), new PointF(15.14f, 15.88f)); bezier4Path.AddCurveToPoint(new PointF(24.57f, 23.5f), new PointF(24.57f, 23.5f), new PointF(24.57f, 23.5f)); color6.SetStroke(); bezier4Path.LineWidth = 3; bezier4Path.Stroke(); //// Bezier 5 Drawing UIBezierPath bezier5Path = new UIBezierPath(); bezier5Path.MoveTo(new PointF(17.68f, 4.5f)); bezier5Path.AddCurveToPoint(new PointF(24.16f, 12.6f), new PointF(17.68f, 4.5f), new PointF(22.03f, 10.88f)); bezier5Path.AddCurveToPoint(new PointF(31.46f, 18.5f), new PointF(31.46f, 18.5f), new PointF(31.46f, 18.5f)); color6.SetStroke(); bezier5Path.LineWidth = 3; bezier5Path.Stroke(); //// Bezier 6 Drawing UIBezierPath bezier6Path = new UIBezierPath(); bezier6Path.MoveTo(new PointF(13.55f, 8.5f)); bezier6Path.AddCurveToPoint(new PointF(27.79f, 20.5f), new PointF(27.24f, 20.5f), new PointF(27.79f, 20.5f)); color6.SetStroke(); bezier6Path.LineWidth = 3; bezier6Path.Stroke(); //// Bezier 7 Drawing UIBezierPath bezier7Path = new UIBezierPath(); bezier7Path.MoveTo(new PointF(34.68f, 17.5f)); bezier7Path.AddCurveToPoint(new PointF(29.17f, 12.5f), new PointF(32.71f, 14.7f), new PointF(30.47f, 14.41f)); bezier7Path.AddCurveToPoint(new PointF(24.11f, 1.5f), new PointF(23.48f, 4.18f), new PointF(24.11f, 1.5f)); color6.SetStroke(); bezier7Path.LineWidth = 3; bezier7Path.Stroke(); //// Bezier 8 Drawing UIBezierPath bezier8Path = new UIBezierPath(); bezier8Path.MoveTo(new PointF(27.79f, 2.5f)); bezier8Path.AddCurveToPoint(new PointF(34.27f, 10.6f), new PointF(27.79f, 2.5f), new PointF(32.14f, 8.88f)); bezier8Path.AddCurveToPoint(new PointF(41.57f, 16.5f), new PointF(41.57f, 16.5f), new PointF(41.57f, 16.5f)); color6.SetStroke(); bezier8Path.LineWidth = 3; bezier8Path.Stroke(); //// Bezier 9 Drawing UIBezierPath bezier9Path = new UIBezierPath(); bezier9Path.MoveTo(new PointF(31.46f, 0.5f)); bezier9Path.AddCurveToPoint(new PointF(37.94f, 8.6f), new PointF(31.46f, 0.5f), new PointF(35.81f, 6.88f)); bezier9Path.AddCurveToPoint(new PointF(45.24f, 14.5f), new PointF(45.24f, 14.5f), new PointF(45.24f, 14.5f)); color6.SetStroke(); bezier9Path.LineWidth = 3; bezier9Path.Stroke(); //// Bezier 10 Drawing UIBezierPath bezier10Path = new UIBezierPath(); bezier10Path.MoveTo(new PointF(38.35f, 0.5f)); bezier10Path.AddCurveToPoint(new PointF(44.83f, 8.6f), new PointF(38.35f, 0.5f), new PointF(42.7f, 6.88f)); bezier10Path.AddCurveToPoint(new PointF(52.13f, 14.5f), new PointF(52.13f, 14.5f), new PointF(52.13f, 14.5f)); color6.SetStroke(); bezier10Path.LineWidth = 3; bezier10Path.Stroke(); //// Bezier 11 Drawing UIBezierPath bezier11Path = new UIBezierPath(); bezier11Path.MoveTo(new PointF(45.24f, 0.5f)); bezier11Path.AddCurveToPoint(new PointF(51.72f, 8.6f), new PointF(45.24f, 0.5f), new PointF(49.59f, 6.88f)); bezier11Path.AddCurveToPoint(new PointF(59.02f, 14.5f), new PointF(59.02f, 14.5f), new PointF(59.02f, 14.5f)); color6.SetStroke(); bezier11Path.LineWidth = 3; bezier11Path.Stroke(); //// Bezier 12 Drawing UIBezierPath bezier12Path = new UIBezierPath(); bezier12Path.MoveTo(new PointF(52.13f, 2.5f)); bezier12Path.AddCurveToPoint(new PointF(58.61f, 10.6f), new PointF(52.13f, 2.5f), new PointF(56.48f, 8.88f)); bezier12Path.AddCurveToPoint(new PointF(65.91f, 16.5f), new PointF(65.91f, 16.5f), new PointF(65.91f, 16.5f)); color6.SetStroke(); bezier12Path.LineWidth = 3; bezier12Path.Stroke(); //// Bezier 13 Drawing UIBezierPath bezier13Path = new UIBezierPath(); bezier13Path.MoveTo(new PointF(59.02f, 3.5f)); bezier13Path.AddCurveToPoint(new PointF(65.5f, 11.6f), new PointF(59.02f, 3.5f), new PointF(63.37f, 9.88f)); bezier13Path.AddCurveToPoint(new PointF(72.8f, 17.5f), new PointF(72.8f, 17.5f), new PointF(72.8f, 17.5f)); color6.SetStroke(); bezier13Path.LineWidth = 3; bezier13Path.Stroke(); //// Bezier 14 Drawing UIBezierPath bezier14Path = new UIBezierPath(); bezier14Path.MoveTo(new PointF(66.5f, 3.5f)); bezier14Path.AddLineTo(new PointF(82.45f, 22.5f)); color6.SetStroke(); bezier14Path.LineWidth = 3; bezier14Path.Stroke(); //// Bezier 15 Drawing UIBezierPath bezier15Path = new UIBezierPath(); bezier15Path.MoveTo(new PointF(82.5f, 7.5f)); bezier15Path.AddCurveToPoint(new PointF(95.77f, 31.5f), new PointF(89.8f, 13.4f), new PointF(95.77f, 31.5f)); color6.SetStroke(); bezier15Path.LineWidth = 3; bezier15Path.Stroke(); //// Bezier 16 Drawing UIBezierPath bezier16Path = new UIBezierPath(); bezier16Path.MoveTo(new PointF(75.56f, 6.5f)); bezier16Path.AddCurveToPoint(new PointF(88.42f, 26.5f), new PointF(82.86f, 12.4f), new PointF(88.42f, 26.5f)); color6.SetStroke(); bezier16Path.LineWidth = 3; bezier16Path.Stroke(); } //// Oval Drawing var ovalPath = UIBezierPath.FromOval(new RectangleF(29.5f, 22.5f, 48, 34)); color3.SetFill(); ovalPath.Fill(); ////// Oval Inner Shadow var ovalBorderRect = ovalPath.Bounds; ovalBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); ovalBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); ovalBorderRect = RectangleF.Union(ovalBorderRect, ovalPath.Bounds); ovalBorderRect.Inflate(1, 1); var ovalNegativePath = UIBezierPath.FromRect(ovalBorderRect); ovalNegativePath.AppendPath(ovalPath); ovalNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(ovalBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); ovalPath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(ovalBorderRect.Width), 0); ovalNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); ovalNegativePath.Fill(); } context.RestoreState(); color7.SetStroke(); ovalPath.LineWidth = 1; ovalPath.Stroke(); //// Oval 3 Drawing var oval3Path = UIBezierPath.FromOval(new RectangleF(44.5f, 32.5f, 18, 13)); color5.SetFill(); oval3Path.Fill(); color5.SetStroke(); oval3Path.LineWidth = 1; oval3Path.Stroke(); //// Oval 2 Drawing var oval2Path = UIBezierPath.FromOval(new RectangleF(60.5f, 27.5f, 12, 7)); color8.SetFill(); oval2Path.Fill(); color7.SetStroke(); oval2Path.LineWidth = 1; oval2Path.Stroke(); //// Oval 4 Drawing var oval4Path = UIBezierPath.FromOval(new RectangleF(31.5f, 34.5f, 9, 11)); color8.SetFill(); oval4Path.Fill(); color7.SetStroke(); oval4Path.LineWidth = 1; oval4Path.Stroke(); //// Oval 5 Drawing var oval5Path = UIBezierPath.FromOval(new RectangleF(43.5f, 45.5f, 9, 8)); color8.SetFill(); oval5Path.Fill(); color7.SetStroke(); oval5Path.LineWidth = 1; oval5Path.Stroke(); //// Bezier 18 Drawing UIBezierPath bezier18Path = new UIBezierPath(); bezier18Path.MoveTo(new PointF(47.5f, 23.5f)); bezier18Path.AddCurveToPoint(new PointF(65.5f, 26.5f), new PointF(57.41f, 21.14f), new PointF(70.33f, 23.82f)); bezier18Path.AddCurveToPoint(new PointF(60.3f, 30.41f), new PointF(62.62f, 28.1f), new PointF(61.08f, 29.39f)); bezier18Path.AddCurveToPoint(new PointF(60.5f, 33.5f), new PointF(58.65f, 32.57f), new PointF(60.5f, 33.5f)); bezier18Path.AddCurveToPoint(new PointF(52.5f, 31.5f), new PointF(60.5f, 33.5f), new PointF(56.21f, 31.49f)); bezier18Path.AddCurveToPoint(new PointF(47.5f, 33.5f), new PointF(48.79f, 31.51f), new PointF(47.5f, 33.5f)); bezier18Path.AddLineTo(new PointF(44.5f, 36.5f)); bezier18Path.AddLineTo(new PointF(33.5f, 33.5f)); bezier18Path.AddCurveToPoint(new PointF(47.5f, 23.5f), new PointF(33.5f, 33.5f), new PointF(38.95f, 25.54f)); bezier18Path.ClosePath(); color3.SetFill(); bezier18Path.Fill(); ////// Bezier 18 Inner Shadow var bezier18BorderRect = bezier18Path.Bounds; bezier18BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier18BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier18BorderRect = RectangleF.Union(bezier18BorderRect, bezier18Path.Bounds); bezier18BorderRect.Inflate(1, 1); var bezier18NegativePath = UIBezierPath.FromRect(bezier18BorderRect); bezier18NegativePath.AppendPath(bezier18Path); bezier18NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier18BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier18Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier18BorderRect.Width), 0); bezier18NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier18NegativePath.Fill(); } context.RestoreState(); color7.SetStroke(); bezier18Path.LineWidth = 1; bezier18Path.Stroke(); }
static void paintCodeNonRetina() { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor color3 = UIColor.FromRGBA(0.000f, 0.200f, 0.067f, 1.000f); UIColor color5 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); UIColor color6 = UIColor.FromRGBA(0.200f, 0.067f, 0.000f, 1.000f); UIColor color7 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 0.000f); UIColor color8 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); //// Shadow Declarations var shadow = color6.CGColor; var shadowOffset = new SizeF(0.1f, 1.1f); var shadowBlurRadius = 11.5f; //// Group { //// Bezier 17 Drawing UIBezierPath bezier17Path = new UIBezierPath(); bezier17Path.MoveTo(new PointF(15.75f, 31.72f)); bezier17Path.AddCurveToPoint(new PointF(17.23f, 31.68f), new PointF(16.28f, 31.71f), new PointF(16.78f, 31.69f)); bezier17Path.AddCurveToPoint(new PointF(27.75f, 31.17f), new PointF(23.41f, 31.51f), new PointF(23.36f, 31.67f)); bezier17Path.AddCurveToPoint(new PointF(39.75f, 29.52f), new PointF(32.47f, 30.64f), new PointF(39.75f, 29.52f)); color6.SetStroke(); bezier17Path.LineWidth = 3; bezier17Path.Stroke(); //// Eyelash { //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(4.25f, 17.73f)); bezierPath.AddCurveToPoint(new PointF(18.72f, 9), new PointF(7.06f, 17.46f), new PointF(12.66f, 11.35f)); bezierPath.AddCurveToPoint(new PointF(34.56f, 9), new PointF(26.18f, 6.1f), new PointF(33.6f, 9.07f)); bezierPath.AddCurveToPoint(new PointF(47.89f, 17.73f), new PointF(36.34f, 8.86f), new PointF(47.89f, 17.73f)); color6.SetStroke(); bezierPath.LineWidth = 3; bezierPath.Stroke(); //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(0.11f, 9)); bezier2Path.AddCurveToPoint(new PointF(3.35f, 13.42f), new PointF(0.11f, 9), new PointF(2.29f, 12.48f)); bezier2Path.AddCurveToPoint(new PointF(7, 16.64f), new PointF(7, 16.64f), new PointF(7, 16.64f)); color6.SetStroke(); bezier2Path.LineWidth = 3; bezier2Path.Stroke(); //// Bezier 3 Drawing UIBezierPath bezier3Path = new UIBezierPath(); bezier3Path.MoveTo(new PointF(1.95f, 6.27f)); bezier3Path.AddCurveToPoint(new PointF(5.19f, 10.69f), new PointF(1.95f, 6.27f), new PointF(4.13f, 9.75f)); bezier3Path.AddCurveToPoint(new PointF(9.3f, 14.45f), new PointF(8.84f, 13.91f), new PointF(9.3f, 14.45f)); color6.SetStroke(); bezier3Path.LineWidth = 3; bezier3Path.Stroke(); //// Bezier 4 Drawing UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new PointF(5.4f, 5.18f)); bezier4Path.AddCurveToPoint(new PointF(8.64f, 9.6f), new PointF(5.4f, 5.18f), new PointF(7.57f, 8.66f)); bezier4Path.AddCurveToPoint(new PointF(12.29f, 12.82f), new PointF(12.29f, 12.82f), new PointF(12.29f, 12.82f)); color6.SetStroke(); bezier4Path.LineWidth = 3; bezier4Path.Stroke(); //// Bezier 5 Drawing UIBezierPath bezier5Path = new UIBezierPath(); bezier5Path.MoveTo(new PointF(8.84f, 2.45f)); bezier5Path.AddCurveToPoint(new PointF(12.08f, 6.87f), new PointF(8.84f, 2.45f), new PointF(11.02f, 5.93f)); bezier5Path.AddCurveToPoint(new PointF(15.73f, 10.09f), new PointF(15.73f, 10.09f), new PointF(15.73f, 10.09f)); color6.SetStroke(); bezier5Path.LineWidth = 3; bezier5Path.Stroke(); //// Bezier 6 Drawing UIBezierPath bezier6Path = new UIBezierPath(); bezier6Path.MoveTo(new PointF(6.78f, 4.64f)); bezier6Path.AddCurveToPoint(new PointF(13.89f, 11.18f), new PointF(13.62f, 11.18f), new PointF(13.89f, 11.18f)); color6.SetStroke(); bezier6Path.LineWidth = 3; bezier6Path.Stroke(); //// Bezier 7 Drawing UIBezierPath bezier7Path = new UIBezierPath(); bezier7Path.MoveTo(new PointF(17.34f, 9.55f)); bezier7Path.AddCurveToPoint(new PointF(14.58f, 6.82f), new PointF(16.35f, 8.02f), new PointF(15.24f, 7.86f)); bezier7Path.AddCurveToPoint(new PointF(12.06f, 0.82f), new PointF(11.74f, 2.28f), new PointF(12.06f, 0.82f)); color6.SetStroke(); bezier7Path.LineWidth = 3; bezier7Path.Stroke(); //// Bezier 8 Drawing UIBezierPath bezier8Path = new UIBezierPath(); bezier8Path.MoveTo(new PointF(13.89f, 1.36f)); bezier8Path.AddCurveToPoint(new PointF(17.13f, 5.78f), new PointF(13.89f, 1.36f), new PointF(16.07f, 4.84f)); bezier8Path.AddCurveToPoint(new PointF(20.78f, 9), new PointF(20.78f, 9), new PointF(20.78f, 9)); color6.SetStroke(); bezier8Path.LineWidth = 3; bezier8Path.Stroke(); //// Bezier 9 Drawing UIBezierPath bezier9Path = new UIBezierPath(); bezier9Path.MoveTo(new PointF(15.73f, 0.27f)); bezier9Path.AddCurveToPoint(new PointF(18.97f, 4.69f), new PointF(15.73f, 0.27f), new PointF(17.91f, 3.75f)); bezier9Path.AddCurveToPoint(new PointF(22.62f, 7.91f), new PointF(22.62f, 7.91f), new PointF(22.62f, 7.91f)); color6.SetStroke(); bezier9Path.LineWidth = 3; bezier9Path.Stroke(); //// Bezier 10 Drawing UIBezierPath bezier10Path = new UIBezierPath(); bezier10Path.MoveTo(new PointF(19.18f, 0.27f)); bezier10Path.AddCurveToPoint(new PointF(22.42f, 4.69f), new PointF(19.18f, 0.27f), new PointF(21.35f, 3.75f)); bezier10Path.AddCurveToPoint(new PointF(26.07f, 7.91f), new PointF(26.07f, 7.91f), new PointF(26.07f, 7.91f)); color6.SetStroke(); bezier10Path.LineWidth = 3; bezier10Path.Stroke(); //// Bezier 11 Drawing UIBezierPath bezier11Path = new UIBezierPath(); bezier11Path.MoveTo(new PointF(22.62f, 0.27f)); bezier11Path.AddCurveToPoint(new PointF(25.86f, 4.69f), new PointF(22.62f, 0.27f), new PointF(24.8f, 3.75f)); bezier11Path.AddCurveToPoint(new PointF(29.51f, 7.91f), new PointF(29.51f, 7.91f), new PointF(29.51f, 7.91f)); color6.SetStroke(); bezier11Path.LineWidth = 3; bezier11Path.Stroke(); //// Bezier 12 Drawing UIBezierPath bezier12Path = new UIBezierPath(); bezier12Path.MoveTo(new PointF(26.07f, 1.36f)); bezier12Path.AddCurveToPoint(new PointF(29.31f, 5.78f), new PointF(26.07f, 1.36f), new PointF(28.24f, 4.84f)); bezier12Path.AddCurveToPoint(new PointF(32.96f, 9), new PointF(32.96f, 9), new PointF(32.96f, 9)); color6.SetStroke(); bezier12Path.LineWidth = 3; bezier12Path.Stroke(); //// Bezier 13 Drawing UIBezierPath bezier13Path = new UIBezierPath(); bezier13Path.MoveTo(new PointF(29.51f, 1.91f)); bezier13Path.AddCurveToPoint(new PointF(32.75f, 6.33f), new PointF(29.51f, 1.91f), new PointF(31.69f, 5.39f)); bezier13Path.AddCurveToPoint(new PointF(36.4f, 9.55f), new PointF(36.4f, 9.55f), new PointF(36.4f, 9.55f)); color6.SetStroke(); bezier13Path.LineWidth = 3; bezier13Path.Stroke(); //// Bezier 14 Drawing UIBezierPath bezier14Path = new UIBezierPath(); bezier14Path.MoveTo(new PointF(33.25f, 1.91f)); bezier14Path.AddLineTo(new PointF(41.22f, 12.27f)); color6.SetStroke(); bezier14Path.LineWidth = 3; bezier14Path.Stroke(); //// Bezier 15 Drawing UIBezierPath bezier15Path = new UIBezierPath(); bezier15Path.MoveTo(new PointF(41.25f, 4.09f)); bezier15Path.AddCurveToPoint(new PointF(47.89f, 17.18f), new PointF(44.9f, 7.31f), new PointF(47.89f, 17.18f)); color6.SetStroke(); bezier15Path.LineWidth = 3; bezier15Path.Stroke(); //// Bezier 16 Drawing UIBezierPath bezier16Path = new UIBezierPath(); bezier16Path.MoveTo(new PointF(37.78f, 3.55f)); bezier16Path.AddCurveToPoint(new PointF(44.21f, 14.45f), new PointF(41.43f, 6.76f), new PointF(44.21f, 14.45f)); color6.SetStroke(); bezier16Path.LineWidth = 3; bezier16Path.Stroke(); } //// Oval Drawing var ovalPath = UIBezierPath.FromOval(new RectangleF(14.5f, 12.5f, 24, 19)); color3.SetFill(); ovalPath.Fill(); ////// Oval Inner Shadow var ovalBorderRect = ovalPath.Bounds; ovalBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); ovalBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); ovalBorderRect = RectangleF.Union(ovalBorderRect, ovalPath.Bounds); ovalBorderRect.Inflate(1, 1); var ovalNegativePath = UIBezierPath.FromRect(ovalBorderRect); ovalNegativePath.AppendPath(ovalPath); ovalNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(ovalBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); ovalPath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(ovalBorderRect.Width), 0); ovalNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); ovalNegativePath.Fill(); } context.RestoreState(); color7.SetStroke(); ovalPath.LineWidth = 1; ovalPath.Stroke(); //// Oval 3 Drawing var oval3Path = UIBezierPath.FromOval(new RectangleF(22.5f, 17.5f, 9, 8)); color5.SetFill(); oval3Path.Fill(); color5.SetStroke(); oval3Path.LineWidth = 1; oval3Path.Stroke(); //// Oval 2 Drawing var oval2Path = UIBezierPath.FromOval(new RectangleF(30.5f, 15.5f, 6, 4)); color8.SetFill(); oval2Path.Fill(); color7.SetStroke(); oval2Path.LineWidth = 1; oval2Path.Stroke(); //// Oval 4 Drawing var oval4Path = UIBezierPath.FromOval(new RectangleF(15.5f, 19.5f, 5, 6)); color8.SetFill(); oval4Path.Fill(); color7.SetStroke(); oval4Path.LineWidth = 1; oval4Path.Stroke(); //// Oval 5 Drawing var oval5Path = UIBezierPath.FromOval(new RectangleF(21.5f, 25.5f, 5, 4)); color8.SetFill(); oval5Path.Fill(); color7.SetStroke(); oval5Path.LineWidth = 1; oval5Path.Stroke(); //// Bezier 18 Drawing UIBezierPath bezier18Path = new UIBezierPath(); bezier18Path.MoveTo(new PointF(23.75f, 12.97f)); bezier18Path.AddCurveToPoint(new PointF(32.75f, 14.62f), new PointF(28.7f, 11.66f), new PointF(35.17f, 13.14f)); bezier18Path.AddCurveToPoint(new PointF(30.15f, 16.78f), new PointF(31.31f, 15.5f), new PointF(30.54f, 16.21f)); bezier18Path.AddCurveToPoint(new PointF(30.25f, 18.48f), new PointF(29.32f, 17.97f), new PointF(30.25f, 18.48f)); bezier18Path.AddCurveToPoint(new PointF(26.25f, 17.38f), new PointF(30.25f, 18.48f), new PointF(28.1f, 17.38f)); bezier18Path.AddCurveToPoint(new PointF(23.75f, 18.48f), new PointF(24.4f, 17.38f), new PointF(23.75f, 18.48f)); bezier18Path.AddLineTo(new PointF(22.25f, 20.14f)); bezier18Path.AddLineTo(new PointF(16.75f, 18.48f)); bezier18Path.AddCurveToPoint(new PointF(23.75f, 12.97f), new PointF(16.75f, 18.48f), new PointF(19.48f, 14.09f)); bezier18Path.ClosePath(); color3.SetFill(); bezier18Path.Fill(); ////// Bezier 18 Inner Shadow var bezier18BorderRect = bezier18Path.Bounds; bezier18BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier18BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier18BorderRect = RectangleF.Union(bezier18BorderRect, bezier18Path.Bounds); bezier18BorderRect.Inflate(1, 1); var bezier18NegativePath = UIBezierPath.FromRect(bezier18BorderRect); bezier18NegativePath.AppendPath(bezier18Path); bezier18NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier18BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier18Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier18BorderRect.Width), 0); bezier18NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier18NegativePath.Fill(); } context.RestoreState(); color7.SetStroke(); bezier18Path.LineWidth = 1; bezier18Path.Stroke(); } }
void DrawCrayon(CGContext context, Crayon crayon) { // I <3 Paintcode //// Color Declarations var gradientColor = UIColor.FromRGBA(crayon.R / 255f, crayon.G / 255f, crayon.B / 255f, 1.00f); var gradientColor2 = UIColor.FromRGBA(crayon.R / 255f, crayon.G / 255f, crayon.B / 255f, 0.69f); var gradientColor3 = UIColor.FromRGBA(crayon.R / 255f, crayon.G / 255f, crayon.B / 255f, 0.37f); //// Gradient Declarations var gradientColors = new CGColor [] { gradientColor.CGColor, gradientColor2.CGColor, gradientColor3.CGColor, gradientColor2.CGColor, gradientColor.CGColor }; var gradientLocations = new float [] {0, 0.37f, 0.66f, 1, 1}; var gradient = new CGGradient(colorSpace, gradientColors, gradientLocations); //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRoundedRect(new RectangleF(0.5f, 20.5f, 25, 100), UIRectCorner.TopLeft | UIRectCorner.TopRight, new SizeF(8, 8)); context.SaveState(); rectanglePath.AddClip(); context.DrawLinearGradient(gradient, new PointF(0.5f, 70.5f), new PointF(25.5f, 70.5f), 0); context.RestoreState(); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(3.5f, 24.5f)); bezierPath.AddCurveToPoint(new PointF(12, 0.09f), new PointF(6.5f, 17.57f), new PointF(9.79f, -4.27f)); bezierPath.AddCurveToPoint(new PointF(22.5f, 24.5f), new PointF(16.3f, 8.57f), new PointF(22.5f, 24.5f)); context.SaveState(); bezierPath.AddClip(); context.DrawLinearGradient(gradient, new PointF(3.5f, 12.01f), new PointF(22.5f, 12.01f), 0); context.RestoreState(); }
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(); } }
static void paintCodeNonRetina() { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor shadowColor2 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 0.413f); UIColor color5 = UIColor.FromRGBA(0.200f, 0.067f, 0.000f, 1.000f); //// Shadow Declarations var shadow = shadowColor2.CGColor; var shadowOffset = new SizeF(0.1f, 1.1f); var shadowBlurRadius = 10; //// Group { //// Rectangle 5 Drawing UIBezierPath rectangle5Path = new UIBezierPath(); rectangle5Path.MoveTo(new PointF(4.04f, 7.93f)); rectangle5Path.AddLineTo(new PointF(4.04f, 7.97f)); rectangle5Path.AddLineTo(new PointF(4.04f, 7.93f)); rectangle5Path.ClosePath(); rectangle5Path.MoveTo(new PointF(4.43f, 11.5f)); rectangle5Path.AddLineTo(new PointF(4.43f, 4)); rectangle5Path.AddLineTo(new PointF(5.51f, 5.32f)); rectangle5Path.AddLineTo(new PointF(5.6f, 13.71f)); rectangle5Path.AddLineTo(new PointF(4.43f, 11.5f)); rectangle5Path.ClosePath(); color5.SetFill(); rectangle5Path.Fill(); ////// Rectangle 5 Inner Shadow var rectangle5BorderRect = rectangle5Path.Bounds; rectangle5BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle5BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle5BorderRect = RectangleF.Union(rectangle5BorderRect, rectangle5Path.Bounds); rectangle5BorderRect.Inflate(1, 1); var rectangle5NegativePath = UIBezierPath.FromRect(rectangle5BorderRect); rectangle5NegativePath.AppendPath(rectangle5Path); rectangle5NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle5BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectangle5Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle5BorderRect.Width), 0); rectangle5NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle5NegativePath.Fill(); } context.RestoreState(); color5.SetStroke(); rectangle5Path.LineWidth = 1; rectangle5Path.Stroke(); //// Rectangle 4 Drawing UIBezierPath rectangle4Path = new UIBezierPath(); rectangle4Path.MoveTo(new PointF(36.78f, 21.82f)); rectangle4Path.AddLineTo(new PointF(36.78f, 21.82f)); rectangle4Path.AddLineTo(new PointF(36.78f, 21.82f)); rectangle4Path.ClosePath(); rectangle4Path.MoveTo(new PointF(36.96f, 26.6f)); rectangle4Path.AddLineTo(new PointF(36.96f, 17.15f)); rectangle4Path.AddLineTo(new PointF(39.92f, 18.33f)); rectangle4Path.AddLineTo(new PointF(39.92f, 28.96f)); rectangle4Path.AddLineTo(new PointF(36.96f, 26.6f)); rectangle4Path.ClosePath(); color5.SetFill(); rectangle4Path.Fill(); ////// Rectangle 4 Inner Shadow var rectangle4BorderRect = rectangle4Path.Bounds; rectangle4BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle4BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle4BorderRect = RectangleF.Union(rectangle4BorderRect, rectangle4Path.Bounds); rectangle4BorderRect.Inflate(1, 1); var rectangle4NegativePath = UIBezierPath.FromRect(rectangle4BorderRect); rectangle4NegativePath.AppendPath(rectangle4Path); rectangle4NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle4BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectangle4Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle4BorderRect.Width), 0); rectangle4NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle4NegativePath.Fill(); } context.RestoreState(); color5.SetStroke(); rectangle4Path.LineWidth = 1; rectangle4Path.Stroke(); //// Rectangle 6 Drawing UIBezierPath rectangle6Path = new UIBezierPath(); rectangle6Path.MoveTo(new PointF(13.62f, 22.66f)); rectangle6Path.AddLineTo(new PointF(13.62f, 22.66f)); rectangle6Path.AddLineTo(new PointF(13.62f, 22.66f)); rectangle6Path.ClosePath(); rectangle6Path.MoveTo(new PointF(13.74f, 26.87f)); rectangle6Path.AddLineTo(new PointF(13.74f, 15.69f)); rectangle6Path.AddLineTo(new PointF(15.75f, 19.58f)); rectangle6Path.AddLineTo(new PointF(15.75f, 28.96f)); rectangle6Path.AddLineTo(new PointF(13.74f, 26.87f)); rectangle6Path.ClosePath(); color5.SetFill(); rectangle6Path.Fill(); ////// Rectangle 6 Inner Shadow var rectangle6BorderRect = rectangle6Path.Bounds; rectangle6BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle6BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle6BorderRect = RectangleF.Union(rectangle6BorderRect, rectangle6Path.Bounds); rectangle6BorderRect.Inflate(1, 1); var rectangle6NegativePath = UIBezierPath.FromRect(rectangle6BorderRect); rectangle6NegativePath.AppendPath(rectangle6Path); rectangle6NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle6BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectangle6Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle6BorderRect.Width), 0); rectangle6NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle6NegativePath.Fill(); } context.RestoreState(); color5.SetStroke(); rectangle6Path.LineWidth = 1; rectangle6Path.Stroke(); //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRect(new RectangleF(16.5f, 19.5f, 4, 9)); color5.SetFill(); rectanglePath.Fill(); ////// Rectangle Inner Shadow var rectangleBorderRect = rectanglePath.Bounds; rectangleBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangleBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangleBorderRect = RectangleF.Union(rectangleBorderRect, rectanglePath.Bounds); rectangleBorderRect.Inflate(1, 1); var rectangleNegativePath = UIBezierPath.FromRect(rectangleBorderRect); rectangleNegativePath.AppendPath(rectanglePath); rectangleNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangleBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectanglePath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangleBorderRect.Width), 0); rectangleNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangleNegativePath.Fill(); } context.RestoreState(); color5.SetStroke(); rectanglePath.LineWidth = 1; rectanglePath.Stroke(); //// Rectangle 2 Drawing var rectangle2Path = UIBezierPath.FromRect(new RectangleF(5.5f, 6.5f, 3, 7)); color5.SetFill(); rectangle2Path.Fill(); ////// Rectangle 2 Inner Shadow var rectangle2BorderRect = rectangle2Path.Bounds; rectangle2BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle2BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle2BorderRect = RectangleF.Union(rectangle2BorderRect, rectangle2Path.Bounds); rectangle2BorderRect.Inflate(1, 1); var rectangle2NegativePath = UIBezierPath.FromRect(rectangle2BorderRect); rectangle2NegativePath.AppendPath(rectangle2Path); rectangle2NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle2BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectangle2Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle2BorderRect.Width), 0); rectangle2NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle2NegativePath.Fill(); } context.RestoreState(); color5.SetStroke(); rectangle2Path.LineWidth = 1; rectangle2Path.Stroke(); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(4.67f, 4.04f)); bezierPath.AddLineTo(new PointF(15.25f, 18.72f)); bezierPath.AddLineTo(new PointF(44.45f, 18.72f)); bezierPath.AddLineTo(new PointF(25.82f, 4.04f)); bezierPath.AddLineTo(new PointF(6.19f, 4.04f)); bezierPath.AddLineTo(new PointF(4.67f, 4.04f)); bezierPath.ClosePath(); color5.SetFill(); bezierPath.Fill(); ////// Bezier Inner Shadow var bezierBorderRect = bezierPath.Bounds; bezierBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezierBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezierBorderRect = RectangleF.Union(bezierBorderRect, bezierPath.Bounds); bezierBorderRect.Inflate(1, 1); var bezierNegativePath = UIBezierPath.FromRect(bezierBorderRect); bezierNegativePath.AppendPath(bezierPath); bezierNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezierBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezierPath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezierBorderRect.Width), 0); bezierNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezierNegativePath.Fill(); } context.RestoreState(); color5.SetStroke(); bezierPath.LineWidth = 2; bezierPath.Stroke(); //// Rectangle 3 Drawing var rectangle3Path = UIBezierPath.FromRect(new RectangleF(39.5f, 19.5f, 5, 9)); color5.SetFill(); rectangle3Path.Fill(); ////// Rectangle 3 Inner Shadow var rectangle3BorderRect = rectangle3Path.Bounds; rectangle3BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle3BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle3BorderRect = RectangleF.Union(rectangle3BorderRect, rectangle3Path.Bounds); rectangle3BorderRect.Inflate(1, 1); var rectangle3NegativePath = UIBezierPath.FromRect(rectangle3BorderRect); rectangle3NegativePath.AppendPath(rectangle3Path); rectangle3NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle3BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectangle3Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle3BorderRect.Width), 0); rectangle3NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle3NegativePath.Fill(); } context.RestoreState(); color5.SetStroke(); rectangle3Path.LineWidth = 1; rectangle3Path.Stroke(); } }
static void paintCodeRetina() { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor color3 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); UIColor color4 = UIColor.FromRGBA(0.429f, 0.000f, 0.000f, 1.000f); UIColor color5 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f); UIColor color6 = UIColor.FromRGBA(0.456f, 0.456f, 0.456f, 1.000f); //// Shadow Declarations var shadow = UIColor.Black.CGColor; var shadowOffset = new SizeF(0.1f, -1.1f); var shadowBlurRadius = 8.5f; var shadow2 = color6.CGColor; var shadow2Offset = new SizeF(0.1f, -0.1f); var shadow2BlurRadius = 3.5f; //// Abstracted Attributes //var textContent = "Hello, World!"; //// Group { //// Bezier 2 Drawing UIBezierPath bezier2Path = new UIBezierPath(); bezier2Path.MoveTo(new PointF(32.5f, 20.5f)); bezier2Path.AddLineTo(new PointF(32.5f, 62.5f)); bezier2Path.AddLineTo(new PointF(49.5f, 62.5f)); bezier2Path.AddLineTo(new PointF(47.5f, 23.5f)); bezier2Path.AddLineTo(new PointF(32.5f, 20.5f)); bezier2Path.ClosePath(); color4.SetFill(); bezier2Path.Fill(); ////// Bezier 2 Inner Shadow var bezier2BorderRect = bezier2Path.Bounds; bezier2BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier2BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier2BorderRect = RectangleF.Union(bezier2BorderRect, bezier2Path.Bounds); bezier2BorderRect.Inflate(1, 1); var bezier2NegativePath = UIBezierPath.FromRect(bezier2BorderRect); bezier2NegativePath.AppendPath(bezier2Path); bezier2NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier2BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier2Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier2BorderRect.Width), 0); bezier2NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier2NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezier2Path.LineWidth = 1; bezier2Path.Stroke(); //// Bezier 18 Drawing UIBezierPath bezier18Path = new UIBezierPath(); bezier18Path.MoveTo(new PointF(47.5f, 62.48f)); bezier18Path.AddLineTo(new PointF(47.5f, 25.58f)); bezier18Path.AddLineTo(new PointF(96.5f, 22.5f)); bezier18Path.AddLineTo(new PointF(96.5f, 63.5f)); bezier18Path.AddLineTo(new PointF(47.5f, 62.48f)); bezier18Path.ClosePath(); color4.SetFill(); bezier18Path.Fill(); ////// Bezier 18 Inner Shadow var bezier18BorderRect = bezier18Path.Bounds; bezier18BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier18BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier18BorderRect = RectangleF.Union(bezier18BorderRect, bezier18Path.Bounds); bezier18BorderRect.Inflate(1, 1); var bezier18NegativePath = UIBezierPath.FromRect(bezier18BorderRect); bezier18NegativePath.AppendPath(bezier18Path); bezier18NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier18BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier18Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier18BorderRect.Width), 0); bezier18NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier18NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezier18Path.LineWidth = 1; bezier18Path.Stroke(); //// Bezier 6 Drawing UIBezierPath bezier6Path = new UIBezierPath(); bezier6Path.MoveTo(new PointF(85.5f, 5.5f)); bezier6Path.AddLineTo(new PointF(95.5f, 10.79f)); bezier6Path.AddLineTo(new PointF(95.5f, 20.5f)); bezier6Path.AddLineTo(new PointF(85.5f, 5.5f)); bezier6Path.ClosePath(); color4.SetFill(); bezier6Path.Fill(); ////// Bezier 6 Inner Shadow var bezier6BorderRect = bezier6Path.Bounds; bezier6BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier6BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier6BorderRect = RectangleF.Union(bezier6BorderRect, bezier6Path.Bounds); bezier6BorderRect.Inflate(1, 1); var bezier6NegativePath = UIBezierPath.FromRect(bezier6BorderRect); bezier6NegativePath.AppendPath(bezier6Path); bezier6NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier6BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier6Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier6BorderRect.Width), 0); bezier6NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier6NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezier6Path.LineWidth = 1; bezier6Path.Stroke(); //// Bezier 5 Drawing UIBezierPath bezier5Path = new UIBezierPath(); bezier5Path.MoveTo(new PointF(45.5f, 25.5f)); bezier5Path.AddLineTo(new PointF(96.5f, 22.02f)); bezier5Path.AddLineTo(new PointF(84.75f, 5.5f)); bezier5Path.AddLineTo(new PointF(38.5f, 13.5f)); bezier5Path.AddLineTo(new PointF(45.5f, 25.5f)); bezier5Path.ClosePath(); color4.SetFill(); bezier5Path.Fill(); ////// Bezier 5 Inner Shadow var bezier5BorderRect = bezier5Path.Bounds; bezier5BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier5BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier5BorderRect = RectangleF.Union(bezier5BorderRect, bezier5Path.Bounds); bezier5BorderRect.Inflate(1, 1); var bezier5NegativePath = UIBezierPath.FromRect(bezier5BorderRect); bezier5NegativePath.AppendPath(bezier5Path); bezier5NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier5BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier5Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier5BorderRect.Width), 0); bezier5NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier5NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezier5Path.LineWidth = 1; bezier5Path.Stroke(); //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(7.5f, 26.5f)); bezierPath.AddLineTo(new PointF(7.5f, 62.5f)); bezierPath.AddLineTo(new PointF(31.5f, 62.5f)); bezierPath.AddLineTo(new PointF(31.5f, 22.5f)); bezierPath.AddLineTo(new PointF(7.5f, 26.5f)); bezierPath.ClosePath(); color4.SetFill(); bezierPath.Fill(); ////// Bezier Inner Shadow var bezierBorderRect = bezierPath.Bounds; bezierBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezierBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezierBorderRect = RectangleF.Union(bezierBorderRect, bezierPath.Bounds); bezierBorderRect.Inflate(1, 1); var bezierNegativePath = UIBezierPath.FromRect(bezierBorderRect); bezierNegativePath.AppendPath(bezierPath); bezierNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezierBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezierPath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezierBorderRect.Width), 0); bezierNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezierNegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezierPath.LineWidth = 1; bezierPath.Stroke(); //// Text Drawing var textRect = new RectangleF(32, 23, 0, 0); //UIColor.Black.SetFill(); //new NSString(textContent).DrawString(textRect, UIFont.FromName("Helvetica", 12), UILineBreakMode.WordWrap, UITextAlignment.Center); //// Bezier 3 Drawing UIBezierPath bezier3Path = new UIBezierPath(); bezier3Path.MoveTo(new PointF(32.5f, 21.5f)); bezier3Path.AddLineTo(new PointF(2.5f, 26.5f)); bezier3Path.AddLineTo(new PointF(32.5f, 0.5f)); bezier3Path.AddLineTo(new PointF(32.5f, 21.5f)); color4.SetFill(); bezier3Path.Fill(); ////// Bezier 3 Inner Shadow var bezier3BorderRect = bezier3Path.Bounds; bezier3BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier3BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier3BorderRect = RectangleF.Union(bezier3BorderRect, bezier3Path.Bounds); bezier3BorderRect.Inflate(1, 1); var bezier3NegativePath = UIBezierPath.FromRect(bezier3BorderRect); bezier3NegativePath.AppendPath(bezier3Path); bezier3NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier3BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier3Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier3BorderRect.Width), 0); bezier3NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier3NegativePath.Fill(); } context.RestoreState(); color3.SetStroke(); bezier3Path.LineWidth = 1; bezier3Path.Stroke(); //// Bezier 4 Drawing UIBezierPath bezier4Path = new UIBezierPath(); bezier4Path.MoveTo(new PointF(31.5f, 0.5f)); bezier4Path.AddLineTo(new PointF(50.5f, 25.5f)); bezier4Path.AddLineTo(new PointF(31.5f, 22.5f)); bezier4Path.AddLineTo(new PointF(31.5f, 0.5f)); bezier4Path.ClosePath(); color4.SetFill(); bezier4Path.Fill(); ////// Bezier 4 Inner Shadow var bezier4BorderRect = bezier4Path.Bounds; bezier4BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezier4BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezier4BorderRect = RectangleF.Union(bezier4BorderRect, bezier4Path.Bounds); bezier4BorderRect.Inflate(1, 1); var bezier4NegativePath = UIBezierPath.FromRect(bezier4BorderRect); bezier4NegativePath.AppendPath(bezier4Path); bezier4NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezier4BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezier4Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezier4BorderRect.Width), 0); bezier4NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezier4NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); bezier4Path.LineWidth = 1; bezier4Path.Stroke(); //// Rectangle 2 Drawing var rectangle2Path = UIBezierPath.FromRect(new RectangleF(11.5f, 32.5f, 9, 19)); color3.SetFill(); rectangle2Path.Fill(); UIColor.Black.SetStroke(); rectangle2Path.LineWidth = 1; rectangle2Path.Stroke(); //// Bezier 7 Drawing UIBezierPath bezier7Path = new UIBezierPath(); bezier7Path.MoveTo(new PointF(20.5f, 35.5f)); bezier7Path.AddCurveToPoint(new PointF(11.5f, 35.5f), new PointF(12.5f, 35.5f), new PointF(11.5f, 35.5f)); color5.SetStroke(); bezier7Path.LineWidth = 1; bezier7Path.Stroke(); //// Bezier 8 Drawing UIBezierPath bezier8Path = new UIBezierPath(); bezier8Path.MoveTo(new PointF(20.5f, 39.5f)); bezier8Path.AddCurveToPoint(new PointF(11.5f, 39.5f), new PointF(12.5f, 39.5f), new PointF(11.5f, 39.5f)); color5.SetStroke(); bezier8Path.LineWidth = 1; bezier8Path.Stroke(); //// Bezier 9 Drawing UIBezierPath bezier9Path = new UIBezierPath(); bezier9Path.MoveTo(new PointF(20.5f, 43.5f)); bezier9Path.AddCurveToPoint(new PointF(11.5f, 43.5f), new PointF(12.5f, 43.5f), new PointF(11.5f, 43.5f)); color5.SetStroke(); bezier9Path.LineWidth = 1; bezier9Path.Stroke(); //// Bezier 10 Drawing UIBezierPath bezier10Path = new UIBezierPath(); bezier10Path.MoveTo(new PointF(20.5f, 46.5f)); bezier10Path.AddCurveToPoint(new PointF(11.5f, 46.5f), new PointF(12.5f, 46.5f), new PointF(11.5f, 46.5f)); color5.SetStroke(); bezier10Path.LineWidth = 1; bezier10Path.Stroke(); //// Bezier 11 Drawing UIBezierPath bezier11Path = new UIBezierPath(); bezier11Path.MoveTo(new PointF(18.5f, 32.5f)); bezier11Path.AddCurveToPoint(new PointF(18.5f, 51.5f), new PointF(18.5f, 51.5f), new PointF(18.5f, 51.5f)); color5.SetStroke(); bezier11Path.LineWidth = 1; bezier11Path.Stroke(); //// Bezier 12 Drawing UIBezierPath bezier12Path = new UIBezierPath(); bezier12Path.MoveTo(new PointF(14.5f, 32.5f)); bezier12Path.AddCurveToPoint(new PointF(14.5f, 51.5f), new PointF(14.5f, 51.5f), new PointF(14.5f, 51.5f)); color5.SetStroke(); bezier12Path.LineWidth = 1; bezier12Path.Stroke(); //// Rectangle 3 Drawing var rectangle3Path = UIBezierPath.FromRect(new RectangleF(38.5f, 39.5f, 6, 21)); color3.SetFill(); rectangle3Path.Fill(); UIColor.Black.SetStroke(); rectangle3Path.LineWidth = 1; rectangle3Path.Stroke(); //// Bezier 13 Drawing UIBezierPath bezier13Path = new UIBezierPath(); bezier13Path.MoveTo(new PointF(38.5f, 42.5f)); bezier13Path.AddLineTo(new PointF(44.5f, 42.5f)); color5.SetFill(); bezier13Path.Fill(); color5.SetStroke(); bezier13Path.LineWidth = 1; bezier13Path.Stroke(); //// Bezier 14 Drawing UIBezierPath bezier14Path = new UIBezierPath(); bezier14Path.MoveTo(new PointF(38.5f, 46.5f)); bezier14Path.AddLineTo(new PointF(44.5f, 46.5f)); color5.SetFill(); bezier14Path.Fill(); color5.SetStroke(); bezier14Path.LineWidth = 1; bezier14Path.Stroke(); //// Bezier 15 Drawing UIBezierPath bezier15Path = new UIBezierPath(); bezier15Path.MoveTo(new PointF(38.5f, 51.5f)); bezier15Path.AddLineTo(new PointF(44.5f, 51.5f)); color5.SetFill(); bezier15Path.Fill(); color5.SetStroke(); bezier15Path.LineWidth = 1; bezier15Path.Stroke(); //// Bezier 16 Drawing UIBezierPath bezier16Path = new UIBezierPath(); bezier16Path.MoveTo(new PointF(38.5f, 56.5f)); bezier16Path.AddLineTo(new PointF(44.5f, 56.5f)); color5.SetFill(); bezier16Path.Fill(); color5.SetStroke(); bezier16Path.LineWidth = 1; bezier16Path.Stroke(); //// Bezier 17 Drawing UIBezierPath bezier17Path = new UIBezierPath(); bezier17Path.MoveTo(new PointF(41.5f, 39.5f)); bezier17Path.AddLineTo(new PointF(41.5f, 60.5f)); color5.SetFill(); bezier17Path.Fill(); color5.SetStroke(); bezier17Path.LineWidth = 1; bezier17Path.Stroke(); //// Rectangle 8 Drawing var rectangle8Path = UIBezierPath.FromRect(new RectangleF(79.5f, 53.5f, 6, 9)); color3.SetFill(); rectangle8Path.Fill(); ////// Rectangle 8 Inner Shadow var rectangle8BorderRect = rectangle8Path.Bounds; rectangle8BorderRect.Inflate(shadow2BlurRadius, shadow2BlurRadius); rectangle8BorderRect.Offset(-shadow2Offset.Width, -shadow2Offset.Height); rectangle8BorderRect = RectangleF.Union(rectangle8BorderRect, rectangle8Path.Bounds); rectangle8BorderRect.Inflate(1, 1); var rectangle8NegativePath = UIBezierPath.FromRect(rectangle8BorderRect); rectangle8NegativePath.AppendPath(rectangle8Path); rectangle8NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadow2Offset.Width + (float)Math.Round(rectangle8BorderRect.Width); var yOffset = shadow2Offset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadow2BlurRadius, shadow2); rectangle8Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle8BorderRect.Width), 0); rectangle8NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle8NegativePath.Fill(); } context.RestoreState(); UIColor.Black.SetStroke(); rectangle8Path.LineWidth = 1; rectangle8Path.Stroke(); //// Rectangle 5 Drawing var rectangle5Path = UIBezierPath.FromRect(new RectangleF(53.5f, 29.5f, 6, 7)); color3.SetFill(); rectangle5Path.Fill(); UIColor.Black.SetStroke(); rectangle5Path.LineWidth = 1; rectangle5Path.Stroke(); //// Bezier 19 Drawing UIBezierPath bezier19Path = new UIBezierPath(); bezier19Path.MoveTo(new PointF(53.5f, 31.5f)); bezier19Path.AddCurveToPoint(new PointF(59.5f, 31.5f), new PointF(59.5f, 31.5f), new PointF(59.5f, 31.5f)); color5.SetStroke(); bezier19Path.LineWidth = 1; bezier19Path.Stroke(); //// Bezier 20 Drawing UIBezierPath bezier20Path = new UIBezierPath(); bezier20Path.MoveTo(new PointF(53.5f, 35.5f)); bezier20Path.AddLineTo(new PointF(59.5f, 35.5f)); color5.SetStroke(); bezier20Path.LineWidth = 1; bezier20Path.Stroke(); //// Bezier 21 Drawing UIBezierPath bezier21Path = new UIBezierPath(); bezier21Path.MoveTo(new PointF(56.5f, 29.5f)); bezier21Path.AddLineTo(new PointF(56.5f, 36.5f)); color5.SetStroke(); bezier21Path.LineWidth = 1; bezier21Path.Stroke(); //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRect(new RectangleF(64.5f, 29.5f, 6, 7)); color3.SetFill(); rectanglePath.Fill(); UIColor.Black.SetStroke(); rectanglePath.LineWidth = 1; rectanglePath.Stroke(); //// Bezier 22 Drawing UIBezierPath bezier22Path = new UIBezierPath(); bezier22Path.MoveTo(new PointF(64.5f, 31.5f)); bezier22Path.AddCurveToPoint(new PointF(70.5f, 31.5f), new PointF(70.5f, 31.5f), new PointF(70.5f, 31.5f)); color5.SetStroke(); bezier22Path.LineWidth = 1; bezier22Path.Stroke(); //// Bezier 23 Drawing UIBezierPath bezier23Path = new UIBezierPath(); bezier23Path.MoveTo(new PointF(64.5f, 35.5f)); bezier23Path.AddLineTo(new PointF(70.5f, 35.5f)); color5.SetStroke(); bezier23Path.LineWidth = 1; bezier23Path.Stroke(); //// Bezier 24 Drawing UIBezierPath bezier24Path = new UIBezierPath(); bezier24Path.MoveTo(new PointF(67.5f, 29.5f)); bezier24Path.AddLineTo(new PointF(67.5f, 36.5f)); color5.SetStroke(); bezier24Path.LineWidth = 1; bezier24Path.Stroke(); //// Rectangle 4 Drawing var rectangle4Path = UIBezierPath.FromRect(new RectangleF(76.5f, 28.5f, 6, 7)); color3.SetFill(); rectangle4Path.Fill(); UIColor.Black.SetStroke(); rectangle4Path.LineWidth = 1; rectangle4Path.Stroke(); //// Bezier 25 Drawing UIBezierPath bezier25Path = new UIBezierPath(); bezier25Path.MoveTo(new PointF(76.5f, 30.5f)); bezier25Path.AddCurveToPoint(new PointF(82.5f, 30.5f), new PointF(82.5f, 30.5f), new PointF(82.5f, 30.5f)); color5.SetStroke(); bezier25Path.LineWidth = 1; bezier25Path.Stroke(); //// Bezier 26 Drawing UIBezierPath bezier26Path = new UIBezierPath(); bezier26Path.MoveTo(new PointF(76.5f, 34.5f)); bezier26Path.AddLineTo(new PointF(82.5f, 34.5f)); color5.SetStroke(); bezier26Path.LineWidth = 1; bezier26Path.Stroke(); //// Bezier 27 Drawing UIBezierPath bezier27Path = new UIBezierPath(); bezier27Path.MoveTo(new PointF(79.5f, 28.5f)); bezier27Path.AddLineTo(new PointF(79.5f, 35.5f)); color5.SetStroke(); bezier27Path.LineWidth = 1; bezier27Path.Stroke(); } }
public static UIImage MakeFlosshatt() { bool retina = (UIScreen.MainScreen.Scale > 1.0); if (retina) { UIGraphics.BeginImageContext (new System.Drawing.SizeF (96, 64)); ///BEGIN PAINTCODE RETINA //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor shadowColor2 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 0.454f); UIColor color4 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); //// Shadow Declarations var shadow = shadowColor2.ColorWithAlpha(0.5f).CGColor; var shadowOffset = new SizeF(0.1f, -1.1f); var shadowBlurRadius = 10; //// Group { //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRect(new RectangleF(20.5f, 15.5f, 0, 0)); color4.SetFill(); rectanglePath.Fill(); color4.SetStroke(); rectanglePath.LineWidth = 1; rectanglePath.Stroke(); //// Rectangle 2 Drawing UIBezierPath rectangle2Path = new UIBezierPath(); rectangle2Path.MoveTo(new PointF(20.72f, 49.5f)); rectangle2Path.AddCurveToPoint(new PointF(45.5f, 54.5f), new PointF(20.72f, 49.5f), new PointF(32.97f, 54.5f)); rectangle2Path.AddCurveToPoint(new PointF(70.84f, 49.5f), new PointF(58.03f, 54.5f), new PointF(70.84f, 49.5f)); rectangle2Path.AddLineTo(new PointF(70.5f, 9.5f)); rectangle2Path.AddCurveToPoint(new PointF(59.27f, 15), new PointF(70.5f, 9.5f), new PointF(68.43f, 13.56f)); rectangle2Path.AddCurveToPoint(new PointF(34.21f, 15), new PointF(50.12f, 16.44f), new PointF(41.85f, 15.58f)); rectangle2Path.AddCurveToPoint(new PointF(20.72f, 9.25f), new PointF(26.58f, 14.41f), new PointF(20.72f, 9.25f)); rectangle2Path.AddLineTo(new PointF(20.72f, 49.5f)); rectangle2Path.ClosePath(); color4.SetFill(); rectangle2Path.Fill(); ////// Rectangle 2 Inner Shadow var rectangle2BorderRect = rectangle2Path.Bounds; rectangle2BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle2BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle2BorderRect = RectangleF.Union(rectangle2BorderRect, rectangle2Path.Bounds); rectangle2BorderRect.Inflate(1, 1); var rectangle2NegativePath = UIBezierPath.FromRect(rectangle2BorderRect); rectangle2NegativePath.AppendPath(rectangle2Path); rectangle2NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle2BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectangle2Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle2BorderRect.Width), 0); rectangle2NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle2NegativePath.Fill(); } context.RestoreState(); color4.SetStroke(); rectangle2Path.LineWidth = 1; rectangle2Path.Stroke(); //// Oval Drawing UIBezierPath ovalPath = new UIBezierPath(); ovalPath.MoveTo(new PointF(41.75f, 29.14f)); ovalPath.AddCurveToPoint(new PointF(41.75f, 29.14f), new PointF(41.64f, 28.93f), new PointF(41.75f, 29.14f)); ovalPath.AddCurveToPoint(new PointF(41.75f, 29.14f), new PointF(41.75f, 29.14f), new PointF(41.85f, 29.34f)); ovalPath.ClosePath(); ovalPath.MoveTo(new PointF(71.09f, 40.78f)); ovalPath.AddCurveToPoint(new PointF(85.5f, 53.5f), new PointF(71.09f, 40.78f), new PointF(90.3f, 44.46f)); ovalPath.AddCurveToPoint(new PointF(71.5f, 60.5f), new PointF(83.59f, 57.1f), new PointF(79.87f, 58.44f)); ovalPath.AddCurveToPoint(new PointF(43.5f, 63.5f), new PointF(68.37f, 61.27f), new PointF(55.33f, 63.35f)); ovalPath.AddCurveToPoint(new PointF(19.98f, 60.61f), new PointF(32.61f, 63.64f), new PointF(22.5f, 61.09f)); ovalPath.AddCurveToPoint(new PointF(6.48f, 53.09f), new PointF(14.84f, 59.63f), new PointF(6.96f, 54.65f)); ovalPath.AddCurveToPoint(new PointF(19.98f, 40.78f), new PointF(5.15f, 48.79f), new PointF(10.39f, 43.13f)); ovalPath.AddLineTo(new PointF(19.98f, 49.64f)); ovalPath.AddCurveToPoint(new PointF(45.5f, 53.5f), new PointF(19.98f, 49.64f), new PointF(32.72f, 53.5f)); ovalPath.AddCurveToPoint(new PointF(71.09f, 49.64f), new PointF(58.28f, 53.5f), new PointF(71.09f, 49.64f)); ovalPath.AddLineTo(new PointF(71.09f, 40.78f)); ovalPath.ClosePath(); ovalPath.MiterLimit = 6; color4.SetFill(); ovalPath.Fill(); ////// Oval Inner Shadow var ovalBorderRect = ovalPath.Bounds; ovalBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); ovalBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); ovalBorderRect = RectangleF.Union(ovalBorderRect, ovalPath.Bounds); ovalBorderRect.Inflate(1, 1); var ovalNegativePath = UIBezierPath.FromRect(ovalBorderRect); ovalNegativePath.AppendPath(ovalPath); ovalNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(ovalBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); ovalPath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(ovalBorderRect.Width), 0); ovalNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); ovalNegativePath.Fill(); } context.RestoreState(); color4.SetStroke(); ovalPath.LineWidth = 1; ovalPath.Stroke(); //// Oval 2 Drawing var oval2Path = UIBezierPath.FromOval(new RectangleF(20.5f, 3.5f, 50, 12)); color4.SetFill(); oval2Path.Fill(); ////// Oval 2 Inner Shadow var oval2BorderRect = oval2Path.Bounds; oval2BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval2BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval2BorderRect = RectangleF.Union(oval2BorderRect, oval2Path.Bounds); oval2BorderRect.Inflate(1, 1); var oval2NegativePath = UIBezierPath.FromRect(oval2BorderRect); oval2NegativePath.AppendPath(oval2Path); oval2NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval2BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval2Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval2BorderRect.Width), 0); oval2NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval2NegativePath.Fill(); } context.RestoreState(); color4.SetStroke(); oval2Path.LineWidth = 1; oval2Path.Stroke(); } // END PAINTCODE RETINA } else { UIGraphics.BeginImageContext (new System.Drawing.SizeF (48, 32)); //start paintcode //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor shadowColor2 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 0.454f); UIColor color4 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); //// Shadow Declarations var shadow = shadowColor2.ColorWithAlpha(0.5f).CGColor; var shadowOffset = new SizeF(0.1f, -1.1f); var shadowBlurRadius = 10; //// Group { //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRect(new RectangleF(10.5f, 7.5f, 0, 0)); color4.SetFill(); rectanglePath.Fill(); color4.SetStroke(); rectanglePath.LineWidth = 1; rectanglePath.Stroke(); //// Rectangle 2 Drawing UIBezierPath rectangle2Path = new UIBezierPath(); rectangle2Path.MoveTo(new PointF(9.81f, 24.87f)); rectangle2Path.AddCurveToPoint(new PointF(22.97f, 27.33f), new PointF(9.81f, 24.87f), new PointF(16.32f, 27.33f)); rectangle2Path.AddCurveToPoint(new PointF(36.42f, 24.87f), new PointF(29.62f, 27.33f), new PointF(36.42f, 24.87f)); rectangle2Path.AddLineTo(new PointF(36.24f, 5.2f)); rectangle2Path.AddCurveToPoint(new PointF(30.28f, 7.9f), new PointF(36.24f, 5.2f), new PointF(35.14f, 7.19f)); rectangle2Path.AddCurveToPoint(new PointF(16.98f, 7.9f), new PointF(25.42f, 8.61f), new PointF(21.03f, 8.19f)); rectangle2Path.AddCurveToPoint(new PointF(9.81f, 5.07f), new PointF(12.92f, 7.61f), new PointF(9.81f, 5.07f)); rectangle2Path.AddLineTo(new PointF(9.81f, 24.87f)); rectangle2Path.ClosePath(); color4.SetFill(); rectangle2Path.Fill(); ////// Rectangle 2 Inner Shadow var rectangle2BorderRect = rectangle2Path.Bounds; rectangle2BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle2BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle2BorderRect = RectangleF.Union(rectangle2BorderRect, rectangle2Path.Bounds); rectangle2BorderRect.Inflate(1, 1); var rectangle2NegativePath = UIBezierPath.FromRect(rectangle2BorderRect); rectangle2NegativePath.AppendPath(rectangle2Path); rectangle2NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle2BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectangle2Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle2BorderRect.Width), 0); rectangle2NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle2NegativePath.Fill(); } context.RestoreState(); color4.SetStroke(); rectangle2Path.LineWidth = 1; rectangle2Path.Stroke(); //// Oval Drawing UIBezierPath ovalPath = new UIBezierPath(); ovalPath.MoveTo(new PointF(20.98f, 14.86f)); ovalPath.AddCurveToPoint(new PointF(20.98f, 14.86f), new PointF(20.92f, 14.75f), new PointF(20.98f, 14.86f)); ovalPath.AddCurveToPoint(new PointF(20.98f, 14.86f), new PointF(20.98f, 14.86f), new PointF(21.03f, 14.96f)); ovalPath.ClosePath(); ovalPath.MoveTo(new PointF(36.56f, 20.58f)); ovalPath.AddCurveToPoint(new PointF(44.2f, 26.84f), new PointF(36.56f, 20.58f), new PointF(46.75f, 22.39f)); ovalPath.AddCurveToPoint(new PointF(36.77f, 30.28f), new PointF(43.19f, 28.61f), new PointF(41.21f, 29.27f)); ovalPath.AddCurveToPoint(new PointF(21.91f, 31.75f), new PointF(35.11f, 30.66f), new PointF(28.18f, 31.68f)); ovalPath.AddCurveToPoint(new PointF(9.42f, 30.33f), new PointF(16.13f, 31.82f), new PointF(10.76f, 30.57f)); ovalPath.AddCurveToPoint(new PointF(2.25f, 26.63f), new PointF(6.69f, 29.85f), new PointF(2.51f, 27.4f)); ovalPath.AddCurveToPoint(new PointF(9.42f, 20.58f), new PointF(1.55f, 24.52f), new PointF(4.33f, 21.73f)); ovalPath.AddLineTo(new PointF(9.42f, 24.94f)); ovalPath.AddCurveToPoint(new PointF(22.97f, 26.84f), new PointF(9.42f, 24.94f), new PointF(16.19f, 26.84f)); ovalPath.AddCurveToPoint(new PointF(36.56f, 24.94f), new PointF(29.75f, 26.84f), new PointF(36.56f, 24.94f)); ovalPath.AddLineTo(new PointF(36.56f, 20.58f)); ovalPath.ClosePath(); ovalPath.MiterLimit = 6; color4.SetFill(); ovalPath.Fill(); ////// Oval Inner Shadow var ovalBorderRect = ovalPath.Bounds; ovalBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); ovalBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); ovalBorderRect = RectangleF.Union(ovalBorderRect, ovalPath.Bounds); ovalBorderRect.Inflate(1, 1); var ovalNegativePath = UIBezierPath.FromRect(ovalBorderRect); ovalNegativePath.AppendPath(ovalPath); ovalNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(ovalBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); ovalPath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(ovalBorderRect.Width), 0); ovalNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); ovalNegativePath.Fill(); } context.RestoreState(); color4.SetStroke(); ovalPath.LineWidth = 1; ovalPath.Stroke(); //// Oval 2 Drawing var oval2Path = UIBezierPath.FromOval(new RectangleF(10.5f, 2.5f, 25, 5)); color4.SetFill(); oval2Path.Fill(); ////// Oval 2 Inner Shadow var oval2BorderRect = oval2Path.Bounds; oval2BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); oval2BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); oval2BorderRect = RectangleF.Union(oval2BorderRect, oval2Path.Bounds); oval2BorderRect.Inflate(1, 1); var oval2NegativePath = UIBezierPath.FromRect(oval2BorderRect); oval2NegativePath.AppendPath(oval2Path); oval2NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(oval2BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); oval2Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(oval2BorderRect.Width), 0); oval2NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); oval2NegativePath.Fill(); } context.RestoreState(); color4.SetStroke(); oval2Path.LineWidth = 1; oval2Path.Stroke(); } // END PAINTCODE } var converted = UIGraphics.GetImageFromCurrentImageContext (); UIGraphics.EndImageContext (); return converted; }
static void paintCodeNonRetina() { //// General Declarations var context = UIGraphics.GetCurrentContext(); //// Color Declarations UIColor shadowColor2 = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 0.448f); UIColor color3 = UIColor.FromRGBA(0.000f, 0.000f, 0.000f, 1.000f); //// Shadow Declarations var shadow = shadowColor2.CGColor; var shadowOffset = new SizeF(0.1f, -0.1f); var shadowBlurRadius = 16; //// Group 2 { //// Bezier Drawing UIBezierPath bezierPath = new UIBezierPath(); bezierPath.MoveTo(new PointF(2.56f, 2.54f)); bezierPath.AddCurveToPoint(new PointF(11.56f, 5.76f), new PointF(11.1f, 5.76f), new PointF(11.56f, 5.76f)); bezierPath.AddLineTo(new PointF(46.74f, 5.62f)); bezierPath.AddLineTo(new PointF(36.72f, 2.54f)); bezierPath.AddLineTo(new PointF(2.56f, 2.54f)); bezierPath.ClosePath(); bezierPath.MiterLimit = 6.5f; UIColor.Orange.SetFill(); bezierPath.Fill(); ////// Bezier Inner Shadow var bezierBorderRect = bezierPath.Bounds; bezierBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); bezierBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); bezierBorderRect = RectangleF.Union(bezierBorderRect, bezierPath.Bounds); bezierBorderRect.Inflate(1, 1); var bezierNegativePath = UIBezierPath.FromRect(bezierBorderRect); bezierNegativePath.AppendPath(bezierPath); bezierNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(bezierBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); bezierPath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(bezierBorderRect.Width), 0); bezierNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); bezierNegativePath.Fill(); } context.RestoreState(); color3.SetStroke(); bezierPath.LineWidth = 1; bezierPath.Stroke(); //// Rectangle Drawing var rectanglePath = UIBezierPath.FromRect(new RectangleF(12.5f, 5.5f, 34, 25)); UIColor.Orange.SetFill(); rectanglePath.Fill(); ////// Rectangle Inner Shadow var rectangleBorderRect = rectanglePath.Bounds; rectangleBorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangleBorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangleBorderRect = RectangleF.Union(rectangleBorderRect, rectanglePath.Bounds); rectangleBorderRect.Inflate(1, 1); var rectangleNegativePath = UIBezierPath.FromRect(rectangleBorderRect); rectangleNegativePath.AppendPath(rectanglePath); rectangleNegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangleBorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectanglePath.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangleBorderRect.Width), 0); rectangleNegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangleNegativePath.Fill(); } context.RestoreState(); color3.SetStroke(); rectanglePath.LineWidth = 1; rectanglePath.Stroke(); //// Rectangle 2 Drawing UIBezierPath rectangle2Path = new UIBezierPath(); rectangle2Path.MoveTo(new PointF(2.15f, 22.52f)); rectangle2Path.AddLineTo(new PointF(11.91f, 30.82f)); rectangle2Path.AddLineTo(new PointF(11.91f, 5.92f)); rectangle2Path.AddLineTo(new PointF(2.15f, 2.18f)); rectangle2Path.AddLineTo(new PointF(2.15f, 22.52f)); rectangle2Path.ClosePath(); UIColor.Orange.SetFill(); rectangle2Path.Fill(); ////// Rectangle 2 Inner Shadow var rectangle2BorderRect = rectangle2Path.Bounds; rectangle2BorderRect.Inflate(shadowBlurRadius, shadowBlurRadius); rectangle2BorderRect.Offset(-shadowOffset.Width, -shadowOffset.Height); rectangle2BorderRect = RectangleF.Union(rectangle2BorderRect, rectangle2Path.Bounds); rectangle2BorderRect.Inflate(1, 1); var rectangle2NegativePath = UIBezierPath.FromRect(rectangle2BorderRect); rectangle2NegativePath.AppendPath(rectangle2Path); rectangle2NegativePath.UsesEvenOddFillRule = true; context.SaveState(); { var xOffset = shadowOffset.Width + (float)Math.Round(rectangle2BorderRect.Width); var yOffset = shadowOffset.Height; context.SetShadowWithColor( new SizeF(xOffset + (xOffset >= 0 ? 0.1f : -0.1f), yOffset + (yOffset >= 0 ? 0.1f : -0.1f)), shadowBlurRadius, shadow); rectangle2Path.AddClip(); var transform = CGAffineTransform.MakeTranslation(-(float)Math.Round(rectangle2BorderRect.Width), 0); rectangle2NegativePath.ApplyTransform(transform); UIColor.Gray.SetFill(); rectangle2NegativePath.Fill(); } context.RestoreState(); color3.SetStroke(); rectangle2Path.LineWidth = 1; rectangle2Path.Stroke(); } }