public void DrawImage(string image, Rectangle destination) { using (var g = Graphics.FromImage(_image)) { System.Drawing.Rectangle rectangle = new System.Drawing.Rectangle(destination.X, destination.Y, destination.Width, destination.Lenght); g.DrawImage(_textureFacoFactory.getTexture(image), rectangle); canvas.Invalidate(); } }
public void DrawText(string text, Rectangle rectangle) { using (var g = Graphics.FromImage(_image)) { var font = new Font("Courier", rectangle.Width); var brush = new SolidBrush(_color); var drawFormat = new StringFormat(); g.DrawString(text, font, brush, rectangle.X, rectangle.Y, drawFormat); canvas.Invalidate(); } }
public void DrawRectangle(Rectangle destination) { using (var g = Graphics.FromImage(_image)) { System.Drawing.Rectangle rectangle = new System.Drawing.Rectangle(destination.X, destination.Y, destination.Width, destination.Lenght); g.FillRectangle(new SolidBrush(_color), rectangle); g.DrawRectangle(new Pen(_color), rectangle); canvas.Invalidate(); } //throw new NotImplementedException(); }