PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sun Feb 23, 2020 2:03 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Wed Dec 06, 2006 8:16 pm 
Offline
The Ninja Space Mod
User avatar

Joined: Fri Aug 05, 2005 1:53 pm
Posts: 6424
Location: Paradise, CA
is there a way to assign a filter or something to a png image with javascript? I have a bunch of icons that need to be different colors depending on a value in the database and it would be so easy if I could just change their color with javascript (requiring js is ok on this particular site since it's in-house)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 06, 2006 8:22 pm 
Offline
Site Admin
User avatar

Joined: Tue Dec 23, 2003 3:10 am
Posts: 11470
Location: Toronto
I doubt it, although you could dynanamically generate the icons with different color. Still, whats wrong with just serving different images depending on the value?

Edit | This may be of interest http://www.dynamicdrive.com/forums/showthread.php?t=948


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 07, 2006 11:12 am 
Offline
The Ninja Space Mod
User avatar

Joined: Fri Aug 05, 2005 1:53 pm
Posts: 6424
Location: Paradise, CA
Well, I can serve different images, it would just be easy if they were dynamically colored, but that's ok.. it's just kind of a lot of icons I have to create but that's life.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 07, 2006 11:27 am 
Offline
Site Admin
User avatar

Joined: Tue Dec 23, 2003 3:10 am
Posts: 11470
Location: Toronto


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 07, 2006 12:05 pm 
Offline
The Ninja Space Mod
User avatar

Joined: Fri Aug 05, 2005 1:53 pm
Posts: 6424
Location: Paradise, CA


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 07, 2006 1:11 pm 
Offline
Neighborhood Spidermoddy
User avatar

Joined: Mon Mar 29, 2004 4:24 pm
Posts: 31559
Location: Bothell, Washington, USA
You shouldn't rely on Javascript being able to do it unless you do some serious amount of work, so I'd go with GD if you can't precalculate.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 07, 2006 1:23 pm 
Offline
The Ninja Space Mod
User avatar

Joined: Fri Aug 05, 2005 1:53 pm
Posts: 6424
Location: Paradise, CA
thanks guys... I'll give gd a try. This will be my first time using it... I've been meaning to try it out, but never have.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 07, 2006 1:26 pm 
Offline
Neighborhood Spidermoddy
User avatar

Joined: Mon Mar 29, 2004 4:24 pm
Posts: 31559
Location: Bothell, Washington, USA


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group