Welcome to WebmasterWorld Guest from 54.161.228.30

Forum Moderators: not2easy

Message Too Old, No Replies

interactively change gif

   

Xoc

6:56 am on Apr 18, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a gif file that is the floorplan of my house. On the server-side, I need a way to modify the gif file so that it shows the current state of the lights. I want a green dot if the light is on, and a red dot if the light off. With maybe a dozen lights on a floor, I can't (don't want to) create every possible combination of gif files to show those states. 2^12 gif files doesn't sound that fun to create. So how can I create a gif file from the floorplan plus the appropriately colored dots on the fly on an IIS server when the page is constructed?

People must do this to construct graphs on the fly, so I should be able to do the same.

11:17 am on Apr 18, 2002 (gmt 0)

10+ Year Member



Hi
If you put the floor plan as a background image, then put the state of each possible light overlaid on that in appropriate table cells with the content of the cell being a green or red dot GIF, according to your data input. The dot GIFs are cell sized or else positioned in the cell and with transparent backgrounds. You can make the floor plan a table background, or slide it under the table with a Z positioned layer.

Xoc

3:09 pm on Apr 18, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can't do layering. I'm on a PDA with the equivalent of IE 2.0. Nice idea, though. More ideas?
5:32 pm on Apr 18, 2002 (gmt 0)

WebmasterWorld Senior Member mivox is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Mmm... With the equivalent of a 2.0 browser? Sounds like it's time to slice some graphics. Create a generic on & off gif to use for all lights, and fit the floorplan slices and light gifs into a table...

Don't know how you'd work the dynamic changing of light gifs from off to on, but a sliced/table graphic layout would allow for it.

6:18 pm on Apr 18, 2002 (gmt 0)

WebmasterWorld Senior Member nffc is a WebmasterWorld Top Contributor of All Time 10+ Year Member



We do something sort of similar with a product we sell, the options have and on and an off state. They are switched according to user input but could just as easily be read from a dB.

See your sticky.

1:09 pm on Apr 19, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Mivox's sliced image sounds ideal. You'd process the image source names on the server to reflect your lights state (lounge_on.gif/lounge_off.gif or something like that). This way you'd only have to draw two gifs for each light instead of one for every possible permutation.
5:01 pm on Apr 19, 2002 (gmt 0)

WebmasterWorld Senior Member mivox is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Actually, I was thinking even simpler than that, joshie. Just light_on.gif and light_off.gif... Then the floorplan image could be sliced in such a way as to accomodate a little 1px on/off gif at each light fixture location.
5:08 pm on Apr 19, 2002 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



that sounds like the way to go I've done a lot of stuff like that. It isn't always a lot of fun to cut up the image but once it is done it works seamlessly.