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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

image issues

Status
Not open for further replies.

crystalized

Programmer
Jul 10, 2000
390
CA
I am just starting to examine DHTML and am curious about how I can use images.

I am unsure as to whether I should store my images in my SQL Server database or to store them in the file system with just a reference in the database.

I realize that the database access would have to be handled server side, but then how would I utilize say a series of images retrieved using DHTML. I have seen an example of a DHTML menu style item that has a list of links that when clicked change the text in an "explanation" area. This is the type of effect I would like to acheive using images.

So the links to the side, when clicked would cause the image to slide into place in the "display" area.

Am I completely off my rocker or is this type of thing possible. Also I think I read something about pre-caching images (not sure of the terminology) so that the page does not have to wait for an whole list of images to download. Especially since I only want to display one at a time.

Well any info anyone can offer me would be greatly appreciated. [sig]<p>Crystal<br><a href=mailto:crystals@genesis.sk.ca>crystals@genesis.sk.ca</a><br><a href= > </a><br>--------------------------------------------------<br>
Experience is one thing you can't get for nothing.<br>
-Oscar Wilde<br>
[/sig]
 
Hi Crystal,

No, what you're referring to is totally reasonable.

Preloading the images, basically causes the browser to cache the images on the visitor's computer so that when the images are called in your script, the browser doesn't make an additional request of the server for the image. All of the images have to be downloaded when the page loads initially of course.

example of preloading images in javascript:

var image1=new Image();
var image2=new Image();
image1.src=&quot;images/image1.gif&quot;;
image2.src=&quot;images/image2.gif&quot;;

Then when you do something like this when your onClick event occurs:

document.images['image_name'].src=image1.src;

The preloaded images have to exist in a directory somewhere on the server to be referenced by the HTML page.

Does this answer your question?

Regards, [sig]<p>Russ<br><a href=mailto:bobbitts@hotmail.com>bobbitts@hotmail.com</a><br><a href= is in</a><br>[/sig]
 
I had the same problem, the solution occurred to me after reading another post from someone who got it to work with BMPs but could not with JPGs or GIFs.

Since I was storing image data only from JPG files (which are smaller), I tried storing binary data from BMPs instead and it worked. For confirmation, I tried storing some BMPs and some JPGs and Crystal Reports only displayed the BMPs.

I have only tested this using an ODBC connection to SQL Server 7 (it should work with other ODBC sources)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top