Exemplo n.º 1
0
 private void Canvas_SizeChanged(object sender, EventArgs e)
 {
     bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height);
     pictureBox1.Image = bmp;
     gToScreen         = Graphics.FromImage(bmp);
     DrawingApi.SetUp(gToScreen);
 }
Exemplo n.º 2
0
 public override void Draw()
 {
     DrawingApi.DrawLine(_x, _y, _x, _y + _height);
     DrawingApi.DrawLine(_x, _y + _height, _x + _width, _y + _height);
     DrawingApi.DrawLine(_x + _width, _y + _height, _x + _width, _y);
     DrawingApi.DrawLine(_x + _width, _y, _x, _y);
 }
Exemplo n.º 3
0
        public static void AddApi(Script script)
        {
            script.Globals["PrintChat"] = (Action <string>)Game.PrintChat;

            //Add API's
            DrawingApi.AddApi(script);
            UtilApi.AddApi(script);
            UnitApi.AddApi(script);
        }
Exemplo n.º 4
0
 private void CaseMouseUp(MouseEventArgs e)
 {
     isDrawing = false;
     if (DrawingApi.xData.Type != ShapeType.MULTILINE)
     {
         DrawingApi.Render(gToScreen, DrawingApi.xData.PrevPoint, new Point(e.X, e.Y));
         DrawingApi.xData.addPosition(e.Location);
     }
 }
Exemplo n.º 5
0
        private void Constructor()
        {
            this.pictureBox1.MouseDown += pictureBox1_MouseDown;
            this.pictureBox1.MouseUp   += pictureBox1_MouseUp;
            this.pictureBox1.MouseMove += pictureBox1_MouseMove;
            this.UpdateCanvas          += Canvas_UpdateCanvas;

            context          = new ContextControl();
            gToScreen        = this.CreateGraphics();
            DrawingApi.xData = new XData();
            DrawingApi.SetUp(gToScreen);
        }
Exemplo n.º 6
0
 public override void Draw()
 {
     DrawingApi.DrawArc(_x, _y, _angle);
 }
Exemplo n.º 7
0
 // low-level i.e. Implementation specific
 public override void Draw()
 {
     DrawingApi.DrawCircle(_x, _y, _radius);
 }
Exemplo n.º 8
0
 public override void Draw()
 {
     DrawingApi.DrawCircle(x, y, radius);
 }