Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Resized image is not in a recognized format
Message
De
24/02/2009 04:18:06
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Resized image is not in a recognized format
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:
01383685
Vues:
89
I have this code to resize an image:
        Public Function ImageResize() As Boolean
            Dim loGraphics As System.Drawing.Graphics
            Dim loImage As System.Drawing.Bitmap

            loImage = New System.Drawing.Bitmap(nWidth, nHeight, oImage.PixelFormat)

            ' Make sure we can resize
            If loImage.PixelFormat = Drawing.Imaging.PixelFormat.Format1bppIndexed Or _
                loImage.PixelFormat = Drawing.Imaging.PixelFormat.Format4bppIndexed Or _
                loImage.PixelFormat = Drawing.Imaging.PixelFormat.Format8bppIndexed Or _
                loImage.PixelFormat = Drawing.Imaging.PixelFormat.Undefined Or _
                loImage.PixelFormat = Drawing.Imaging.PixelFormat.DontCare Or _
                loImage.PixelFormat = Drawing.Imaging.PixelFormat.Format16bppArgb1555 Or _
                loImage.PixelFormat = Drawing.Imaging.PixelFormat.Format16bppGrayScale Then
                cError = cPixelFormatNotSupported
                nError = 1
                Return False
            End If

            loGraphics = System.Drawing.Graphics.FromImage(loImage)

            loGraphics.SmoothingMode = Drawing.Drawing2D.SmoothingMode.HighQuality
            loGraphics.InterpolationMode = Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
            loGraphics.DrawImage(oImage, 0, 0, loImage.Width, loImage.Height)
            loGraphics.Dispose()

            oImage = loImage
            Return True
        End Function

    End Class
However, when this is done, the JPG format of the file is not a recognized format to be viewed in LViewPro. Is there any way to have this code to create a standard JPG file?
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform