private static void DrawGraphics(ReticleDefinition reticle, string baseName) { var bm1 = new Bitmap(1024, 1024); var canvas = GraphicsCanvas.FromImage(bm1, Color.White); canvas.Clear(); var controller = new ReticleDrawController(reticle, canvas); controller.DrawReticle(); bm1.Save($"{baseName}-a.png", ImageFormat.Png); }
internal void UpdateImage() { if (Reticle.Size == null) { picturePreview.Image = null; return; } AppForm.CalculateReticleImageSize(picturePreview.Size.Width, picturePreview.Size.Height, Reticle.Size.X, Reticle.Size.Y, out int imageX, out int imageY); Bitmap bm = new Bitmap(imageX, imageY); GraphicsCanvas canvas = GraphicsCanvas.FromImage(bm, Color.White); ReticleDrawController controller = new ReticleDrawController(Reticle, canvas); canvas.Clear(); controller.DrawElement(Path); picturePreview.Image = bm; }