public class afis_xt_m { System.Drawing.Graphics zona_des; int x0; int y0; int w; int h; double val_max; int nrv; public void desenez(Color culoare_contur) { zona_des.DrawRectangle(new Pen(culoare_contur), x0 - 1, y0 - 1, w + 2, h + 2); } public void sterg(Color culoare_fundal) { zona_des.FillRectangle(new SolidBrush(culoare_fundal), x0 + 1, y0 + 1, w - 2, h - 2); } public void setval(Color cul, double[] vals) { float val_v, val; val_v = 0; for (int i = 1; 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(cul), x0 + (i - 1) * 10, y0 + val_v, x0 + i * 10, y0 + val); zona_des.DrawEllipse(new Pen(cul), x0 + i * 10 - 3, y0 + 5 + val - 3, 6, 6); val_v = val; } } public afis_xt_m(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 * 10; h = inaltime; nrv = nr_valori; val_max = vmax; desenez(Color.Blue); } }