Display SVG from DB

P

pkamil83

Hello

I've got a table on SQL Server 2005 with columns:

ID int
Text XML
Image varbinary(max)

In this table I'm having SVG images.
All I have to do is to display those images on ASP.NET 2 web site (C#),
but I have no idea how to do that. I would also like to have the XML
text displayed under the Image.

Could You please help me?
 
K

Kevin Spencer

First of all, you will have to convert the image format in order to display
the image in a web page. The most commonly-supported formats are JPEG and
GIF. Second, to display text below the image, you must create a web page
that references the image. A web page does not actually contain any binary
data. It has references to the URL of binary data which is downloaded
separately by the browser and displayed in the web page according to the
markup in the page.

So, you will need to create an ASPX page that converts an SVG image to JPG
or GIF, sets the Response.ContentType to "image/jpg" (etc), and streams the
binary image to the browser. You will also need an ASPX page with an img tag
in it that references the ASPX page that provides the image.

--
HTH,

Kevin Spencer
Microsoft MVP
Bit Player
http://unclechutney.blogspot.com

Where there's a Will, there's a William.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top