我的任务是降低网络驱动器的文件/文件夹系统上的图片质量。
代码:
Dim bmp1 As New Bitmap("U:\Image1.jpg")
Dim jpgEncoder As ImageCodecInfo = GetEncoder(ImageFormat.Jpeg)
Dim myEncoder As System.Drawing.Imaging.Encoder = System.Drawing.Imaging.Encoder.Quality
Dim myEncoderParameters As New EncoderParameters(1)
Dim myEncoderParameter As New EncoderParameter(myEncoder, 50&)
myEncoderParameters.Param(0) = myEncoderParameter
bmp1.Save("U:\Image1.jpg", jpgEncoder, myEncoderParameters)
我收到以下错误:“GDI+ 中出现一般错误”。无论如何要保存而不是复制到另一个文件?
提前致谢!