private void SetupPictureBox(BmpCreationMode mode, string fileName) { if (mode == BmpCreationMode.Init) { bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height); } else if (mode == BmpCreationMode.FromFile) { bmp = new Bitmap(Bitmap.FromFile(openFileDialog1.FileName)); } gfx = Graphics.FromImage(bmp); if (mode == BmpCreationMode.Init) { gfx.Clear(Color.White); } pictureBox1.Image = bmp; gfx.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; }
private void SetupPictureBox(BmpCreationMode mode, string fileName) { if (mode == BmpCreationMode.Init) { bm = new Bitmap(Picture.Width, Picture.Height); } else if (mode == BmpCreationMode.File) { bm = new Bitmap(Bitmap.FromFile(fileName)); } g = Graphics.FromImage(bm); if (mode == BmpCreationMode.Init) { g.Clear(Color.White); } Picture.Image = bm; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; }