Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Resized image is not in a recognized format
Message
De
04/03/2009 23:14:04
 
 
À
04/03/2009 02:28:01
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01383685
Message ID:
01385701
Vues:
26
This works:
        Public Function SaveAsHighQualityJpegFile() As Boolean
            Dim loEncoderParameters As System.Drawing.Imaging.EncoderParameters = New System.Drawing.Imaging.EncoderParameters(1)
            Dim loImageCodecInfo As System.Drawing.Imaging.ImageCodecInfo = Nothing
            Dim loCodec As System.Drawing.Imaging.ImageCodecInfo

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

            For Each loCodec In System.Drawing.Imaging.ImageCodecInfo.GetImageEncoders()

                If loCodec.MimeType = "image/jpeg" Then
                    loImageCodecInfo = loCodec
                    Exit For
                End If

            Next

            oImage.Save(cFilePath, loImageCodecInfo, loEncoderParameters)
            Return True
        End Function
Where oImage is my System.Drawing.Bitmap object.

When doing that, it saves in JPG. If I call the regular System.Drawing.Bitmap Save() method, it saves in PNG. So, the disk space ratio is at least 4 times smaller.
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