这是我转换图像的代码
Public Sub ConvertImage(ByVal Filename As String, _
ByVal DesiredFormat As System.Drawing.Imaging.ImageFormat, _
ByVal NewFilename As String)
NewFilename = "ConvertedToPNG-" + NewFilename + "-" + Format(Date.Now, "MMMMddyyyyhhmmtt")
Try
Dim imgFile As System.Drawing.Image = _
System.Drawing.Image.FromFile(Filename)
imgFile.Save(txtPNGFileDestination.Text & "\" & NewFilename, DesiredFormat)
Catch ex As Exception
Throw ex
End Try
End Sub
它运行正常,但保存的图像没有 PNG 文件扩展名,因此它只是一个文件。我做错什么了吗?
谢谢你的帮助