title: VB.NET Out of Memory Issue on ImageList
body: <p><strong>EDITED:</strong>
  I'm getting an <strong><em>"Out of Memory"</em></strong> error by loading images to an ImageList even when I put <code>dispose()</code> or <code>End Using</code> after adding bitmap to ImageList.</p>
  
  <p>Here's my code.</p>
  
  <pre><code>Function loadImage()
      Dim item As New ListViewItem
  
      imageList.ImageSize = New Size(45, 70)
  
      For Each value In arr
          If System.IO.File.Exists(value) Then
              Using img As New Bitmap(value)
                  imageList.Images.Add(Image.FromHbitmap(img.GetHbitmap))
              End Using
              newListView.LargeImageList = imageList
              item = New ListViewItem(value)
              newListView.Items.Add(item)
              item.Name = value
              item.Tag = System.IO.Path.GetDirectoryName(value)
              newListView.Items(item.Index).ImageIndex = item.Index
          End If
      Next
  
      newListView.View = View.LargeIcon
      Return Nothing
  End Function
  </code></pre>
  
  <p>I have 96 values on <code>arr</code> consists of image path and only 82 of them gets to be displayed then the OOM error occured.</p>
  
  <p>Maybe I misused the <code>Using</code> statement or anything. I hope you can help me with this. Thanks!</p>