473,387 Members | 1,621 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,387 software developers and data experts.

Picture

GTi
On my page I have some links to ASP.NET generated pictures.
I use this
document.images.grapreportpic1.src = url2newimage
to display the report picture.

But the "problem" is that it may take some time to generate the
picture.

Is it possible (how) to first display a preloaded image and then switch
it to the new image?

function DisplayGrapPic(url2newimage)
{
document.images.grapreportpic1.src = preloadedImageVar;
document.images.grapreportpic1.src = url2newimage;
}

Jan 19 '06 #1
2 1146
GTi wrote:
On my page I have some links to ASP.NET generated pictures.
I use this
document.images.grapreportpic1.src = url2newimage
to display the report picture.

But the "problem" is that it may take some time to generate the
picture.

Is it possible (how) to first display a preloaded image and then switch
it to the new image?

function DisplayGrapPic(url2newimage)
{
document.images.grapreportpic1.src = preloadedImageVar;
document.images.grapreportpic1.src = url2newimage;
}


try this but I typed it into the reply, wasn't checked for syntax
errors but it should work.

function DisplayGrapPic(url2newimage)
{
document.images.grapreportpic1.src = preloadedImageVar;
reportImg = new Image;
reportImg.src = url2newimage;
document.images.grapreportpic1 = reportImg;
}

you can create the reportImg outside the function and preload it on
onload but I presume you call DisplayGrapPic on the body's onload
event...so it should be fine

Jan 19 '06 #2
GTi
impaler wrote:
GTi wrote:
On my page I have some links to ASP.NET generated pictures.
I use this
document.images.grapreportpic1.src = url2newimage
to display the report picture.

But the "problem" is that it may take some time to generate the
picture.

Is it possible (how) to first display a preloaded image and then switch
it to the new image?

function DisplayGrapPic(url2newimage)
{
document.images.grapreportpic1.src = preloadedImageVar;
document.images.grapreportpic1.src = url2newimage;
}
try this but I typed it into the reply, wasn't checked for syntax
errors but it should work.

function DisplayGrapPic(url2newimage)
{
document.images.grapreportpic1.src = preloadedImageVar;
reportImg = new Image;
reportImg.src = url2newimage;
document.images.grapreportpic1 = reportImg;
}

you can create the reportImg outside the function and preload it on
onload but I presume you call DisplayGrapPic on the body's onload
event...so it should be fine

Well, I don't use it in the body's onload
I have several links on my page that change the report picture on the
same document.
onclick=DisplayGrapPic('http://..../report.aspx?reportype=1')
(kvasir Ajax)

Thanks for the code, I will test it out.

Jan 19 '06 #3

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

Similar topics

4
by: Chris | last post by:
Hi, I am trying to set the position of a picture inside a picturebox with the folowing code: pctOutput.Picture = LoadPicture(App.Path & "\picture.bmp", , , , ) I didn't know what to fill...
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...
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...
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...
1
by: orson4music | last post by:
I have two picture boxes on my form. One on top of the other. The top most picture box's movement is restricted within the picture box below making it look like the top most picture box is contained...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.