Dim file As String = "d:\test.jpg" Dim img As image = getImage(file) Dim bmp As bitmap If img.width > 800 Then If 800 * (img.height / img.width) > 600 Then bmp = new bitmap(img, 800*(600/(800*(img.height/img.width))), 600) Else bmp = new bitmap(img, 800, 800 * (img.height / img.width)) End If End If bmp.save("d:\缩略图.jpg") bmp.Dispose