Do your little circles have to be re-generated each time the script is called? Ie. If the circles are always the same size(s) and chosen from a limited set of colours, and it's only which colour/size get displayed in which position each time, then you are probably better off generating 1 small gif/png of each possible color/size combination and placing these somewhere accessable to your cgi script as a one time thing.
Then, your cgi script need only calculate which of the pre-existing images needs to be displayed in each position and generate the html with the appropriate IMG tag in each position. Saves (re-) generating the images each time. You could do this with image tags inside a table--quick and simple but not hip. Or you could use css to position the images.
Perhaps the smartest way would be to use css to define classes for each color/size combination using the background-image property, and then generate a table with the appropriate class applied to each cell.
Theoretically you could have a standard table with a different class tag applied to each cell (eg. <td class="cell0-0"></td><td class="cell1-0"></td>...) and then you generate the style sheet to map the class definition (eg. cell0-0 { background-image: url( 'images/bluecircle.png'); } etc. as required by your calculations.
If however, there is no reasonable finite set of colour/size combinations, then your probably better of generating one large image, writing it to disc with a unique name and then generating the html to reference the image you generated. Doing it this way you will need to have some mechanism for cleaning up the (possibly large in size and number) of the images you generate.
A clearer description of your application and your code so far will usually get you better responses.
In reply to Re: cgi graphics
by BrowserUk
in thread cgi graphics
by Evanovich
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |