public class drcon { int x0, y0, w0, h0; System.Drawing.Graphics zona_des; public void desenez(Color culoare_contur) { zona_des.DrawRectangle(new Pen(culoare_contur), x0, y0, w0, h0); } public void sterg(Color culoare_stergere) { zona_des.FillRectangle(new SolidBrush(culoare_stergere), x0 + 1, y0 + 1, w0 - 2, h0 - 2); } public void setdr(Color culoare_dr, int w, int h) { int x = System.Convert.ToInt16(System.Convert.ToDouble(x0) + System.Convert.ToDouble(w0 - w) / 2); int y = System.Convert.ToInt16(System.Convert.ToDouble(y0) + System.Convert.ToDouble(h0 - h) / 2); zona_des.DrawRectangle(new Pen(culoare_dr), x + 1, y + 1, w, h); } public drcon(System.Drawing.Graphics desen, int pozx, int pozy, int lat, int inalt) { zona_des = desen; x0 = pozx; y0 = pozy; w0 = lat; h0 = inalt; } }