472,353 Members | 1,328 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Picture management


Hi,

Has anoyone ever tried to create an asp page that displays images that
either displays them as a slideshow or on a long webpage?

I have an html page that displays my pictures, but as there are many of
them which are large and my bandwidth is restricted I want to download
them and display them one at a time. Currently it the client tries to
download them all at the same time, or four at a time. This slows down
the downloads to an unbearable rate.

Is there a component that allows you detect when an image has been
downloaded and then allow a trigger to start downloading the next one?

Any Ideas?

Thanks
Dave

Nov 6 '06 #1
9 1459
altreed wrote on 06 nov 2006 in microsoft.public.inetserver.asp.general:
Has anoyone ever tried to create an asp page that displays images that
either displays them as a slideshow or on a long webpage?

I have an html page that displays my pictures, but as there are many of
them which are large and my bandwidth is restricted I want to download
them and display them one at a time. Currently it the client tries to
download them all at the same time, or four at a time. This slows down
the downloads to an unbearable rate.

Is there a component that allows you detect when an image has been
downloaded and then allow a trigger to start downloading the next one?
You will have to do this clientside, a server is only serving and is not
trigger happy.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 6 '06 #2

"altreed" <ca*************@hotmail.comwrote in message
news:11**********************@f16g2000cwb.googlegr oups.com...
>
Hi,

Has anoyone ever tried to create an asp page that displays images that
either displays them as a slideshow or on a long webpage?

I have an html page that displays my pictures, but as there are many of
them which are large and my bandwidth is restricted I want to download
them and display them one at a time. Currently it the client tries to
download them all at the same time, or four at a time. This slows down
the downloads to an unbearable rate.

Is there a component that allows you detect when an image has been
downloaded and then allow a trigger to start downloading the next one?

Any Ideas?
Do it clientside in Javascript (warning air code):-

<script type="text/javascript">

function imgDone()
{
var img = this.nextSibling
var src = img ? img.getAttribute("altsrc") : null
if (src)
{
img.onload = imgDone
img.src = img.altsrc
}
}
</script>
<img src="/folder/image1.jpg" onload="imgDone.call(this)" />
<img altsrc="/folder/image2.jpg" src="spacer.gif" />
..
..
..
<img altsrc="/folder/imageN.jpg" src="spacer.gif" />

Now the load of each img invokes the loading of the next until they are all
done. Hence only one image will be downloading at a time.

Nov 6 '06 #3
Evertjan. wrote:
You will have to do this clientside, a server is only serving
and is not trigger happy.
A server can certainly be configured to simultaneously service a limited
number of requests per session. Sadly, IIS seems to lack this feature, even
in the metabase.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Nov 6 '06 #4

"Dave Anderson" <NY**********@spammotel.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Evertjan. wrote:
You will have to do this clientside, a server is only serving
and is not trigger happy.

A server can certainly be configured to simultaneously service a limited
number of requests per session. Sadly, IIS seems to lack this feature,
even
in the metabase.
Assuming it could what would it use to distinguish one session from another?
>
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message.
Use
of this email address implies consent to these terms.


Nov 7 '06 #5
Thanks for the advice, I understand the approach.

I tried the code below, not really understanding it (never looked at
java). I find that it doesn't work.

I am being very cheeky, but could you break it down. I am getting
placeholders with an x in it.

Thanks
Dave

Anthony Jones wrote:
>
Do it clientside in Javascript (warning air code):-

<script type="text/javascript">

function imgDone()
{
var img = this.nextSibling
var src = img ? img.getAttribute("altsrc") : null
if (src)
{
img.onload = imgDone
img.src = img.altsrc
}
}
</script>
<img src="/folder/image1.jpg" onload="imgDone.call(this)" />
<img altsrc="/folder/image2.jpg" src="spacer.gif" />
.
.
.
<img altsrc="/folder/imageN.jpg" src="spacer.gif" />

Now the load of each img invokes the loading of the next until they are all
done. Hence only one image will be downloading at a time.
Nov 7 '06 #6

"altreed" <ca*************@hotmail.comwrote in message
news:11**********************@h54g2000cwb.googlegr oups.com...
Thanks for the advice, I understand the approach.

I tried the code below, not really understanding it (never looked at
java). I find that it doesn't work.

I am being very cheeky, but could you break it down. I am getting
placeholders with an x in it.
Spacer.gif is a common name for a gif containing a single transparent pixel.
You should be able to download one from somewhere if you haven't got one
already.

There is a bug in the code I posted the top of the imgDone function should
look like this:-

var img = this.nextSibling
if (img.nodeType == 3) img = img.nextSibling // this line was missing
var src = img ? img.getAttribute("altsrc") : null
>
Thanks
Dave

Anthony Jones wrote:

Do it clientside in Javascript (warning air code):-

<script type="text/javascript">
// When image has finished loading it calls this function
function imgDone()
{

// Retrieve an the next image node in the document after the one that just
loaded
var img = this.nextSibling
// skip any interveaning #text node
if (img.nodeType == 3) img = img.nextSibling // this line was missing

// The true src url for the image was stored as an extra attribute on the
img tag.
// If the calling img is the last one then the img variable will now be
null

var src = img ? img.getAttribute("altsrc") : null

if (src)
{
//make this function the target of the img onload event
img.onload = imgDone
// setting the src property will cause the next image to download
img.src = img.altsrc
// when the img has finished this function is called again until all
images are loaded
}
}
</script>
<!-- The first img has it's src set correctly and onload event to call the
imgDone function -->
<img src="/folder/image1.jpg" onload="imgDone.call(this)" />
<!-- all subsequent imgs will specify spacer.gif as the original src and the
real url on a altrc attribute -->
<img altsrc="/folder/image2.jpg" src="spacer.gif" />
..
..
..
<img altsrc="/folder/imageN.jpg" src="spacer.gif" />

Now the load of each img invokes the loading of the next until they are
all
done. Hence only one image will be downloading at a time.

Nov 7 '06 #7
Thanks Anthony,

I created a simple page using only images and this script works fine.
However, I need to include text on the page also. I find that if I add
a <br'Break' in the text the images wont load after the first image.

Is there a way to overcome this issue? I really need to include text
with the images. I dont know any other way to achieve <brcan
Javascript provide a solution?

Thanks again.
Dave
Anthony Jones wrote:
"altreed" <ca*************@hotmail.comwrote in message
news:11**********************@h54g2000cwb.googlegr oups.com...
Thanks for the advice, I understand the approach.

I tried the code below, not really understanding it (never looked at
java). I find that it doesn't work.

I am being very cheeky, but could you break it down. I am getting
placeholders with an x in it.

Spacer.gif is a common name for a gif containing a single transparent pixel.
You should be able to download one from somewhere if you haven't got one
already.

There is a bug in the code I posted the top of the imgDone function should
look like this:-

var img = this.nextSibling
if (img.nodeType == 3) img = img.nextSibling // this line was missing
var src = img ? img.getAttribute("altsrc") : null

Thanks
Dave

Anthony Jones wrote:
>
Do it clientside in Javascript (warning air code):-
>
<script type="text/javascript">
>

// When image has finished loading it calls this function
function imgDone()
{

// Retrieve an the next image node in the document after the one that just
loaded
var img = this.nextSibling
// skip any interveaning #text node
if (img.nodeType == 3) img = img.nextSibling // this line was missing

// The true src url for the image was stored as an extra attribute on the
img tag.
// If the calling img is the last one then the img variable will now be
null

var src = img ? img.getAttribute("altsrc") : null

if (src)
{
//make this function the target of the img onload event
img.onload = imgDone
// setting the src property will cause the next image to download
img.src = img.altsrc
// when the img has finished this function is called again until all
images are loaded
}
}
</script>
<!-- The first img has it's src set correctly and onload event to call the
imgDone function -->
<img src="/folder/image1.jpg" onload="imgDone.call(this)" />
<!-- all subsequent imgs will specify spacer.gif as the original src and the
real url on a altrc attribute -->
<img altsrc="/folder/image2.jpg" src="spacer.gif" />
.
.
.
<img altsrc="/folder/imageN.jpg" src="spacer.gif" />
>
Now the load of each img invokes the loading of the next until they are
all
done. Hence only one image will be downloading at a time.
Nov 9 '06 #8

"altreed" <ca*************@hotmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
Thanks Anthony,

I created a simple page using only images and this script works fine.
However, I need to include text on the page also. I find that if I add
a <br'Break' in the text the images wont load after the first image.

Is there a way to overcome this issue? I really need to include text
with the images. I dont know any other way to achieve <brcan
Javascript provide a solution?

Thanks again.
Dave

Try this adjustment:-

<script type="text/javascript">

function imgDone()
{
var img = this.nextSibling
while (img && (img.tagName != 'IMG' || img.getAttribute("altsrc") ==
null))
img = img.nextSibling

if (img)
{
img.onload = imgDone
img.src = img.getAttribute("altsrc")
}
}
</script>

It will hunt through the document from the first img to the end of the
document ignoring any nodes in between img tags.
Nov 10 '06 #9
Thanks Anthony, you are a top geezer. That code works a treat.

If anyone wants to load images on a webpage sequentially this is
definately the code for you.

Many thanks
Dave

Anthony Jones wrote:
>
Try this adjustment:-

<script type="text/javascript">

function imgDone()
{
var img = this.nextSibling
while (img && (img.tagName != 'IMG' || img.getAttribute("altsrc") ==
null))
img = img.nextSibling

if (img)
{
img.onload = imgDone
img.src = img.getAttribute("altsrc")
}
}
</script>

It will hunt through the document from the first img to the end of the
document ignoring any nodes in between img tags.
Nov 14 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Chris Coho, Jr. | last post by:
Ok, I'll explain the whole problem because there may be several ways to solve this and hopefully someone knows one. What I'm doing is creating a...
2
by: Sandra Setz | last post by:
Hi, I was wondering if someone could explain to me what the difference is between the width propery of the picture property of an image and the...
3
by: Sandra Setz | last post by:
Hi, Is it possible to assign the Picture property of a picturebox to the Picture property of an image control? I use an invisble picturebox to...
0
by: Scott Abel | last post by:
For immediate release: The Rockley Group Content Management Workshop Series Coming to Atlanta, Seattle, Vancouver, Chicago, Washington, DC,...
2
by: Lyn | last post by:
I am trying to embed a picture into a Bound Object Frame (Me!Photograph) with the following code which is based on MS article...
6
by: John Ortt | last post by:
Hi there everyone, I have a part info form which has a faded image of our company logo as a background. I want to replace the faded image with a...
3
by: Skevmeister | last post by:
Hi Guys, Ok, so I have now figured out how to create and watermark and resize and resample images for my website, but now I want to trap the...
4
by: NASAdude | last post by:
I'm working on distributing a database using VS Tools for Office, and am having trouble with linked images on forms/reports. The image objects have...
6
by: Jeff | last post by:
Hey (and thank you for reading my post) In visual web developer 2005 express edition I've created a simple website project.. At this...
3
by: raghunadhs | last post by:
hi all! i have a picture box, in that picture box, there is a picture asume it as "pic1.bmp".. now i have made some changes in that picture. Now...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...

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.