I wrote a Windows application that loads thumbnail images from .jpg files on disk. The thumbnail pictureboxes are 100x128 pixels. The original images can be from 4kb to 2 mb in size. On my development machine it works fine, but the target machine is a Microsoft Surface with much less memory.
Here is the line that I use to load the images:
Dim imgSrc As Image = New Bitmap(Image.FromFile(<filename>), New Size(120, 128))
Thinking that this would rescale the image to a smaller size, but it apparently doesn't.
In Debug mode, when I look at the image's properties, the size is as specified in the line above, and the resolution is 96, values that are definitely smaller than the original image's properties.
Is this the wrong way to do it? Do I need to be clearing memory, or something?
EDIT: I should have checked this first, but both my development machine and the Surface show to have 8g of ram.