Inheritance: System.EventArgs
Example #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);
			}
		}
Example #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);
     }
 }
Example #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);
            }
        }
        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);
        }
		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);
		}
Example #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);
			}
		}