Kvalitet på billede ved opload ?
Hejsa,Som overskriften siger skal jeg bruge en måde hvorpå jeg kan sætte kvaliten på et billede når jeg oploader og resizer det ?
Er der en der kan hjælpe med det ?
Min kode ser pt. sådan ud :
Dim bmpFile As New Bitmap(strFileStream)
Dim cintWidth, cintHeight As Short
If bmpFile.Width > bmpFile.Height Then
intWidth = intWidth
intHeight = bmpFile.Height / (bmpFile.Width / intWidth)
Else
intHeight = intHeight
intWidth = bmpFile.Width / (bmpFile.Height / intHeight)
End If
Dim bmpNewBitmap As New Bitmap(intWidth, intHeight)
Dim bmpGraphics As Graphics = Graphics.FromImage(bmpNewBitmap)
bmpGraphics.InterpolationMode = InterpolationMode.High
Dim compressionRectangle As New Rectangle(0, 0, intWidth, intHeight)
bmpGraphics.DrawImage(bmpFile, compressionRectangle)
bmpFile.Dispose()
/Websam
FileToSave = FilePath & Mid(strFile.FileName, InStrRev(strFile.FileName, "\") + 1)
bmpNewBitmap.Save(Current.Server.MapPath(FileToSave), strFileFormat)
bmpNewBitmap.Dispose()
