Load Image from Stream
pinbot
Texas
Is there a way to load an image from a stream?
I can generate a URL that will thumbnail a photo on the fly.
In FR Studio I would do an OnBeforePrint and some WebClient C# to load into the image just before displaying.
IfrxPictureView pict = (IfrxPictureView)Sender;
...
pict.LoadViewFromStream(s);
That way the image was already resized before becoming part of the report.
In Fr.Net I see MyPicture.Image.Save which will take a stream but no corresponding MyPicture.Image.Load
Thanks,
Bryan
I can generate a URL that will thumbnail a photo on the fly.
In FR Studio I would do an OnBeforePrint and some WebClient C# to load into the image just before displaying.
IfrxPictureView pict = (IfrxPictureView)Sender;
...
pict.LoadViewFromStream(s);
That way the image was already resized before becoming part of the report.
In Fr.Net I see MyPicture.Image.Save which will take a stream but no corresponding MyPicture.Image.Load
Thanks,
Bryan
Comments
Here is an example how you can load an image from a file:
using another overloads of Bitmap constructor, you may load from stream.
I just set ImageLocation to be my full URL in the BeforePrint and FR.NET loaded the picture for me!
private void PropertyPicture_BeforePrint(object sender, EventArgs e)
{
String URL;
URL = "http://www.xxx.xxx/aptpicture/?" + ((String)Report.GetColumnValue("PropSheetQuery.ApartmentPictureURL"));
URL += "&h=" + ((int)PropertyPicture.Height).ToString();
URL += "&w=" + ((int)PropertyPicture.Width).ToString();
PropertyPicture.ImageLocation=URL;
}
[img]style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> I do need that for another image though so thanks for the quick reply.[/img]
public static void LoadImageFromFileDemo()
{
string fileName = "c:/Sample.png";
REImage reImage = REFile.OpenImageFile(fileName);
}
most of us are simply using some software to do the job for us. but for programmer, we are searching for the most useful tool that can make things easier.