using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
using
System.Windows.Forms;
using
System.IO;
namespace
Esponja07
{
public
partial
class
Form1
: Form
{
public
Form1()
{
InitializeComponent();
}
private
void
Form1_Load(object
sender, EventArgs e)
{
this.Text
= "Esponja
07 "
+ DateTime.Now.ToShortDateString();
DirectoryInfo
dir = new
DirectoryInfo(@"D:\xampp\htdocs\Galeria\MANGA\1\Barba
de Maíz\");
foreach
(FileInfo file in
dir.GetFiles())
{
string
Ext = ".jpg";
string
fExtension = file.Extension.ToLower();
if
(fExtension == Ext)
{
Resultado.Items.Add(file.Name.Substring(0,
file.Name.Length - 4));
}
}
}
}
}
using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
using
System.Windows.Forms;
using
System.IO;
namespace
Esponja07
{
public
partial
class
Form1
: Form
{
public
Form1()
{
InitializeComponent();
}
private
void
Form1_Load(object
sender, EventArgs e)
{
this.Text
= "Esponja
07 "
+ DateTime.Now.ToShortDateString();
DirectoryInfo
dir = new
DirectoryInfo(@"D:\xampp\htdocs\Galeria\MANGA\1\Barba
de Maíz\");
foreach
(FileInfo file in
dir.GetFiles())
{
string
Ext = ".jpg";
string
fExtension = file.Extension.ToLower();
if
(fExtension == Ext)
{
Resultado.Items.Add(file.Name.Substring(0,
file.Name.Length - 4));
}
}
}
private
void
Resultado_SelectedIndexChanged(object
sender, EventArgs e)
{
}
private
void
Resultado_SelectedIndexChanged_1(object
sender, EventArgs e)
{
if
(Resultado.SelectedItem != null)
{
Bitmap
B2 = new
Bitmap(@"D:\xampp\htdocs\Galeria\MANGA\1\Barba
de Maíz\"
+
Resultado.SelectedItem.ToString()
+ ".jpg");
int
Xt = B2.Width;
int
X = Convert.ToInt32((B2.Width * Preview.Width) / Xt);
int
Y = Convert.ToInt32((B2.Height * Preview.Width) / Xt);
Preview.Image
= new
Bitmap(B2, X, Y);
}
}
}
}


No hay comentarios.:
Publicar un comentario