Re: displaying images on a website from binary

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



If I understand you correctly, you already know how to send the image to the
client.

It sounds like you want to put them into a page, whether it is an HTML page
or an ASP.Net (HTML) page, on the client.

Forgive me if I tell you anything you already know. An HTML document is
text. It contains no binary data. It can contain multiple image elements
which contain a reference to a URL where the image file is located.

Now, as you've already successfully streamed an image to a browser, I'll
assume you know about setting the Response.ContentType, and so on. The only
thing left to do is to take the page you have created to do this, and adapt
it to serve multiple images. This can most easily be done using a
QueryString. The image tag in the HTML document might look like the
following:

<img src="imagePage.aspx?id=1234">

The image page then reads the Request.QueryString to determine the image to
send. It then sends the image just as you have already done. In other words,
the ASPX page is treated as if it were the image.

You should be able to see how you can have multiple references to the same
ASPX page using different QueryStrings in the same HTML document.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.

"CLEAR-RCIC" <CLEARRCIC@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:48AAC079-3683-47B0-A8D6-8A1F519DB846@xxxxxxxxxxxxxxxx
>I have several images i want to display in an ASP.Net application. The
> images are being passed to me in binary format from another application.
> Is
> there a good way to write them directly to an HMTL page without having to
> save them to the server and create a URL to the virtual directory?
>
> FYI: I currently am doing this with just single images. I do a
> Response.BinaryWrite(byte) to display the one image. The advantage is
> that I
> never have to worry about deleting the images at some later time.
> Unfortunatly, this method does not lend itself to multiple images.


.



Relevant Pages

  • Re: another several questions
    ... Your HTML document could, though. ... on the client side there IS no DataGrid. ... > "edit" button of the datagrid ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Why no "cause" constructors for NumberFormatException
    ... sometimes client is unable to express what they want. ... "truly random" generator is required (and you might get into philosophical ... a client may state that they want an HTML ... an HTML document generated, and for that HTML document to get printed. ...
    (comp.lang.java.programmer)
  • Re: Roll to web page vertical position
    ... You cannot use anchors when posting from the client to the server. ... cursor at a particular point when the HTML document is rendered. ... Tony Marston ...
    (comp.lang.php)