LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-14-2005, 01:23 PM   #1
TylerD75
Member
 
Registered: Aug 2004
Location: Norway
Distribution: Gentoo
Posts: 96

Rep: Reputation: 18
GD image streams and PHP


I've made a php page that generate it's menu by putting text on a .png image. This works like a dream, but I've got a problem using the Image Rollover thingy.
Is it at all possible to do this, or do I have to generate files from the streams?

The way I've done it now, I've got a createImage.php script that has to $_GET variables: the text and a boolean that is true if it's the "normal" image, and false if it's the rollover image.
The "normal" image is just fine, but the rollover image never is displayed...
I understand that the img is generated once, displayed and then "forgot"... So is there a way to preload the rollover img?

Should probably say that I'm kind of new to this... Only been using PHP for a couple of weeks now.

Any help would be greatly appreciated!

TylerD
 
Old 11-14-2005, 03:54 PM   #2
TylerD75
Member
 
Registered: Aug 2004
Location: Norway
Distribution: Gentoo
Posts: 96

Original Poster
Rep: Reputation: 18
ehh... Just remebered that PHP is server-side.
I'm now trying to do this with a javascript.
But it seem like I have to call a reload of the createImage.php script when the mouse rolls over a button?
Can I do this? Can the "mouse over button" event call the createImg script? Do I have to use RPC to implement this?
Any suggestions?
 
Old 11-14-2005, 04:04 PM   #3
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
It's been awhile since I've done any JavaScript, but if I remember correctly, you can cache your images with something like:

Code:
<script language="javascript">
<!--
// Cache image
imgNormal = new image();
imgNormal.src = "url to image";

imgMouseOver = new image();
imgMouseOver.src = "url to image";

// -->
</sript>
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Image sizes in PHP Napalm Llama Programming 7 07-15-2005 10:01 AM
php and gd (image functions) devfreak Linux - Software 1 05-11-2005 05:17 PM
Php image optimize script htmlcoder Programming 0 03-19-2005 03:23 AM
PHP 4.3 Upgrade for Image Libraries SForsgren Linux - Software 1 05-21-2003 07:00 AM
The best image manipuliation way in to PHP dr. Agon Programming 0 01-28-2001 07:04 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration