I was using the following code to enter an image url at TextBox1
and display it in PictureBox1
.Everything worked.
But suddenly the displayed image quality is lower than the original link. I've tried PictureBox1.Load(TextBox1.Text)
and changing SizeMode
still the same result.
Imports System.Net
Public Class Form1
Dim client As WebClient
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
client = New WebClient()
Dim ImageInBytes() As Byte = client.DownloadData(TextBox1.Text)
Dim ImageStream As New IO.MemoryStream(ImageInBytes)
PictureBox1.Image = New System.Drawing.Bitmap(ImageStream)
End Sub
End Class
I'm usingMicrosoft Visual Studio 2010 Version 10.0.30319.1 RTMRel Microsoft .NET Framework Version 4.0.30319 RTMRel
How can I get the image to display without the quality loss?