VB.NET: Create a thumbnail from a graphic file

Recently I was working on an Explorer Type Application in VB.NET. For this I was required to generate theThumbnails of various files to show the preview. Well; The most simplest one was of graphics. Here is a cut down version of the actual code that I used. In fact this sample is a breif idea of how to generate the thumbnails. You can use your own methods to figure out the height and width of the thumbnails which maintains the aspect ratio.

Do remember to add the following lines in the begining of your module:
Imports System.Drawing.Graphics
Imports System.Drawing
Imports System.Windows.Forms
Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.