Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass by value 2

Status
Not open for further replies.

jaschulz

Programmer
May 20, 2005
89
FR
How can I pass a copy of an image stored in an array to a scaling function? I have the scaling function, and it works fine, but if I pass the image to it like this:

scaleThis(imageArray[x])

the original image (stored in the array) gets scaled. This is not what I want, I only want to scale a copy of the original but I don't understand how to pass the image by value rather than by reference. Is there a way to do what I need to do?

Thanks,

James
 
The images in my original array were preloaded. If I make a copy as you suggest, wouldn't that force the image to be reloaded (thus losing the advantage of preloading)?

JAS
 
Ultimately, that depends on the user's browser settings... but if the original image is cached then you ask for the same SRC again, the browser will normally fetch the cached version.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
jaschulz, your profile shows that you've awarded a tipmaster vote (purple star) 2 times out of the 30+ questions you've asked. When I view a profile and see that a person has asked that many questions w/o ever giving out any votes, it tells me that the person just isn't familiar with the site's mechanics and I will try to give them an explanation. However, since in your case you've clicked the "thank xxxx for this valuable post" link 2 times in the past, what is the reason for not clicking it the other 30+ times? You'll have better luck getting a quick answer if your profile shows that you award votes for helpful answers. I'll be honest, when I saw your question posted and then looked at your profile, I didn't bother answering. Perhaps you could award Dan a vote for the help he gave you in this thread?

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson

Finally, <. is a good thing!
 
You're entirely right. I had never paid any attention to the "star" system. Too busy, I guess, to pay attention to how the site works. Or so I thought (if I thought at all).

Thanks for waking me up.

JAS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top