I've been tasked with reducing the quality of pictures on a network drive's file/folder system.
Code:
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)
I get the following error: "A generic error occured in the GDI+". Is there anyway to save instead of copying to another file?
Thanks in advance!