请问老师,这样的代码压缩图片之后图片反而变大了,还能怎么处理下?
If dlg.ShowDialog = DialogResult.OK Then
Dim fpath As String = "/Attachments/产品图/"
If ftp1.DirExists(fpath) = False Then ftp1.MakeDir(fpath)
For Each fl As String In dlg.FileNames
Dim fileInfo As new FileInfo(fl)
Dim file As String = fl
Dim img As image = getImage(file)
Dim bmp As bitmap
bmp = new bitmap(img, 320, 320 * (img.height / img.width))
bmp.save(ProjectPath & "\Attachments\产品图\" & e.Row("产品名称") & ".jpg" )
bmp.Dispose
fl = ProjectPath & "\Attachments\产品图\" & e.Row("产品名称") & ".jpg"
If Ftp1.Upload(fl,fpath & filesys.GetName(fl)) = True Then
End If
e.Row("产品图") = "产品图\" & e.Row("产品名称") & ".jpg"
Next
End If
此主题相关图片如下:位深度.png
