In my form load I have this:
private void PrintingDesignForm_Load(object sender, System.EventArgs e) {
int formWidth = this.Width; //300
int formHeight = this.Height; //300
decimal rectWidth = 1000;
decimal rectHeight = 800;
// Code to scale down rectangle
this.Paint += (se, pe) => {
var r = new Rectangle(0, 0, (int)Math.Floor(rectWidth), (int)Math.Floor(rectHeight));
var brush = new SolidBrush(Color.FromArgb(255, 255, 204));
pe.Graphics.FillRectangle(brush, r);
using (var pen = new Pen(brush.Color, 2))
pe.Graphics.DrawRectangle(pen, r);
};
}
I am trying to resize my rectangle so it will fit the form size in proportion to the rectangle size.
How can I do this?