private void DrawPictureBox(Graphics g, Pen pen, Bitmap img, PictureBox pic, WaterL waterL, int trackBar) { pen.Brush = Brushes.HotPink; g.DrawLine(pen, new Point(0, 0), new Point(15 * 5, 150)); //= pen.Brush = Brushes.LightBlue; g.DrawLines(pen, new Point[] { new Point(0, 150), new Point(75, 0), new Point(150, 150) }); //= pen.Brush = Brushes.Khaki; g.DrawLine(pen, new Point(150, 0), new Point(15 * 5, 150)); //int y; if (waterL._small != 0) { //màu của bút pen.Brush = Brushes.Bisque; DrawLine(pen, g, waterL._small, trackBar); } if (waterL._Medium != 0) { //màu của bút pen.Brush = Brushes.Brown; DrawLine(pen, g, waterL._Medium, trackBar); } if (waterL._heavy != 0) { pen.Brush = Brushes.DarkOrange; DrawLine(pen, g, waterL._heavy, trackBar); } pic.Image = img; g.Dispose(); }
//Cân nặng private void UpdateWeight() { //trọng lượng tối đa là 10kg label_trongluong.Text = "Trọng lượng : " + ((float)trackBar_kg.Value / 10).ToString() + " kg"; weightClothes = new Weight(trackBar_kg.Value); //washing = new Washing(); //lượng nước tối đa là 140 lít label_luongnuoc.Text = "Lượng nước : " + ((float)trackBar_kg.Value * 1.4).ToString() + " lít"; waterr = new WaterL(); //label_luongnuoc.Text = "Lượng nước : " +waterr.ComputeTime4(weightClothes).ToString()+ " lít"; this.Invalidate(); }
public WaterLOut(Graphics g, Pen pen, Bitmap img, PictureBox pic, WaterL waterL, int trackBar) { DrawPictureBox(g, pen, img, pic, waterL, trackBar); //GraphicChar(g, pen, waterL, checkBox_Fill); }