473,408 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Outputting in-line image from BLOB in ASP.NET

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
4 1807
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Peter Wright | last post by:
How can VBA prevent the advisory popup "Outputting to ..." when using Access 2002: DoCmd.OutputTo acOutputReport, stDocName, acFormatRTF ? Set Warnings is ignored. TIA Peter Wright
2
by: Andy | last post by:
Hi I'm really stuck outputting a double number to the console with three decimal places if the furthest right value is a zero. I can coutput the number 4.546 as 4.546 but then if I output...
4
by: superja | last post by:
I have some problem outputting double variable types. Below is my script: #include <stdio.h> #include <math.h> double x; double h;
1
Markus
by: Markus | last post by:
Little problem here. How would i go about outputting "&raquo;" through giving something a value. i.e. if(validateEmail(emailValue) === false){ emailStyle.color = "red"; emailText.value...
12
by: billelev | last post by:
This is probably a very easy question to answer: I have been outputting some text to a message box, similar to the following: strOutput = "---" & Chr(10) & Chr(10) strOutput = strOutput &...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.