private void afis_bin_vw(Graphics desen,int px0,int py0,int bit_w,int nr_biti,string[] nume_biti, UInt64 n) { System.Drawing.SolidBrush p_verde, p_rosie, p_gri; System.Drawing.Pen creion; System.Drawing.Font f_nina; p_verde = new System.Drawing.SolidBrush(System.Drawing.Color.Lime); p_rosie = new System.Drawing.SolidBrush(System.Drawing.Color.Red); p_gri = new System.Drawing.SolidBrush(System.Drawing.Color.LightGray); creion = new System.Drawing.Pen(System.Drawing.Color.Gray, 2); f_nina = new System.Drawing.Font("Nina", 10); int x = px0 + bit_w; int y = py0 + bit_w; int i; for (i = nr_biti - 1; i >= 0; i--) { desen.DrawEllipse(creion, x - 1, y - 1, bit_w + 2, bit_w + 2); desen.DrawString(nume_biti[nr_biti - i - 1], f_nina, p_rosie, x + 2 * bit_w, y); System.UInt64 bit = ((n >> (nr_biti - i - 1)) & 1); if (bit == 1) desen.FillEllipse(p_verde, x, y, bit_w, bit_w); else desen.FillEllipse(p_gri, x, y, bit_w, bit_w); y += 2 * bit_w; } }