public byte[] ImageAArray(System.Drawing.Image imagen)
{
System.IO.MemoryStream ms = new System.IO.MemoryStream();
imagen.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
return ms.ToArray();
}
public System.Drawing.Image ArrayAImage(byte[] ArrBite)
{
System.IO.MemoryStream ms = new System.IO.MemoryStream(ArrBite);
System.Drawing.Image returnImage = System.Drawing.Image.FromStream(ms);
return returnImage;
}
lvImagenes.Clear();
System.Collections.ArrayList pics = PicturesBO.GetPics();
ImageList imgList = new ImageList();
imgList.ImageSize = new Size(120, 120);
foreach (IMAGESDB i in pics)
{
System.Drawing.Image img = ArrayAImage(i.IMAGEFILE);
imgList.Images.Add(img);
}
lvImagenes.View = View.LargeIcon;
lvImagenes.LargeImageList = imgList;
for (int j = 0; j < imgList.Images.Count; j++)
{
ListViewItem item = new ListViewItem();
item.ImageIndex = j;
lvImagenes.Items.Add(item);
}