473,326 Members | 2,813 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,326 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 1486
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 specialty template editor, similar to say a corel...
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 width property of the image itself. I would...
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 make some changes to a picture, but I want 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, Toronto, and Research Triangle Park Learn more:...
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 http://support.microsoft.com/?id=158941: strPathname =...
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 bright red warning image on items which have run...
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 "save picture as" event so that I can create another...
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 a default path\file set on the .Picture property,...
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 website I want users who register to be able to upload a...
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 i want to load a picture to a image( my form...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.