J
James A Taber
Problem resizing image.(JPG)
If i try to resize an img with horisontal=150 and vertical resolution=150
The quality of the target image is dramatically reduced. Source code is
provided below.
How can i solve this? What am i doing wrong?
Thanx in advance
-James A Taber
Public Sub ResizeImage(ByVal sSourcePath As String, ByVal sTargetPath As
String)
Dim fs As FileStream
Dim gImageIn As Image
Dim gImageInFormat As Object
Try
fs = New FileStream(sSourcePath, FileMode.Open, FileAccess.Read)
gImageIn = Image.FromStream(fs)
gImageInFormat = gImageIn.RawFormat
Dim gImageOut As New System.Drawing.Bitmap(gImageIn, 350, 262)
gImageOut.Save(sTargetPath, gImageInFormat)
Catch
Throw
Finally
fs.Close()
gImageIn.Dispose()
End Try
End Sub
If i try to resize an img with horisontal=150 and vertical resolution=150
The quality of the target image is dramatically reduced. Source code is
provided below.
How can i solve this? What am i doing wrong?
Thanx in advance
-James A Taber
Public Sub ResizeImage(ByVal sSourcePath As String, ByVal sTargetPath As
String)
Dim fs As FileStream
Dim gImageIn As Image
Dim gImageInFormat As Object
Try
fs = New FileStream(sSourcePath, FileMode.Open, FileAccess.Read)
gImageIn = Image.FromStream(fs)
gImageInFormat = gImageIn.RawFormat
Dim gImageOut As New System.Drawing.Bitmap(gImageIn, 350, 262)
gImageOut.Save(sTargetPath, gImageInFormat)
Catch
Throw
Finally
fs.Close()
gImageIn.Dispose()
End Try
End Sub