I am creating a Windows Forms application. How to get window shape size?
I currently have something similar to my code:
PictureBox display = new PictureBox(); display.Width = 360; display.Height = 290; this.Controls.Add(display); display.Image = bmp;
However, the size of my display is hardcoded to a specific value.
I know that if I want to draw a square that resizes, I can use something like this:
private Rectangle PlotArea; private int offset = 30; protected override void OnPaint(PaintEventArgs e) { Graphics g = e.Graphics;
Is there a way to use method one and capture the shape size for Height and Width?
I tried the following code but it does not work ...
PictureBox display = new PictureBox(); display.Width = ClientRectangle.Y; display.Height = ClientRectangle.X; this.Controls.Add(display); display.Image = bmp;
source share