1Template::Plugin::GD(3)User Contributed Perl DocumentatioTnemplate::Plugin::GD(3)
2
3
4

NAME

6       Template::Plugin::GD - GD plugin(s) for the Template Toolkit
7

SYNOPSIS

9           [% USE GD;
10
11              # create an image
12              img = GD.image(width, height)
13
14              # allocate some colors
15              black = img.colorAllocate(0,   0,   0);
16              red   = img.colorAllocate(255, 0,   0);
17              blue  = img.colorAllocate(0,   0, 255);
18
19              # draw a blue oval
20              img.arc(50, 50, 95, 75, 0, 360, blue);
21
22              # fill it with red
23              img.fill(50, 50, red);
24
25              # output binary image in PNG format
26              img.png ⎪ redirect('example.png');
27           %]
28

DESCRIPTION

30       The Template-GD distribution provides a number of Template Toolkit
31       plugin modules to interface with Lincoln Stein's GD modules.  These in
32       turn provide an interface to Thomas Boutell's GD graphics library.
33
34       These plugins were distributed as part of the Template Toolkit until
35       version 2.15 released in February 2006.  At this time they were
36       extracted into this separate distribution.
37
38       For general information on the Template Toolkit see the documentation
39       for the Template module or <http://template-toolkit.org>.  For informa‐
40       tion on using plugins, see Template::Plugins and "USE" in Tem‐
41       plate::Manual::Directives.
42

METHODS

44       The GD plugin module provides a number of methods to create various
45       other GD objects.  But first you need to load the GD plugin.
46
47           [% USE GD %]
48
49       Then you can call the following objects against it.
50
51       image(width, height)
52
53       Creates a new GD::Image object.
54
55           [% image = GD.image(100, 200) %]
56
57       polygon()
58
59       Creates a new GD::Polygon object.
60
61           [% poly = GD.polygon;
62              poly.addPt(50,0);
63              poly.addPt(99,99);
64              poly.addPt(0,99);
65              image.filledPolygon(poly, blue);
66           %]
67
68       text()
69
70       Creates a new GD::Text object.
71
72           [%  text = GD.text;
73               text.set_text('Some text');
74           %]
75

GD PLUGINS

77       These are the GD plugins provided in this distribution.
78
79       Template::Plugin::GD
80
81       Front-end module to the GD plugin collection.
82
83       Template::Plugin::GD::Image
84
85       Plugin interface providing direct access to the GD::Image module.
86
87           [% USE image = GD.Image %]
88
89       Template::Plugin::GD::Polygon
90
91       Plugin interface providing direct access to the GD::Polygon module.
92
93           [% USE poly = GD.Polygon;
94              poly.addPt(50,0);
95              poly.addPt(99,99);
96              poly.addPt(0,99);
97              image.filledPolygon(poly, blue);
98           %]
99
100       Template::Plugin::GD::Text
101
102       Plugin interface providing direct access to the GD::Text module.
103
104           [%  USE text = GD.Text;
105               text.set_text('Some text');
106           %]
107
108       Template::Plugin::GD::Text::Align
109
110       Plugin interface to the GD::Text::Align module for creating aligned
111       text.
112
113       Template::Plugin::GD::Text::Wrap
114
115       Plugin interface to the GD::Text::Wrap module for creating wrapped
116       text.
117
118       Template::Plugin::GD::Graph::area
119
120       Plugin interface to the GD::Graph::area module for creating area graph‐
121       ics with axes and legends.
122
123       Template::Plugin::GD::Graph::bars3d
124
125       Plugin interface to the GD::Graph::bars3d module for creating 3D bar
126       graphs with axes and legends.
127
128       Template::Plugin::GD::Graph::bars
129
130       Plugin interface to the GD::Graph::bars module for creating bar graphs
131       with axes and legends.
132
133       Template::Plugin::GD::Graph::lines3d
134
135       Plugin interface to the GD::Graph::lines3d module for creating 3D line
136       graphs with axes and legends.
137
138       Template::Plugin::GD::Graph::lines
139
140       Plugin interface to the GD::Graph::lines module for creating line
141       graphs with axes and legends.
142
143       Template::Plugin::GD::Graph::linespoints
144
145       Plugin interface to the GD::Graph::linespoints module for creating
146       line/point graphs with axes and legends
147
148       Template::Plugin::GD::Graph::mixed
149
150       Plugin interface to the GD::Graph::mixed module for creating mixed
151       graphs with axes and legends.
152
153       Template::Plugin::GD::Graph::pie3d
154
155       Plugin interface to the GD::Graph::pie3d module for creating 3D pie
156       charts with legends.
157
158       Template::Plugin::GD::Graph::pie
159
160       Plugin interface to the GD::Graph::pie module for creating pie charts
161       with legends.
162
163       Template::Plugin::GD::Graph::points
164
165       Plugin interface to the GD::Graph::points module for creating point
166       graphs with axes and legends
167
168       Template::Plugin::GD::Constants
169
170       Provides access to various GD constants.
171
172           [% USE gdc = GD.Constants;
173              font = gdc.gdLargeFont
174           %]
175

AUTHORS

177       Thomas Boutell wrote the GD graphics library.  Lincoln D. Stein wrote
178       the Perl GD modules and Martien Verbruggen wrote the GD::Text and
179       GD::Graph modules that interface with it.  Craig Barratt wrote the GD
180       plugins for the Template Toolkit.  Andy Wardley wrote the Template
181       Toolkit.  Larry wrote Perl.  Brian and Dennis wrote C.  Dennis and Ken
182       wrote Unix.
183

VERSION

185       This is version 2.66 of the Template::Plugin::GD module set.
186
188       Copyright (C) 2001 Craig Barratt, 2006 Andy Wardley.
189
190       This module is free software; you can redistribute it and/or modify it
191       under the same terms as Perl itself.
192

SEE ALSO

194       Template, Template::Plugins, GD
195
196
197
198perl v5.8.8                       2006-02-03           Template::Plugin::GD(3)
Impressum