I'm trying to have a rectangle that changes size based on a value, But I cannot get it to update. If I draw the rectangle with set values it shows up, But if I then add a "*" operator to it, it does not show.
I've never used winform graphics before, this is based on other posts i've come across.
The code:
private void Send()
{
int l = 25, r = 20; // Testing values
using (Graphics g = this.MainPanel.CreateGraphics())
{
Brush brush = new SolidBrush(Color.LimeGreen);
g.FillRectangle(brush, 59, 74, 16, 56 * (l / 100));
g.FillRectangle(brush, 81, 74, 16, 56 * (r / 100));
brush.Dispose();
this.Invalidate();
}
string start = l + ":" + r + ".";
char[] end = start.ToCharArray();
port.Write(new string(end));
}
This bit of code runs every 15ms if that matters.