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

Outputting in-line image from BLOB in ASP.NET

P: n/a
I have a client solution that requires data and associated files to be
stored with data in a database. As such, I have a situation where JPEG
thumbnails/images that are stored as BLOBs (image data-type) in a SQL DB
need to be written to an ASP.NET page. The BLOB is actually wrapped by a
class written in C#, BlobObj, which can return a byte-array containing the
image-bytes. I can successfully write the image to the page using the
Response.WriteBinary function, writing the byte-array return from my BlobObj
wrapper class. I cannot, though, successfully write the image to a page
with other content; the image seems to overwrite all other content. Any
ideas?
Nov 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
This is correct. You cannot write an image directly to an HTML page. You
can only put links to images in a page.
Normally your img tag would point to a jpg or a gif image file.
In your case you'll want it to point to a special page you've designed
specifically for outputting these images.
For example:
<img src='myimage.aspx' ...>

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Jonathan" <jo**@periglobal.com> wrote in message
news:XM******************@newssvr29.news.prodigy.c om...
I have a client solution that requires data and associated files to be
stored with data in a database. As such, I have a situation where JPEG
thumbnails/images that are stored as BLOBs (image data-type) in a SQL DB
need to be written to an ASP.NET page. The BLOB is actually wrapped by a
class written in C#, BlobObj, which can return a byte-array containing the
image-bytes. I can successfully write the image to the page using the
Response.WriteBinary function, writing the byte-array return from my BlobObj wrapper class. I cannot, though, successfully write the image to a page
with other content; the image seems to overwrite all other content. Any
ideas?

Nov 17 '05 #2

P: n/a
Thanks! Works like a charm.

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:uO**************@tk2msftngp13.phx.gbl...
This is correct. You cannot write an image directly to an HTML page. You
can only put links to images in a page.
Normally your img tag would point to a jpg or a gif image file.
In your case you'll want it to point to a special page you've designed
specifically for outputting these images.
For example:
<img src='myimage.aspx' ...>

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Jonathan" <jo**@periglobal.com> wrote in message
news:XM******************@newssvr29.news.prodigy.c om...
I have a client solution that requires data and associated files to be
stored with data in a database. As such, I have a situation where JPEG
thumbnails/images that are stored as BLOBs (image data-type) in a SQL DB
need to be written to an ASP.NET page. The BLOB is actually wrapped by a class written in C#, BlobObj, which can return a byte-array containing the image-bytes. I can successfully write the image to the page using the
Response.WriteBinary function, writing the byte-array return from my

BlobObj
wrapper class. I cannot, though, successfully write the image to a page
with other content; the image seems to overwrite all other content. Any
ideas?


Nov 17 '05 #3

P: n/a
dan
Has anyone tried implementing something which outputs an array of
images rather than just one???

Cheers,
dan
Jonathan wrote:
Thanks! Works like a charm.

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:uO**************@tk2msftngp13.phx.gbl...
This is correct. You cannot write an image directly to an HTML page. You
can only put links to images in a page.
Normally your img tag would point to a jpg or a gif image file.
In your case you'll want it to point to a special page you've designed specifically for outputting these images.
For example:
<img src='myimage.aspx' ...>

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Jonathan" <jo**@periglobal.com> wrote in message
news:XM******************@newssvr29.news.prodigy.c om...
I have a client solution that requires data and associated files to be stored with data in a database. As such, I have a situation where JPEG thumbnails/images that are stored as BLOBs (image data-type) in a SQL DB need to be written to an ASP.NET page. The BLOB is actually wrapped by
a class written in C#, BlobObj, which can return a byte-array
containing
the image-bytes. I can successfully write the image to the page
using the Response.WriteBinary function, writing the byte-array return from my BlobObj
wrapper class. I cannot, though, successfully write the image to

a page with other content; the image seems to overwrite all other content. Any ideas?



Nov 19 '05 #4

P: n/a
using the drawing classes, you load the images into rectangles a bitmap
using a blit, then convert the bitmap to the format of your choice. you can
also render text descriptions.

-- bruce (sqlwork.com)
"dan" <bb@excelnet.co.uk> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
| Has anyone tried implementing something which outputs an array of
| images rather than just one???
|
| Cheers,
| dan
|
|
| Jonathan wrote:
| > Thanks! Works like a charm.
| >
| > "Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
| > news:uO**************@tk2msftngp13.phx.gbl...
| > > This is correct. You cannot write an image directly to an HTML
| page. You
| > > can only put links to images in a page.
| > > Normally your img tag would point to a jpg or a gif image file.
| > > In your case you'll want it to point to a special page you've
| designed
| > > specifically for outputting these images.
| > > For example:
| > > <img src='myimage.aspx' ...>
| > >
| > > --
| > > I hope this helps,
| > > Steve C. Orr, MCSD, MVP
| > > http://Steve.Orr.net
| > > Hire top-notch developers at http://www.able-consulting.com
| > >
| > >
| > >
| > > "Jonathan" <jo**@periglobal.com> wrote in message
| > > news:XM******************@newssvr29.news.prodigy.c om...
| > > > I have a client solution that requires data and associated files
| to be
| > > > stored with data in a database. As such, I have a situation
| where JPEG
| > > > thumbnails/images that are stored as BLOBs (image data-type) in a
| SQL DB
| > > > need to be written to an ASP.NET page. The BLOB is actually
| wrapped by
| > a
| > > > class written in C#, BlobObj, which can return a byte-array
| containing
| > the
| > > > image-bytes. I can successfully write the image to the page
| using the
| > > > Response.WriteBinary function, writing the byte-array return from
| my
| > > BlobObj
| > > > wrapper class. I cannot, though, successfully write the image to
| a page
| > > > with other content; the image seems to overwrite all other
| content. Any
| > > > ideas?
| > > >
| > > >
| > >
| > >
|
Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.