 |
Caro-COOPS Bulletin Board
|
| View previous topic :: View next topic |
| Author |
Message |
jcothran
Joined: 24 Feb 2003 Posts: 189 Location: Columbia, SC
|
Posted: Thu Apr 08, 2004 4:43 pm Post subject: creating graphics |
|
|
From the README.txt file in the attached graphic.tar file:
This is sample code showing how to create some nice graphical dials and gauges as displayed on the carocoops website
Home page
http://www.carocoops.org/
mouse over the 'FRP2' or FRP3' to see the smaller dials and gauges displayed in the left hand sidebar
Details page
http://www.carocoops.org/carocoops_website/buoy_detail.php?buoy=buoy3
can also be accessed by clicking on FRP2 or FRP3 from the home page map
using
perl (version 5.8.0)
graphical templates (thanks to Susanna King for creating these)
gmt (version 3.4.3) (thanks to Tom Cook for the initial gmt scripts and help
with gmt) http://gmt.soest.hawaii.edu/
imagemagick (version 5.5.7) http://www.imagemagick.org/
The graphical templates are included in the 'graphics' directory. There are many more graphical templates that have been created than are shown below or demonstrated in the code.
The gmt scripts used are in the 'gmt' directory.
The various .gif, .jpg, .png files are samples of the output that will be
succcssfully generated when running
perl createGraphics.pl
The things which will need to be configured to your environment are the directory settings in createGraphics.pl. $working_dir, $graphics_dir and $gmt_dir can be left as their default, but the $imagemagick_dir should reference the location of your imagemagick bin.
Also the perl scripts in the included gmt directory need to have the directory references to the gmt and imagemagick bins pointing to the correct places.
Generally this could be extended for other graphic types and templates - the format of the function call is create_graphic(graphic_type, input_graphic_template, output_filename,
graphic_settings,...)
GMT was used for the dial hand elements as is produces the cleanest vector arrows for overlaying. GMT requires a 'basemap' which approximately overlays the underlying template graphic(close enough). I tried using imagemagick's rotate functions, but they leave a lot of visual artifacts behind and are unsuitable. I do use imagemagick exclusively for the gauges as this is just a simple superposition of a few graphical layers.
The choice of .gif, .jpg or .png is experimental - some image types are better suited to certain transformation steps or browser display than others.
| Description: |
|
| Filesize: |
28.19 KB |
| Viewed: |
6124 Time(s) |

|
| Description: |
|
| Filesize: |
3.92 KB |
| Viewed: |
6124 Time(s) |

|
| Description: |
|
| Filesize: |
8.65 KB |
| Viewed: |
6124 Time(s) |

|
| Description: |
|
| Filesize: |
15.4 KB |
| Viewed: |
6124 Time(s) |

|
| Description: |
|
| Filesize: |
28.19 KB |
| Viewed: |
6124 Time(s) |

|
| Description: |
|
 Download |
| Filename: |
graphic.tar |
| Filesize: |
1.19 MB |
| Downloaded: |
1162 Time(s) |
|
|
| Back to top |
|
 |
|
|
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 vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by php BB © 2001, 2002 php BB Group
|