public void SetOptions(ImageSettings imageSettings) { bitmap = new Bitmap(imageSettings.Size.Width, imageSettings.Size.Height); graphics = Graphics.FromImage(bitmap); layouter.SetCenter(new Point(imageSettings.Size.Width / 2, imageSettings.Size.Height / 2)); graphics.Clear(imageSettings.Background); }
public void SetOptions(ImageSettings imageSettings) { if (imageSettings.Size.Height <= 0 || imageSettings.Size.Height <= 0) { throw new AggregateException("Size have zero width or height"); } bitmap = new Bitmap(imageSettings.Size.Width, imageSettings.Size.Height); graphics = Graphics.FromImage(bitmap); graphics.Clear(imageSettings.Background); layouter.SetCenter(new Point(imageSettings.Size.Width / 2, imageSettings.Size.Height / 2)); }