Note that there are some explanatory texts on larger screens.

plurals
  1. POMultiple image thumbnail viewer
    text
    copied!<p>I am trying to create a simple winform application in c# that can load multiple images from a file dialog into the application screen. I am using ListView control to contain those images as picture box control wasn't going to serve my needs as I want to be able to select loaded thumbnails and do many other things based on the selection.</p> <p>The problem I am having is to do with <strong>thumbnail image quality.</strong> Once they get loaded in the application window panel, the image quality is very poor. I want them to look just like how Windows operating system displays preview/thumbnails of images in large icon with a decent image quality.</p> <p>I've tried adding this <code>listView1.LargeImageList.ColorDepth = ColorDepth.Depth32Bit;</code> as suggested by other people but it won't even let the app load images.</p> <p>Here is the code done so far.</p> <pre><code>using (OpenFileDialog open = new OpenFileDialog()) { open.Title = "Open Image"; open.Filter = "JPEG Files (*.jpg)|*.jpg;*.jpeg|All Files (*.*)|*.*"; open.Multiselect = true; if (open.ShowDialog() == DialogResult.OK) { ImageList picList = new ImageList(); listView1.View = View.LargeIcon; picList.ImageSize = new Size(200, 130); foreach (String file in open.FileNames) { Image i = Image.FromFile(file); Image pic = i.GetThumbnailImage(200, 130, null, new IntPtr()); picList.Images.Add(pic); } listView1.LargeImageList = picList; listView1.LargeImageList.ColorDepth = ColorDepth.Depth32Bit; for (int i = 0; i &lt; picList.Images.Count; i++) { ListViewItem item = new ListViewItem(); item.ImageIndex = i; listView1.Items.Add(item); } } </code></pre> <p>Does anyone have a suggestion as to what I should do to make it just as good as Windows' default thumbnail viewer? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload