Is it possible to load an image (jpg i.e.) directly from an URL?
Hello,
It's not something the ImageBox will do naively, but it is easy enough to add yourself. I've updated the demonstration program on GitHub (https://github.com/cyotek/Cyotek.Windows.Forms.ImageBox) to show how to do this, appropriate code below.
try
{
using (WebClient client = new WebClient())
{
byte[] data;
data = client.DownloadData(url);
using (Stream stream = new MemoryStream(data))
{
this.OpenImage(Image.FromStream(stream));
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
Regards;
Richard Moss
Thanks.
Again, you help me. Working fine.