I upload an image to a fileStream. Then I put it on a Image object. If I want to show this image to the page, which way should I follow ?
System.Drawing.Image image = System.Drawing.Image.FromStream(file.InputStream))
**IMMEDIATE WINDOW**
image
{System.Drawing.Bitmap}
[System.Drawing.Bitmap]: {System.Drawing.Bitmap}
base {System.MarshalByRefObject}: {System.Drawing.Bitmap}
Flags: 0x00013012
FrameDimensionsList: {System.Guid[0x00000001]}
Height: 0x0000012f
HorizontalResolution: 95.9865952
Palette: {System.Drawing.Imaging.ColorPalette}
PhysicalDimension: {Width = 988.0 Height = 303.0}
PixelFormat: Format32bppArgb
PropertyIdList: {int[0x00000005]}
PropertyItems: {System.Drawing.Imaging.PropertyItem[0x00000005]}
RawFormat: {[ImageFormat: b96b3caf-0728-11d3-9d7b-0000f81ef32e]}
Size: {Width = 0x000003dc Height = 0x0000012f}
Tag: null
VerticalResolution: 95.9865952
Width: 0x000003dc
Thanks in advance,
If you want to display image on a website, I would use a Generic Handler (.ashx) to read file stream and output directly to Response object. Adding cache headers would also prevent from reading file stream on every request.
Kris
Use a picturebox container on winforms or similar component for webforms to display it. You also can add browser component to display image.
User contributions licensed under CC BY-SA 3.0