I have an image resizing app and I need to keep the deminsions proportionate.
How do I do that with this code?
Private Sub Reduce(ByVal factor As Double)
img = New Bitmap(img, New Size(50, 50))
picPhoto.Image = img
Dim SizeKb As String
' To compute: size in Kb
Dim ms As New MemoryStream()
img.Save(ms, Imaging.ImageFormat.Jpeg)
SizeKb = (ms.Length \ 1024).ToString() & "Kb "
lblCurrentSize.Text = "Current Size: " & SizeKb & "(" & img.Width & "x" & img.Height & ") [" & img.Width / img.Height & "]"
End Sub
It resizes images well but doesn`t kep the width and height proportionate.
How do I do that with this code?
Private Sub Reduce(ByVal factor As Double)
img = New Bitmap(img, New Size(50, 50))
picPhoto.Image = img
Dim SizeKb As String
' To compute: size in Kb
Dim ms As New MemoryStream()
img.Save(ms, Imaging.ImageFormat.Jpeg)
SizeKb = (ms.Length \ 1024).ToString() & "Kb "
lblCurrentSize.Text = "Current Size: " & SizeKb & "(" & img.Width & "x" & img.Height & ") [" & img.Width / img.Height & "]"
End Sub
It resizes images well but doesn`t kep the width and height proportionate.