public class afis_xt { public System.Drawing.Graphics zona_des; public System.Drawing.Pen c_contur = new System.Drawing.Pen(System.Drawing.Color.Tomato, 2); int x0; int y0; int w; int h; double val_max; public void sterg(Color culoare_fundal) { zona_des.FillRectangle(new SolidBrush(culoare_fundal), x0 + 2, y0 + 2, w - 2, h - 2); } public void setval(Color culoare_grafic, double[] vals, int nrv) { int val_v, val; val_v = 0; for (int i = 0; i < nrv; i++) { val = System.Convert.ToInt16(System.Convert.ToDouble(vals[i]) * (System.Convert.ToDouble(h) / System.Convert.ToDouble(val_max))); //scalare zona_des.DrawLine(new Pen(culoare_grafic), x0 + i, y0 + val_v, x0 + i+1, y0 + val); val_v = val; } zona_des.DrawRectangle(c_contur, x0 + 1, y0 + 1, w, h); } public afis_xt(System.Drawing.Graphics desen, int pozx, int pozy, int nr_valori, int inaltime, double vmax) { zona_des = desen; x0 = pozx; y0 = pozy; w = nr_valori; h = inaltime; val_max = vmax; } }