Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Lose of quality in .NET Framework 4.0
Message
De
31/07/2010 17:53:04
 
 
À
31/07/2010 17:30:27
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01474757
Message ID:
01474758
Vues:
53
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform