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(ByV al sSourcePath As String, ByVal sTargetPath As
String)
Dim fs As FileStream
Dim gImageIn As Image
Dim gImageInFormat As Object
Try
fs = New FileStream(sSou rcePath, FileMode.Open, FileAccess.Read )
gImageIn = Image.FromStrea m(fs)
gImageInFormat = gImageIn.RawFor mat
Dim gImageOut As New System.Drawing. Bitmap(gImageIn , 350, 262)
gImageOut.Save( sTargetPath, gImageInFormat)
Catch
Throw
Finally
fs.Close()
gImageIn.Dispos e()
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(ByV al sSourcePath As String, ByVal sTargetPath As
String)
Dim fs As FileStream
Dim gImageIn As Image
Dim gImageInFormat As Object
Try
fs = New FileStream(sSou rcePath, FileMode.Open, FileAccess.Read )
gImageIn = Image.FromStrea m(fs)
gImageInFormat = gImageIn.RawFor mat
Dim gImageOut As New System.Drawing. Bitmap(gImageIn , 350, 262)
gImageOut.Save( sTargetPath, gImageInFormat)
Catch
Throw
Finally
fs.Close()
gImageIn.Dispos e()
End Try
End Sub
Comment