public static XIR.Image RemoteRepresentation(this CGLineJoin obj) { // Customize the line cap style for the new object. var aPath = new CGPath(); var lineWidth = 10; var sampleWidth = 50; // First we draw the presentation line aPath.MoveToPoint(new CGPoint(lineWidth, lineWidth)); aPath.AddLineToPoint(new CGPoint(lineWidth + sampleWidth / 2, sampleWidth)); aPath.AddLineToPoint(new CGPoint(lineWidth + sampleWidth, lineWidth)); // let's make sure we leave a little room for the line width drawing as well by adding the lineWidth as well var width = (int)aPath.PathBoundingBox.Right + lineWidth; var height = (int)aPath.PathBoundingBox.Bottom + lineWidth; var bytesPerRow = width * 4; using (var context = new CGBitmapContext( IntPtr.Zero, width, height, 8, bytesPerRow, CGColorSpace.CreateDeviceRGB(), CGImageAlphaInfo.PremultipliedFirst)) { context.SaveState(); context.SetStrokeColor(NSColor.Black.CGColor); context.SetLineWidth(lineWidth); context.AddPath(aPath); switch ((CGLineJoin)obj) { case CGLineJoin.Bevel: context.SetLineJoin(CGLineJoin.Bevel); break; case CGLineJoin.Miter: context.SetLineJoin(CGLineJoin.Miter); break; case CGLineJoin.Round: context.SetLineJoin(CGLineJoin.Round); break; } context.DrawPath(CGPathDrawingMode.Stroke); context.RestoreState(); aPath = new CGPath(); aPath.MoveToPoint(new CGPoint(lineWidth, lineWidth)); aPath.AddLineToPoint(new CGPoint(lineWidth + sampleWidth / 2, sampleWidth)); aPath.AddLineToPoint(new CGPoint(lineWidth + sampleWidth, lineWidth)); context.SetStrokeColor(NSColor.White.CGColor); context.SetLineWidth(2); context.AddPath(aPath); context.DrawPath(CGPathDrawingMode.Stroke); return(context.RemoteRepresentation()); } }
void SetStrokeLineJoin() { PenLineJoin winLineJoin = Element.StrokeLineJoin; CGLineJoin iosLineJoin = CGLineJoin.Miter; switch (winLineJoin) { case PenLineJoin.Miter: iosLineJoin = CGLineJoin.Miter; break; case PenLineJoin.Bevel: iosLineJoin = CGLineJoin.Bevel; break; case PenLineJoin.Round: iosLineJoin = CGLineJoin.Round; break; } Control.DrawingLayer.SetStrokeLineJoin(iosLineJoin); }
public static PenLineJoin ToEto(this CGLineJoin value) { switch (value) { case CGLineJoin.Bevel: return(PenLineJoin.Bevel); case CGLineJoin.Miter: return(PenLineJoin.Miter); case CGLineJoin.Round: return(PenLineJoin.Round); default: throw new NotSupportedException(); } }
public void SetBorderLineJoin(LineJoin lineJoin) { CGLineJoin iLineJoin = CGLineJoin.Miter; switch (lineJoin) { case LineJoin.Miter: iLineJoin = CGLineJoin.Miter; break; case LineJoin.Bevel: iLineJoin = CGLineJoin.Bevel; break; case LineJoin.Round: iLineJoin = CGLineJoin.Round; break; } _strokeLineJoin = iLineJoin; SetNeedsDisplay(); }
void UpdateStrokeLineJoin() { PenLineJoin lineJoin = Element.StrokeLineJoin; CGLineJoin iLineJoin = CGLineJoin.Miter; switch (lineJoin) { case PenLineJoin.Miter: iLineJoin = CGLineJoin.Miter; break; case PenLineJoin.Bevel: iLineJoin = CGLineJoin.Bevel; break; case PenLineJoin.Round: iLineJoin = CGLineJoin.Round; break; } Control.ShapeLayer.UpdateStrokeLineJoin(iLineJoin); }
extern static void CGContextSetLineJoin(IntPtr c, CGLineJoin join);
public unsafe CGPath CopyByStrokingPath(CGAffineTransform transform, nfloat lineWidth, CGLineCap lineCap, CGLineJoin lineJoin, nfloat miterLimit) { return(MakeMutable(CGPathCreateCopyByStrokingPath(handle, &transform, lineWidth, lineCap, lineJoin, miterLimit))); }
extern static IntPtr CGPathCreateCopyByStrokingPath(IntPtr handle, IntPtr zero, float lineWidth, CGLineCap lineCap, CGLineJoin lineJoin, float miterLimit);
public void SetLineJoin(CGLineJoin join) { CGContextSetLineJoin(handle, join); }
public unsafe CGPath CopyByStrokingPath (nfloat lineWidth, CGLineCap lineCap, CGLineJoin lineJoin, nfloat miterLimit) { return MakeMutable (CGPathCreateCopyByStrokingPath (handle, null, lineWidth, lineCap, lineJoin, miterLimit)); }
unsafe extern static IntPtr CGPathCreateCopyByStrokingPath (/* CGPathRef */ IntPtr path, CGAffineTransform *transform, nfloat lineWidth, CGLineCap lineCap, CGLineJoin lineJoin, /* CGFloat */ nfloat miterLimit);
extern static void CGContextSetLineJoin(/* CGContextRef */ IntPtr c, CGLineJoin join);
public void SetStrokeLineJoin(CGLineJoin strokeLineJoin) { this.strokeLineJoin = strokeLineJoin; CalculateBasicPathStrokeBounds(); SetNeedsDisplay(); }
public void SetLineJoin (CGLineJoin join) { CGContextSetLineJoin (handle, join); }
extern static IntPtr CGPathCreateCopyByStrokingPath (IntPtr handle, ref CGAffineTransform transform, float lineWidth, CGLineCap lineCap, CGLineJoin lineJoin, float miterLimit);
public CGPath CopyByStrokingPath (CGAffineTransform transform, float lineWidth, CGLineCap lineCap, CGLineJoin lineJoin, float miterLimit) { return MakeMutable (CGPathCreateCopyByStrokingPath (handle, ref transform, lineWidth, lineCap, lineJoin, miterLimit)); }
extern static IntPtr CGPathCreateCopyByStrokingPath(IntPtr handle, ref CGAffineTransform transform, float lineWidth, CGLineCap lineCap, CGLineJoin lineJoin, float miterLimit);
extern static IntPtr CGPathCreateCopyByStrokingPath (IntPtr handle, IntPtr zero, float lineWidth, CGLineCap lineCap, CGLineJoin lineJoin, float miterLimit);
public CGPath CopyByStrokingPath(float lineWidth, CGLineCap lineCap, CGLineJoin lineJoin, float miterLimit) { return(MakeMutable(CGPathCreateCopyByStrokingPath(handle, IntPtr.Zero, lineWidth, lineCap, lineJoin, miterLimit))); }
public CGPath CopyByStrokingPath (float lineWidth, CGLineCap lineCap, CGLineJoin lineJoin, float miterLimit) { return MakeMutable (CGPathCreateCopyByStrokingPath (handle, IntPtr.Zero, lineWidth, lineCap, lineJoin, miterLimit)); }
unsafe extern static IntPtr CGPathCreateCopyByStrokingPath(/* CGPathRef */ IntPtr path, CGAffineTransform *transform, nfloat lineWidth, CGLineCap lineCap, CGLineJoin lineJoin, /* CGFloat */ nfloat miterLimit);
public override MKOverlayRenderer OverlayRenderer(MKMapView mapView, IMKOverlay overlay) { UIColor fill = UIColor.Clear; UIColor border = UIColor.Clear; float borderWidth = 0; CGLineJoin lineJoin = CGLineJoin.Round; CGLineCap lineCap = CGLineCap.Round; float dashPhase = 0; string style; if (PolygonStyles.TryGetValue(overlay, out style)) { switch (style) { case "border": fill = UIColor.FromRGB(0.99f, 0.94f, 0.91f); border = UIColor.FromRGB(0.94f, 0.65f, 0.56f); break; case "podium": fill = UIColor.FromRGB(0.94f, 0.49f, 0f); break; case "podiumgrond": fill = UIColor.FromRGB(0f, 0.44f, 0.58f); break; case "pavilioen": fill = UIColor.FromRGB(0.89f, 0.69f, 0.77f); break; case "loods": fill = UIColor.FromRGB(0.85f, 0.89f, 0.51f); break; case "kampeergrond": fill = UIColor.FromRGB(0.32f, 0.69f, 0.19f); break; case "kampeergrond-ongebruikt": fill = UIColor.FromRGB(0.99f, 0.97f, 0.96f); break; case "aanbod": fill = UIColor.FromRGB(0.85f, 0.05f, 0.15f); break; case "vijver": fill = UIColor.FromRGBA(0.00f, 0.62f, 0.89f, 0.6f); break; case "bos": fill = UIColor.FromRGB(0.49f, 0.13f, 0.43f); border = UIColor.FromRGB(0.22f, 0.69f, 0.42f); borderWidth = 1; break; case "weg-hard": borderWidth = 4; lineCap = CGLineCap.Square; border = UIColor.White; break; case "weg-hard-2": borderWidth = 3; lineCap = CGLineCap.Square; border = UIColor.White; break; case "weg-halfhard": borderWidth = 3; lineCap = CGLineCap.Square; border = UIColor.White; break; case "weg-zand": borderWidth = 1; dashPhase = 0.2f; border = UIColor.FromRGB(0.94f, 0.65f, 0.56f); break; case "faciliteit": border = UIColor.FromRGB(0.05f, 0.46f, 0.58f); break; default: fill = UIColor.Black; break; } } if (overlay is MKPolygon) { return new MKPolygonRenderer(overlay as MKPolygon) { FillColor = fill, StrokeColor = border, LineWidth = borderWidth, LineJoin = lineJoin } } ; if (overlay is MKPolyline) { return new MKPolylineRenderer(overlay as MKPolyline) { FillColor = fill, StrokeColor = border, LineWidth = borderWidth, LineCap = CGLineCap.Square, LineDashPhase = dashPhase } } ; return(null); }
public unsafe CGPath CopyByStrokingPath(nfloat lineWidth, CGLineCap lineCap, CGLineJoin lineJoin, nfloat miterLimit) { return(MakeMutable(CGPathCreateCopyByStrokingPath(handle, null, lineWidth, lineCap, lineJoin, miterLimit))); }
extern static void CGContextSetLineJoin (/* CGContextRef */ IntPtr c, CGLineJoin join);