Пример #1
0
		public override void DrawRect (System.Drawing.RectangleF dirtyRect)
		{
			try {
				var c = NSGraphicsContext.CurrentContext.GraphicsPort;
				var g = new CoreGraphicsGraphics (c, true);
				var e = new CanvasDrawingEventArgs (g, Bounds.ToRectangleF ());
				Drawing (this, e);
			} catch (Exception ex) {
				Log.Error (ex);
			}
		}
Пример #2
0
 public override void DrawRect(CGRect dirtyRect)
 {
     try {
         var c = NSGraphicsContext.CurrentContext.GraphicsPort;
         var g = new CoreGraphicsGraphics(c, true);
         var e = new CanvasDrawingEventArgs(g, Bounds.ToRectangleF());
         Drawing(this, e);
     } catch (Exception ex) {
         Log.Error(ex);
     }
 }
Пример #3
0
        public override void Draw(CoreGraphics.CGRect rect)
        {
            try {
                base.Draw(rect);

                var c = UIGraphics.GetCurrentContext();

                var e = new CanvasDrawingEventArgs(
                    new CoreGraphicsGraphics(c, true),
                    Bounds.ToRectangleF()
                    );

                Drawing(this, e);
            } catch (Exception ex) {
                Log.Error(ex);
            }
        }
Пример #4
0
        void HandleDrawing(object sender, CanvasDrawingEventArgs e)
        {
            var g = e.Graphics;

            if (visibleArea.Width <= 0 || visibleArea.Height <= 0)
            {
                return;
            }

            var scale = (float)canvas.Frame.Width / (float)visibleArea.Width;

            g.Scale(scale, scale);

            g.Translate(-visibleArea.X, -visibleArea.Y);

            var ne = new CanvasDrawingEventArgs(
                e.Graphics,
                visibleArea
                );

            Drawing(this, ne);
        }
Пример #5
0
		void HandleDrawing (object sender, CanvasDrawingEventArgs e)
		{
			var g = e.Graphics;

			if (visibleArea.Width <= 0 || visibleArea.Height <= 0)
				return;

			var scale = (float)canvas.Frame.Width / (float)visibleArea.Width;

			g.Scale (scale, scale);

			g.Translate (-visibleArea.X, -visibleArea.Y);

			var ne = new CanvasDrawingEventArgs (
				e.Graphics,
				visibleArea
			);
			Drawing (this, ne);
		}
Пример #6
0
		public override void Draw (CoreGraphics.CGRect rect)
		{
			try {
				base.Draw (rect);
				
				var c = UIGraphics.GetCurrentContext ();
				
				var e = new CanvasDrawingEventArgs (
					        new CoreGraphicsGraphics (c, true),
					        Bounds.ToRectangleF ()
				        );
				
				Drawing (this, e);
			} catch (Exception ex) {
				Log.Error (ex);
			}
		}