Exemplo n.º 1
0
		public void DrawPath(Pen pen, IGraphicsPath path)
		{
			SetOffset(false);
			StartDrawing();
			
			pen.Apply(this);
			Control.BeginPath();
			Control.AddPath(path.ToCG());
			Control.StrokePath();
			
			EndDrawing();
		}
Exemplo n.º 2
0
		public void DrawEllipse(Pen pen, float x, float y, float width, float height)
		{
			SetOffset(false);
			StartDrawing();
			var rect = new CGRect(x, y, width, height);
			pen.Apply(this);
			Control.StrokeEllipseInRect(rect);
			EndDrawing();
		}
Exemplo n.º 3
0
		public void DrawArc(Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
		{
			SetOffset(false);
			StartDrawing();

			var rect = new CGRect(x, y, width, height);
			pen.Apply(this);
			var yscale = rect.Height / rect.Width;
			var centerY = rect.GetMidY();
			var centerX = rect.GetMidX();
			Control.ConcatCTM(new CGAffineTransform(1.0f, 0, 0, yscale, 0, centerY - centerY * yscale));
			Control.AddArc(centerX, centerY, rect.Width / 2, CGConversions.DegreesToRadians(startAngle), CGConversions.DegreesToRadians(startAngle + sweepAngle), sweepAngle < 0);
			Control.StrokePath();
			EndDrawing();
		}
Exemplo n.º 4
0
		public void DrawLine(Pen pen, float startx, float starty, float endx, float endy)
		{
			SetOffset(false);
			StartDrawing();
			pen.Apply(this);
			Control.StrokeLineSegments(new []
			{
				new CGPoint(startx, starty),
				new CGPoint(endx, endy)
			});
			EndDrawing();
		}