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