<Extension()> _
Public Sub Save(ByVal b As Bitmap, ByVal FileName As String, ByVal Compression As Long, ByVal MimeType As String)
Dim Params As EncoderParameters = New EncoderParameters(2)
Dim CodecInfo As ImageCodecInfo = GetEncoderInfo(MimeType)
Params.Param(0) = New EncoderParameter(Encoder.RenderMethod, EncoderValue.RenderProgressive)
Params.Param(1) = New EncoderParameter(Encoder.Quality, Compression)
b.Save(FileName, CodecInfo, Params)
End Sub
this does not work. Its not saved as progressive. How can i do this, and maybe also specify the nr of passes.??
As far as I can tell, it’s not supported. I have tried code suggested here and here and arrived at this C# code:
Setting both interlaced and progressive mode, it still saves a regular baseline JPEG. I have tried any combination of either setting and their alternative settings (non-interlaced and non-progressive), and haven’t seen any difference at all in the resulting image file.
I haven’t found any response from anyone saying that they have actually managed to save a progressive JPEG in .NET.
Both the
ScanMethodInterlacedandRenderProgressiveparameter values are described only as “Not used in GDI+ version 1.0.” inthe documentation.