By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,749 Members | 1,615 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,749 IT Pros & Developers. It's quick & easy.

Displaying Image after reading Streamed Data

P: n/a
Hi,

I am using an Access database (OLE Object) and storing Image as a bytes
after streaming. I am able to read it back as a stream and display it on the
browser using the following code:
Response.OutputStream.Write(fileData, 0, fileData.Length)

it displays on the browser as an image, but I want to display it in an Image
(web control image) so that I can manipulate its size.
How can I do this?

Please advice,
Stephen.
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
My guess is that you are passing the imageID as a querystring parameter thats
how you would know what image to pull from your database. So, if this is the
case you can do this
<asp:image runat="server" id="myimage" ImageUrl="[filename].aspx?id=1" />

where filename = the aspx page that you are streaming the image file to
using the Response.output.stream. This worked for me. To play around with
the sizing you have to look at the image Thumbnail class from the
system.drawing.imaging (I think this is the namespace) and modify the image
width and height like that. What I did was to also include the width and
height as a querystring parameter so my sorce code looked something like this:
<asp:image runat="server" id="myimage"
ImageUrl="[filename].aspx?id=1&width=200&height=200" />

I suggest you create a single aspx page that handles all of the image
processing and resizing and streaming out to the browser. This single page
will be the [filename].aspx that you are setting the ImageUrl to point to.

Hope this helps.
"Stephen" wrote:
Hi,

I am using an Access database (OLE Object) and storing Image as a bytes
after streaming. I am able to read it back as a stream and display it on the
browser using the following code:
Response.OutputStream.Write(fileData, 0, fileData.Length)

it displays on the browser as an image, but I want to display it in an Image
(web control image) so that I can manipulate its size.
How can I do this?

Please advice,
Stephen.

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.