Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Lose of quality in .NET Framework 4.0
Message
From
31/07/2010 17:53:04
 
 
To
31/07/2010 17:30:27
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01474757
Message ID:
01474758
Views:
54
I have adjusted this method to include an encoding for JPG as high quality and that resolves the issue:
        Public Function SaveAsHighQualityJpegFile() As Boolean
            Dim loEncoderParameters As System.Drawing.Imaging.EncoderParameters = Nothing
            Dim loImageCodecInfo As System.Drawing.Imaging.ImageCodecInfo = Nothing

            ' Set Image codec of JPEG type, the index of JPEG codec is "1"       
            loImageCodecInfo = System.Drawing.Imaging.ImageCodecInfo.GetImageEncoders()(1)

            ' Set the parameters for defining the quality of the thumbnail... here it is set to 100%
            loEncoderParameters = New System.Drawing.Imaging.EncoderParameters(1)

            loEncoderParameters.Param(0) = New System.Drawing.Imaging.EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 100L)

            oImage.Save(cFilePath, loImageCodecInfo, loEncoderParameters)
            Return True
        End Function
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform