public void doAction() { using (Graphics g = Graphics.FromImage(f.getBitmap())) { g.DrawRectangle(Pens.White, f.getCurrentX(), f.getCurrentY(), width, height); g.Dispose(); } f.getMainDraw().Invalidate(); }
public void doAction() { using (Graphics g = Graphics.FromImage(f.getBitmap())) { g.Clear(Color.FromArgb(0, 34, 36, 39)); g.Dispose(); } f.getMainDraw().Invalidate(); }
public void doAction() { using (Graphics g = Graphics.FromImage(f.getBitmap())) { g.DrawEllipse(Pens.White, f.getCurrentX(), f.getCurrentY(), radius, radius); g.Dispose(); } f.getMainDraw().Invalidate(); }
public void doAction() { using (Graphics g = Graphics.FromImage(f.getBitmap())) { Point currentPoint = new Point(f.getCurrentX(), f.getCurrentY()); Point drawToPoint = new Point(x, y); g.DrawLine(new Pen(Color.White), currentPoint, drawToPoint); g.Dispose(); } f.getMainDraw().Invalidate(); f.setCurrentX(x); f.setCurrentY(y); f.getLabelX().Text = "Current X: " + x; f.getLabelY().Text = "Current Y: " + y; }
public void doAction() { if (trianglePossible()) { using (Graphics g = Graphics.FromImage(f.getBitmap())) { g.DrawPolygon(Pens.White, drawPoints()); g.Dispose(); } f.getMainDraw().Invalidate(); } else { System.Windows.Forms.MessageBoxButtons button = System.Windows.Forms.MessageBoxButtons.OK; string caption = "Invalid parameters"; string message = ("Cannot make triangle from these sides"); System.Windows.Forms.MessageBoxIcon icon = System.Windows.Forms.MessageBoxIcon.Error; System.Windows.Forms.MessageBox.Show(message, caption, button, icon); } }