public void FillRectangle(Brush brush, float x1, float y1, float w, float h)
 {
     this.paint.Color = brush.Color.ToAColor();
     this.paint.Flags = this.Flags;
     this.paint.SetStyle(droid.Paint.Style.Fill);
     this.canvas.DrawRect(x1, y1, x1 + w, y1 + h, this.paint);
 }
 public void DrawLine(Pen pen, Point p1, Point p2)
 {
     this.paint.Color = pen.Color.ToAColor();
     this.paint.Flags = this.Flags;
     this.paint.SetStyle(droid.Paint.Style.Stroke);
     this.paint.StrokeWidth = pen.Width;
     this.canvas.DrawLine(p1.X, p1.Y, p2.X, p2.Y, paint);
 }
 public void DrawRectangle(Pen pen, float x1, float y1, float w, float h)
 {
     this.paint.Color = pen.Color.ToAColor();
     this.paint.Flags = this.Flags;
     this.paint.SetStyle(droid.Paint.Style.Stroke);
     this.paint.StrokeWidth = pen.Width;
     this.canvas.DrawRect(x1, y1, x1 + w, y1 + h, this.paint);
 }
 public void DrawRectangle(Pen pen, Rectangle rect)
 {
     this.paint.Color = pen.Color.ToAColor();
     this.paint.Flags = this.Flags;
     this.paint.SetStyle(droid.Paint.Style.Stroke);
     this.paint.StrokeWidth = pen.Width;
     this.canvas.DrawRect(rect.X, rect.Y, rect.X + 1, rect.Y + 1, this.paint);
 }
 public void DrawLine(Pen pen, float x1, float y1, float x2, float y2)
 {
     this.paint.Color = pen.Color.ToAColor();
     this.paint.Flags = this.Flags;
     this.paint.SetStyle(droid.Paint.Style.Stroke);
     this.paint.StrokeWidth = pen.Width;
     this.canvas.DrawLine(x1, y1, x2, y2, paint);
 }
 public void DrawImage(Bitmap bitmap, Rectangle target, Rectangle source, GraphicsUnit gu)
 {
     this.paint.Flags = 0;
     using (droid.Rect sa = source.ToRect())
         using (droid.Rect ta = target.ToRect())
         {
             this.canvas.DrawBitmap(bitmap.ABitmap, sa, ta, this.paint);
         }
 }
 public void DrawImage(Bitmap bitmap, Rectangle target, Rectangle source, GraphicsUnit gu)
 {
     this.paint.Flags = 0;
     using (droid.Rect sa = source.ToRect())
     using (droid.Rect ta = target.ToRect())
     {
         this.canvas.DrawBitmap(bitmap.ABitmap, sa, ta, this.paint);
     }
 }
 public void FillEllipse(Brush brush, float x, float y, float w, float h)
 {
     this.paint.Color = brush.Color.ToAColor();
     this.paint.Flags = this.Flags;
     this.paint.SetStyle(droid.Paint.Style.Fill);
     using (droid.RectF r = new RectangleF(x, y, w, h).ToRectF())
     {
         this.canvas.DrawOval(r, this.paint);
     }
 }
 public void DrawEllipse(Pen pen, float x, float y, float w, float h)
 {
     this.paint.Color = pen.Color.ToAColor();
     this.paint.Flags = this.Flags;
     this.paint.SetStyle(droid.Paint.Style.Stroke);
     this.paint.StrokeWidth = pen.Width;
     using (droid.RectF r = new RectangleF(x, y, w, h).ToRectF())
     {
         this.canvas.DrawOval(r, this.paint);
     }
 }
 public void DrawEllipse(Pen pen, RectangleF rect)
 {
     this.paint.Color = pen.Color.ToAColor();
     this.paint.Flags = this.Flags;
     this.paint.SetStyle(droid.Paint.Style.Stroke);
     this.paint.StrokeWidth = pen.Width;
     using (droid.RectF r = new RectangleF(rect.X, rect.Y, 1, 1).ToRectF())
     {
         this.canvas.DrawOval(r, this.paint);
     }
 }
        public void DrawString(string text, Font font, Brush brush, float x, float y)
        {
            this.paint.Color = brush.Color.ToAColor();
            this.paint.Flags = droid.PaintFlags.AntiAlias;

            this.paint.TextSize = font.Size;
            this.paint.SetTypeface(font.FontFamily.Typeface);
            this.paint.SetStyle(droid.Paint.Style.Fill);

            using (var fm = this.paint.GetFontMetrics())
            {
                this.canvas.DrawText(text, x, y - (fm.Top + fm.Bottom), this.paint);
            }
        }
        public void FillPolygon(Brush brush, PointF[] points)
        {
            this.paint.Color = brush.Color.ToAColor();
            this.paint.Flags = this.Flags;
            this.paint.SetStyle(droid.Paint.Style.Fill);

            // TODO: test that this works
            droid.Path path = new droid.Path();
            foreach (PointF p in points)
            {
                path.LineTo(p.X, p.Y);
            }

            this.canvas.DrawPath(path, this.paint);
        }
        public void DrawString(string text, Font font, Brush brush, RectangleF rect, StringFormat format)
        {
            // TODO:  use the StringFormat parameter

            this.paint.Color = brush.Color.ToAColor();
            this.paint.Flags = droid.PaintFlags.AntiAlias;

            this.paint.TextSize = font.Size;
            this.paint.SetTypeface(font.FontFamily.Typeface);
            this.paint.SetStyle(droid.Paint.Style.Fill);

            using (var fm = this.paint.GetFontMetrics())
            {
                this.canvas.DrawText(text, rect.Location.X, rect.Location.Y - (fm.Top + fm.Bottom), this.paint);
            }
        }
        public void DrawPolygon(Pen pen, Point[] points)
        {
            this.paint.Color = pen.Color.ToAColor();;
            this.paint.Flags = this.Flags;
            this.paint.SetStyle(droid.Paint.Style.Stroke);
            this.paint.StrokeWidth = pen.Width;

            // TODO: test that this works
            droid.Path path = new droid.Path();
            foreach (Point p in points)
            {
                path.LineTo(p.X, p.Y);
            }

            this.canvas.DrawPath(path, this.paint);
        }
 public void DrawImage(Bitmap bitmap, int x, int y)
 {
     this.paint.Flags = 0;
     this.canvas.DrawBitmap(bitmap.ABitmap, x, y, this.paint);
 }
 public void DrawRectangle(Pen pen, float x1, float y1, float w, float h)
 {
     this.paint.Color = pen.Color.ToAColor();
     this.paint.Flags = this.Flags;
     this.paint.SetStyle(droid.Paint.Style.Stroke);
     this.paint.StrokeWidth = pen.Width;
     this.canvas.DrawRect(x1, y1, x1 + w, y1 + h, this.paint);
 }
 public void DrawRectangle(Pen pen, Rectangle rect)
 {
     this.paint.Color = pen.Color.ToAColor();
     this.paint.Flags = this.Flags;
     this.paint.SetStyle(droid.Paint.Style.Stroke);
     this.paint.StrokeWidth = pen.Width;
     this.canvas.DrawRect(rect.X, rect.Y, rect.X + 1, rect.Y + 1, this.paint);
 }
 public void DrawEllipse(Pen pen, float x, float y, float w, float h)
 {
     this.paint.Color = pen.Color.ToAColor();
     this.paint.Flags = this.Flags;
     this.paint.SetStyle(droid.Paint.Style.Stroke);
     this.paint.StrokeWidth = pen.Width;
     using (droid.RectF r = new RectangleF(x, y, w, h).ToRectF())
     {
         this.canvas.DrawOval(r, this.paint);
     }
 }
 public void DrawEllipse(Pen pen, RectangleF rect)
 {
     this.paint.Color = pen.Color.ToAColor();
     this.paint.Flags = this.Flags;
     this.paint.SetStyle(droid.Paint.Style.Stroke);
     this.paint.StrokeWidth = pen.Width;
     using (droid.RectF r = new RectangleF(rect.X, rect.Y, 1, 1).ToRectF())
     {
         this.canvas.DrawOval(r, this.paint);
     }
 }
 private Graphics()
 {
     this.paint = new droid.Paint();
     this.Flags = droid.PaintFlags.AntiAlias;
     this.ownCanvas = false;
 }
 private Graphics()
 {
     this.paint     = new droid.Paint();
     this.Flags     = droid.PaintFlags.AntiAlias;
     this.ownCanvas = false;
 }
 public void FillRectangle(Brush brush, float x1, float y1, float w, float h)
 {
     this.paint.Color = brush.Color.ToAColor();
     this.paint.Flags = this.Flags;
     this.paint.SetStyle(droid.Paint.Style.Fill);
     this.canvas.DrawRect(x1, y1, x1 + w, y1 + h, this.paint);
 }
        public void DrawPolygon(Pen pen, Point[] points)
        {
            this.paint.Color = pen.Color.ToAColor(); ;
            this.paint.Flags = this.Flags;
            this.paint.SetStyle(droid.Paint.Style.Stroke);
            this.paint.StrokeWidth = pen.Width;

            // TODO: test that this works
            droid.Path path = new droid.Path();
            foreach (Point p in points)
            {
                path.LineTo(p.X, p.Y);
            }

            this.canvas.DrawPath(path, this.paint);
        }
 public void FillEllipse(Brush brush, float x, float y, float w, float h)
 {
     this.paint.Color = brush.Color.ToAColor();
     this.paint.Flags = this.Flags;
     this.paint.SetStyle(droid.Paint.Style.Fill);
     using (droid.RectF r = new RectangleF(x, y, w, h).ToRectF())
     {
         this.canvas.DrawOval(r, this.paint);
     }
 }
        public void FillPolygon(Brush brush, PointF[] points)
        {

            this.paint.Color = brush.Color.ToAColor();
            this.paint.Flags = this.Flags;
            this.paint.SetStyle(droid.Paint.Style.Fill);

            // TODO: test that this works
            droid.Path path = new droid.Path();
            foreach (PointF p in points)
            {
                path.LineTo(p.X, p.Y);
            }

            this.canvas.DrawPath(path, this.paint);
        }
 public void DrawLine(Pen pen, Point p1, Point p2)
 {
     this.paint.Color = pen.Color.ToAColor();
     this.paint.Flags = this.Flags;
     this.paint.SetStyle(droid.Paint.Style.Stroke);
     this.paint.StrokeWidth = pen.Width;
     this.canvas.DrawLine(p1.X, p1.Y, p2.X, p2.Y, paint);
 }
        public void DrawString(string text, Font font, Brush brush, float x, float y)
        {
            this.paint.Color = brush.Color.ToAColor();
            this.paint.Flags = droid.PaintFlags.AntiAlias;

            this.paint.TextSize = font.Size;
            this.paint.SetTypeface(font.FontFamily.Typeface);
            this.paint.SetStyle(droid.Paint.Style.Fill);

            using (var fm = this.paint.GetFontMetrics())
            {
                this.canvas.DrawText(text, x, y - (fm.Top + fm.Bottom), this.paint);
            }
        }
        public void DrawString(string text, Font font, Brush brush, RectangleF rect, StringFormat format)
        {
            // TODO:  use the StringFormat parameter

            this.paint.Color = brush.Color.ToAColor();
            this.paint.Flags = droid.PaintFlags.AntiAlias;

            this.paint.TextSize = font.Size;
            this.paint.SetTypeface(font.FontFamily.Typeface);
            this.paint.SetStyle(droid.Paint.Style.Fill);

            using (var fm = this.paint.GetFontMetrics())
            {
                this.canvas.DrawText(text, rect.Location.X, rect.Location.Y - (fm.Top + fm.Bottom), this.paint);
            }

        }
 public void DrawImage(Bitmap bitmap, int x, int y)
 {
     this.paint.Flags = 0;
     this.canvas.DrawBitmap(bitmap.ABitmap, x, y, this.paint);
 }
 public void DrawLine(Pen pen, float x1, float y1, float x2, float y2)
 {
     this.paint.Color = pen.Color.ToAColor();
     this.paint.Flags = this.Flags;
     this.paint.SetStyle(droid.Paint.Style.Stroke);
     this.paint.StrokeWidth = pen.Width;
     this.canvas.DrawLine(x1, y1, x2, y2, paint);
 }