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); }
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); }
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); }
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); } }
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); }
public override void Draw() { DrawingApi.DrawArc(_x, _y, _angle); }
// low-level i.e. Implementation specific public override void Draw() { DrawingApi.DrawCircle(_x, _y, _radius); }
public override void Draw() { DrawingApi.DrawCircle(x, y, radius); }