I am developing a little noddy windows form, and have an image place holder on the form.
it's really quite simple, where user enters a part number whihc is then displayed in a datagrid. When user click on a row, an image is then displayed in the placeholder of that part.
there are around 12,000 images all of different sizes, and I cannot really be bother to go through the laboruous task of resizing every image.
So what i want to do is to resize the image when they are read from the webserver:
this does not work, as it say the Height and width are read only... and I can't seem to fin how you can set the image dimension when they are output.
thanks in advance.
it's really quite simple, where user enters a part number whihc is then displayed in a datagrid. When user click on a row, an image is then displayed in the placeholder of that part.
there are around 12,000 images all of different sizes, and I cannot really be bother to go through the laboruous task of resizing every image.
So what i want to do is to resize the image when they are read from the webserver:
Code:
HttpWebRequest wReq = HttpWebRequest)WebRequest.Create(sURL);
HttpWebResponse wRes = (HttpWebResponse)(wReq).GetResponse();
str = wRes.GetResponseStream();
Image outputimg = Image.FromStream(str);
outputimg.Height = 213;
outputimg.Width = 284;
return outputimg;
this does not work, as it say the Height and width are read only... and I can't seem to fin how you can set the image dimension when they are output.
thanks in advance.