private void btAbrir_Click(object sender, System.EventArgs e) { if (ofdImagenes.ShowDialog() == DialogResult.Cancel) { return; } foreach (string imagen in ofdImagenes.FileNames) { v.Agregar_Foto(imagen); } pbImagenes.Image = v.Foto_Actual(); Console.WriteLine(v.Num_Actual); btAnt.Enabled = true; btSig.Enabled = true; btRotIzda.Enabled = true; btRotDcha.Enabled = true; btMas.Enabled = true; btMenos.Enabled = true; setMiniaturas(); }
private void imagenPrinci_DragDrop(object sender, DragEventArgs e) { try { String[] archivos = (String[])e.Data.GetData(DataFormats.FileDrop); for (int i = 0; i < archivos.Length; i++) { // Bitmap imagen = (Bitmap)Image.FromFile(archivos[i]); v.Agregar_Foto(archivos[i]); arrayNombres[numFotos] = archivos[i]; numFotos++; ubicarPuntero(); } agregarImagenes(); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
private void limpiarImagen() { if (v.Num_Fotos() != 0) { DialogResult dr = MessageBox.Show("¿Está seguro que desea eliminar la imagen del visor?", "Visor de imágenes", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information); if (dr == DialogResult.Yes) { Visor v2 = new Visor(616, 379); v2 = v; String[] arrayNombres2 = new String[500]; arrayNombres2 = arrayNombres; int nem = v.Num_Actual; num = v.Num_Actual; v = null; v = new Visor(616, 379); fila = 0; arrayNombres = null; arrayNombres = new String[500]; numFotos = 0; for (int i = 0; i < v2.Num_Fotos(); i++) { if (i != num) { v.Agregar_Foto(arrayNombres2[i]); arrayNombres[numFotos] = arrayNombres2[i]; numFotos++; } } limpiarCasillas(); ubicarPuntero(); agregarImagenes(); if (nem == v.Num_Fotos()) { elegirNumero(nem - 1); } else { elegirNumero(nem); } if (v.Num_Fotos() == 0) { foreach (PictureBox j in myAL) { j.BackColor = Color.Black; } imagenPrinci.Image = null; label1.Text = "0/0"; label2.Text = ""; } } } }