Image from a WebService

N

Nicolas

Hello!

I have a question: I have a database in MySql that has two fields (code and
image). Now, I want to create a WebService that takes the image of the most
current row (the code is the date in which the image took). And then, create
a page in ASP.NET that calls this WebService, show the image and repeat this
behavior every 5 seconds (it is the time that is take a new image be
creating in the base of information). Can someone help or at least orientate
me in this?

Thank you very much and sorry about my poor english :)
 
G

Guest

Nicolas,
ASP.NET WebServices transmit images as type byte[] (a byte array) and they
are typically sent over the wire as Base64 Encoded string of data.

Your consumer application should be able to take this byte[] stream result
of it's WebMethod call and, using one of the Image Class overloads, load it
into an Image object for display.

Peter
 
L

Laurent Bugnion

Hi,
Nicolas,
ASP.NET WebServices transmit images as type byte[] (a byte array) and they
are typically sent over the wire as Base64 Encoded string of data.

Your consumer application should be able to take this byte[] stream result
of it's WebMethod call and, using one of the Image Class overloads, load it
into an Image object for display.

Peter

For a web application, an elegant alternative could be to use the
ability that the Image objects have to reload themselves without the
whole page having to be refreshed.

For example:

var nImg = document.getElementById( "myImage" );
if ( nImg
&& nImg.src )
{
nImg.src = "image.gif";
}

and to set a timer to call this code every 5 seconds.

HTH,
Laurent
 

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,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top