| 1 |
lars |
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
|
|
2 |
<HTML>
|
|
|
3 |
<HEAD>
|
|
|
4 |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1">
|
|
|
5 |
<LINK REL="Start" HREF="index.html">
|
|
|
6 |
<LINK REL="Contents" HREF="toc.html">
|
|
|
7 |
<LINK REL="Prev" HREF="311VerifyingthatyouhavetheGDlibraryinstalled.html">
|
|
|
8 |
<LINK REL="Next" HREF="313PreparingTrueTypeFontFiles.html">
|
|
|
9 |
<STYLE TYPE="text/css"><!--
|
|
|
10 |
BODY { font-family: serif }
|
|
|
11 |
H1 { font-family: sans-serif }
|
|
|
12 |
H2 { font-family: sans-serif }
|
|
|
13 |
H3 { font-family: sans-serif }
|
|
|
14 |
H4 { font-family: sans-serif }
|
|
|
15 |
H5 { font-family: sans-serif }
|
|
|
16 |
H6 { font-family: sans-serif }
|
|
|
17 |
SUB { font-size: smaller }
|
|
|
18 |
SUP { font-size: smaller }
|
|
|
19 |
PRE { font-family: monospace }
|
|
|
20 |
A { text-decoration: none }
|
|
|
21 |
--></STYLE>
|
|
|
22 |
</HEAD>
|
|
|
23 |
<BODY>
|
|
|
24 |
<A HREF="toc.html">Contents</A>
|
|
|
25 |
<A HREF="311VerifyingthatyouhavetheGDlibraryinstalled.html">Previous</A>
|
|
|
26 |
<A HREF="313PreparingTrueTypeFontFiles.html">Next</A>
|
|
|
27 |
<HR NOSHADE>
|
|
|
28 |
<H3><A NAME="3_1_2">3.1.2 Verifying that you have GD2 installed</A></H3>
|
|
|
29 |
<P> To access the more advanced features of JpGraph needs the GD 2.x
|
|
|
30 |
library. This will allow the use of features such as alpha-blending and
|
|
|
31 |
trucolor images.</P>
|
|
|
32 |
<P> The GD 2.x library is included in all standard PHP versions from
|
|
|
33 |
4.2.x and above. To make sure that the GD 2.x library is installed the
|
|
|
34 |
following script must be working.<DIV class="phpscript"><CODE><FONT color="#000000">
|
|
|
35 |
<FONT color="#0000BB"> $im </FONT><FONT color="#007700">= </FONT><FONT color="#0000BB">
|
|
|
36 |
imagecreatetruecolor </FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">
|
|
|
37 |
300</FONT><FONT color="#007700">, </FONT><FONT color="#0000BB">200</FONT><FONT
|
|
|
38 |
color="#007700">);
|
|
|
39 |
<BR></FONT><FONT color="#0000BB">$black </FONT><FONT color="#007700">= </FONT><FONT
|
|
|
40 |
color="#0000BB">imagecolorallocate </FONT><FONT color="#007700">(</FONT><FONT
|
|
|
41 |
color="#0000BB">$im</FONT><FONT color="#007700">, </FONT><FONT color="#0000BB">
|
|
|
42 |
0</FONT><FONT color="#007700">, </FONT><FONT color="#0000BB">0</FONT><FONT
|
|
|
43 |
color="#007700">, </FONT><FONT color="#0000BB">0</FONT><FONT color="#007700">
|
|
|
44 |
);
|
|
|
45 |
<BR></FONT><FONT color="#0000BB">$white </FONT><FONT color="#007700">= </FONT><FONT
|
|
|
46 |
color="#0000BB">imagecolorallocate </FONT><FONT color="#007700">(</FONT><FONT
|
|
|
47 |
color="#0000BB">$im</FONT><FONT color="#007700">, </FONT><FONT color="#0000BB">
|
|
|
48 |
255</FONT><FONT color="#007700">, </FONT><FONT color="#0000BB">255</FONT><FONT
|
|
|
49 |
color="#007700">, </FONT><FONT color="#0000BB">255</FONT><FONT color="#007700">
|
|
|
50 |
);
|
|
|
51 |
<BR>
|
|
|
52 |
<BR></FONT><FONT color="#0000BB">imagefilledrectangle</FONT><FONT color="#007700">
|
|
|
53 |
(</FONT><FONT color="#0000BB">$im</FONT><FONT color="#007700">,</FONT><FONT
|
|
|
54 |
color="#0000BB">0</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">
|
|
|
55 |
0</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">399</FONT><FONT
|
|
|
56 |
color="#007700">,</FONT><FONT color="#0000BB">99</FONT><FONT color="#007700">
|
|
|
57 |
,</FONT><FONT color="#0000BB">$white</FONT><FONT color="#007700">);
|
|
|
58 |
<BR></FONT><FONT color="#0000BB">imagerectangle</FONT><FONT color="#007700">
|
|
|
59 |
(</FONT><FONT color="#0000BB">$im</FONT><FONT color="#007700">,</FONT><FONT
|
|
|
60 |
color="#0000BB">20</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">
|
|
|
61 |
20</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">250</FONT><FONT
|
|
|
62 |
color="#007700">,</FONT><FONT color="#0000BB">190</FONT><FONT color="#007700">
|
|
|
63 |
,</FONT><FONT color="#0000BB">$black</FONT><FONT color="#007700">);
|
|
|
64 |
<BR>
|
|
|
65 |
<BR></FONT><FONT color="#0000BB">header </FONT><FONT color="#007700">(</FONT><FONT
|
|
|
66 |
color="#DD0000">"Content-type: image/png"</FONT><FONT color="#007700">
|
|
|
67 |
);
|
|
|
68 |
<BR></FONT><FONT color="#0000BB">imagepng </FONT><FONT color="#007700">(</FONT><FONT
|
|
|
69 |
color="#0000BB">$im</FONT><FONT color="#007700">);</FONT><FONT color="#0000BB">
|
|
|
70 |
</FONT></FONT></CODE></DIV></P>
|
|
|
71 |
<P> After running this script you should now see a black rectangle in
|
|
|
72 |
your browser.</P>
|
|
|
73 |
<HR NOSHADE>
|
|
|
74 |
<A HREF="toc.html">Contents</A>
|
|
|
75 |
<A HREF="311VerifyingthatyouhavetheGDlibraryinstalled.html">Previous</A>
|
|
|
76 |
<A HREF="313PreparingTrueTypeFontFiles.html">Next</A>
|
|
|
77 |
</BODY>
|
|
|
78 |
</HTML>
|