Re: binary image

Discussion in 'ASP .Net' started by Kevin Spencer, Sep 22, 2004.

  1. Remember, Mike, that we are talking about an HTML document on the client. An
    HTML document is pure text. PURE TEXT! It cannot contain any binary data.
    You can't "embed" an image in an HTML document.

    So, how DOES an image get "into" an HTML document? By means of an image tag
    or JavaScript which creates an image object. In both cases, the image is
    loaded from a file. A different file than the HTML document, or the ASP.Net
    page that created the HTML document. So, how do you get your image into such
    a file? One of 2 ways:

    1. Save the image to a file location on the web server, and create an image
    tag that points to that location.
    2. Write an ASPX page that serves images, using Bitmap.Save(stream). In this
    case, you would save it to the Response.OutputStream. Create an image tag
    that points to that ASPX page in your other page.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    I get paid good money to
    solve puzzles for a living

    "Mike" <> wrote in message
    news:...
    > I'm getting an image from the database in binary format using
    > response.binaryWrite("image"). I'm trying to use this as a user control to
    > be used on several pages. The problem i'm having is when i include this
    > control on a page it writes the entire image on the page and overlays
    > everything else on the page, Datagrid, labels, etc. How can I put this

    image
    > in an img tag or datalist or something so i can specify where it should
    > reside on the web page?
    >
    > thx
     
    Kevin Spencer, Sep 22, 2004
    #1
    1. Advertising

  2. Kevin Spencer

    bruce barker Guest

    this is not strictly true. w3c complaint browsers can include an inline
    image, just IE can not.

    -- bruce (sqlwork.com)



    "Kevin Spencer" <> wrote in message
    news:%...
    > Remember, Mike, that we are talking about an HTML document on the client.

    An
    > HTML document is pure text. PURE TEXT! It cannot contain any binary data.
    > You can't "embed" an image in an HTML document.
    >
    > So, how DOES an image get "into" an HTML document? By means of an image

    tag
    > or JavaScript which creates an image object. In both cases, the image is
    > loaded from a file. A different file than the HTML document, or the

    ASP.Net
    > page that created the HTML document. So, how do you get your image into

    such
    > a file? One of 2 ways:
    >
    > 1. Save the image to a file location on the web server, and create an

    image
    > tag that points to that location.
    > 2. Write an ASPX page that serves images, using Bitmap.Save(stream). In

    this
    > case, you would save it to the Response.OutputStream. Create an image tag
    > that points to that ASPX page in your other page.
    >
    > --
    > HTH,
    > Kevin Spencer
    > .Net Developer
    > Microsoft MVP
    > I get paid good money to
    > solve puzzles for a living
    >
    > "Mike" <> wrote in message
    > news:...
    > > I'm getting an image from the database in binary format using
    > > response.binaryWrite("image"). I'm trying to use this as a user control

    to
    > > be used on several pages. The problem i'm having is when i include this
    > > control on a page it writes the entire image on the page and overlays
    > > everything else on the page, Datagrid, labels, etc. How can I put this

    > image
    > > in an img tag or datalist or something so i can specify where it should
    > > reside on the web page?
    > >
    > > thx

    >
    >
     
    bruce barker, Sep 23, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fangs
    Replies:
    3
    Views:
    9,852
    darshana
    Oct 26, 2008
  2. Denise Smith
    Replies:
    2
    Views:
    659
    Denise Smith
    Nov 22, 2003
  3. Marc Schellens
    Replies:
    8
    Views:
    3,040
    John Harrison
    Jul 15, 2003
  4. Laszlo Zsolt Nagy
    Replies:
    1
    Views:
    1,395
    Kartic
    Jan 26, 2005
  5. Jack
    Replies:
    2
    Views:
    221
    John W. Krahn
    Jan 25, 2008
Loading...

Share This Page