private static void addTank(FlowLayoutPanel printerPanel, InkTank tank) { // add label string tankName = tank.Color.Name; if (tank.IsPhoto) { tankName = "Photo " + tankName; } // add progress bar ColorBar barTank = new ColorBar(); if (tank.IsPhoto) { //Color.FromArgb(0, tank.Color); const int upVal = 100; barTank.ForeColor = Color.FromArgb( Math.Min(255, tank.Color.R + upVal), Math.Min(255, tank.Color.G + upVal), Math.Min(255, tank.Color.B + upVal)); } else { barTank.ForeColor = tank.Color; } barTank.TextColor = Color.FromArgb(255 - barTank.ForeColor.R, 255 - barTank.ForeColor.G, 255 - barTank.ForeColor.B); barTank.Height = 15; barTank.Width = printerPanel.Width - barTank.Left * 2; barTank.Value = (int)tank.Pct; barTank.Text = tankName + " (" + tank.Pct + "%)"; printerPanel.SetFlowBreak(barTank, true); printerPanel.Controls.Add(barTank); }
private static void addTank(FlowLayoutPanel printerPanel, InkTank tank) { // add label string tankName = tank.Color.Name; if (tank.IsPhoto) tankName = "Photo " + tankName; // add progress bar ColorBar barTank = new ColorBar(); if (tank.IsPhoto) { //Color.FromArgb(0, tank.Color); const int upVal = 100; barTank.ForeColor = Color.FromArgb( Math.Min(255, tank.Color.R + upVal), Math.Min(255, tank.Color.G + upVal), Math.Min(255, tank.Color.B + upVal)); } else { barTank.ForeColor = tank.Color; } barTank.TextColor = Color.FromArgb(255 - barTank.ForeColor.R, 255 - barTank.ForeColor.G, 255 - barTank.ForeColor.B); barTank.Height = 15; barTank.Width = printerPanel.Width - barTank.Left * 2; barTank.Value = (int)tank.Pct; barTank.Text = tankName + " (" + tank.Pct + "%)"; printerPanel.SetFlowBreak(barTank, true); printerPanel.Controls.Add(barTank); }