private void cargar_imagenes(ImageSet listaMF) { tests = new Test_MF[3]; var img = new Image[9]; for (int i = 0; i < 9; i++) { img[i] = listaMF[i]; } tests[0] = new Test_MF(img, new[] { 2, 5, 6 }); img = new Image[9]; for (int i = 0; i < 9; i++) { img[i] = listaMF[i + 9]; } tests[1] = new Test_MF(img, new[] { 1, 6, 7 }); img = new Image[9]; for (int i = 0; i < 9; i++) { img[i] = listaMF[i + 18]; } tests[2] = new Test_MF(img, new[] { 7, 0, 2 }); }
public void Paint(object sender, PaintEventArgs e) { int W = this.c.Width; int H = this.c.Height; int a = 2 * this.c.Width / 9; int b = 2 * this.c.Height / 9; Graphics g = c.CreateGraphics(); g.Clear(fondo); if (estado == Estado_MF.Tres) { actual = tests[ronda]; g.DrawImage(actual.matriz[tests[ronda].indices[0]], W / 18, 7 * H / 18, a, b); g.DrawImage(actual.matriz[tests[ronda].indices[1]], 7 * W / 18, 7 * H / 18, a, b); g.DrawImage(actual.matriz[tests[ronda].indices[2]], 13 * W / 18, 7 * H / 18, a, b); return; } if (estado == Estado_MF.Nueve) { g.DrawImage(actual.matriz[0], W / 18, H / 18, a, b); g.DrawImage(actual.matriz[1], 7 * W / 18, H / 18, a, b); g.DrawImage(actual.matriz[2], 13 * W / 18, H / 18, a, b); g.DrawImage(actual.matriz[3], W / 18, 7 * H / 18, a, b); g.DrawImage(actual.matriz[4], 7 * W / 18, 7 * H / 18, a, b); g.DrawImage(actual.matriz[5], 13 * W / 18, 7 * H / 18, a, b); g.DrawImage(actual.matriz[6], W / 18, 13 * H / 18, a, b); g.DrawImage(actual.matriz[7], 7 * W / 18, 13 * H / 18, a, b); g.DrawImage(actual.matriz[8], 13 * W / 18, 13 * H / 18, a, b); return; } }
private void cargar_imagenes(ImageSet listaMF) { var ind = new int[27]; for (int i = 0; i < 27; i++) { ind[i] = i; } for (int i = 0; i < 27; i++) { int k = rand.Next(0, 26 - i); int temp = ind[k]; ind[k] = ind[26 - i]; ind[26 - i] = temp; } var img = new Image[9]; for (int i = 0; i < 9; i++) { img[i] = listaMF[i]; } tests[0] = new Test_MF(img, new[] { 0, 1, 8 }); img = new Image[9]; for (int i = 0; i < 9; i++) { img[i] = listaMF[i + 9]; } tests[1] = new Test_MF(img, new[] { 2, 3, 7 }); img = new Image[9]; for (int i = 0; i < 9; i++) { img[i] = listaMF[i + 18]; } tests[2] = new Test_MF(img, new[] { 4, 5, 6 }); }
private void St() { this.EnCurso = true; int W = this.control.Width; int H = this.control.Height; int a = 2 * this.control.Width / 9; int b = 2 * this.control.Height / 9; Graphics g = control.CreateGraphics(); g.Clear(fondo); for (int i = 0; i < 3; i++) { if (i != 0) { Thread.Sleep(descanso); } actual = tests[i]; estado = Estado_MF.Tres; g.DrawImage(actual.matriz[tests[i].indices[0]], W / 18, 7 * H / 18, a, b); g.DrawImage(actual.matriz[tests[i].indices[1]], 7 * W / 18, 7 * H / 18, a, b); g.DrawImage(actual.matriz[tests[i].indices[2]], 13 * W / 18, 7 * H / 18, a, b); Thread.Sleep(presentacion); g.Clear(fondo); estado = Estado_MF.Nueve; g.DrawImage(actual.matriz[0], W / 18, H / 18, a, b); g.DrawImage(actual.matriz[1], 7 * W / 18, H / 18, a, b); g.DrawImage(actual.matriz[2], 13 * W / 18, H / 18, a, b); g.DrawImage(actual.matriz[3], W / 18, 7 * H / 18, a, b); g.DrawImage(actual.matriz[4], 7 * W / 18, 7 * H / 18, a, b); g.DrawImage(actual.matriz[5], 13 * W / 18, 7 * H / 18, a, b); g.DrawImage(actual.matriz[6], W / 18, 13 * H / 18, a, b); g.DrawImage(actual.matriz[7], 7 * W / 18, 13 * H / 18, a, b); g.DrawImage(actual.matriz[8], 13 * W / 18, 13 * H / 18, a, b); Thread.Sleep(muestra); g.Clear(fondo); actual.fin_test(); this.estado = Estado_MF.Descanso; } this.estado = Estado_MF.Nulo; this.EnCurso = false; int A = 0, O = 0, E = 0; foreach (Test_MF t in tests) { A += t.Aciertos; O += t.Omisiones; E += t.Errores; } Resultado = new Resultado_MF(this.codigoPaciente, E, O, A, DateTime.Now, true); var f = new Font(FontFamily.GenericSansSerif, 25, FontStyle.Bold); Brush brush = new SolidBrush(Color.LightYellow); g.DrawString("Ha terminado la prueba", f, brush, 40, 30); }