Blame view

site/jpgraph/docs/chunkhtml/example_src/checkgd2.html 5.42 KB
d72ac078   Guillaume   Ajout graphe V1.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  <div style="font-weight: bold;margin-left:15px;">checkgd2.php</div><link rel="stylesheet" href="../phphl.css" type="text/css"><div class="hl-main"><table class="hl-table" width="100%"><tr><td class="hl-gutter" align="right" valign="top"><pre>1
  2
  3
  4
  5
  6
  7
  8
  9
  10
  11
  12
  13
  14
  </pre></td><td class="hl-main" valign="top"><pre><span class="hl-inlinetags">&lt;?php</span><span class="hl-code"> </span><span class="hl-comment">//</span><span class="hl-comment"> content=&quot;text/plain; charset=utf-8&quot;</span><span class="hl-comment"></span><span class="hl-code">
  </span><span class="hl-var">$im</span><span class="hl-code"> =  </span><span class="hl-identifier">imagecreatetruecolor</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-code"> </span><span class="hl-number">300</span><span class="hl-code">, </span><span class="hl-number">200</span><span class="hl-brackets">)</span><span class="hl-code">;
  </span><span class="hl-var">$black</span><span class="hl-code"> = </span><span class="hl-identifier">imagecolorallocate</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-var">$im</span><span class="hl-code">,  </span><span class="hl-number">0</span><span class="hl-code">, </span><span class="hl-number">0</span><span class="hl-code">, </span><span class="hl-number">0</span><span class="hl-brackets">)</span><span class="hl-code">;
  </span><span class="hl-var">$lightgray</span><span class="hl-code"> = </span><span class="hl-identifier">imagecolorallocate</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-var">$im</span><span class="hl-code">,  </span><span class="hl-number">230</span><span class="hl-code">, </span><span class="hl-number">230</span><span class="hl-code">, </span><span class="hl-number">230</span><span class="hl-brackets">)</span><span class="hl-code">;
  </span><span class="hl-var">$darkgreen</span><span class="hl-code"> = </span><span class="hl-identifier">imagecolorallocate</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-var">$im</span><span class="hl-code">,  </span><span class="hl-number">80</span><span class="hl-code">, </span><span class="hl-number">140</span><span class="hl-code">, </span><span class="hl-number">80</span><span class="hl-brackets">)</span><span class="hl-code">;
  </span><span class="hl-var">$white</span><span class="hl-code"> = </span><span class="hl-identifier">imagecolorallocate</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-var">$im</span><span class="hl-code">,  </span><span class="hl-number">255</span><span class="hl-code">, </span><span class="hl-number">255</span><span class="hl-code">, </span><span class="hl-number">255</span><span class="hl-brackets">)</span><span class="hl-code">;
   
  </span><span class="hl-identifier">imagefilledrectangle</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-var">$im</span><span class="hl-code">,</span><span class="hl-number">0</span><span class="hl-code">,</span><span class="hl-number">0</span><span class="hl-code">,</span><span class="hl-number">299</span><span class="hl-code">,</span><span class="hl-number">199</span><span class="hl-code"> ,</span><span class="hl-var">$lightgray</span><span class="hl-brackets">)</span><span class="hl-code">;
  </span><span class="hl-identifier">imagerectangle</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-var">$im</span><span class="hl-code">,</span><span class="hl-number">0</span><span class="hl-code">,</span><span class="hl-number">0</span><span class="hl-code">,</span><span class="hl-number">299</span><span class="hl-code">,</span><span class="hl-number">199</span><span class="hl-code">,</span><span class="hl-var">$black</span><span class="hl-brackets">)</span><span class="hl-code">;
  </span><span class="hl-identifier">imagefilledellipse</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-var">$im</span><span class="hl-code">,</span><span class="hl-number">150</span><span class="hl-code">,</span><span class="hl-number">100</span><span class="hl-code">,</span><span class="hl-number">210</span><span class="hl-code">,</span><span class="hl-number">110</span><span class="hl-code">,</span><span class="hl-var">$white</span><span class="hl-brackets">)</span><span class="hl-code">;
  </span><span class="hl-identifier">imagefilledellipse</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-var">$im</span><span class="hl-code">,</span><span class="hl-number">150</span><span class="hl-code">,</span><span class="hl-number">100</span><span class="hl-code">,</span><span class="hl-number">200</span><span class="hl-code">,</span><span class="hl-number">100</span><span class="hl-code">,</span><span class="hl-var">$darkgreen</span><span class="hl-brackets">)</span><span class="hl-code">;
  </span><span class="hl-identifier">header</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">Content-type: image/png</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">;
  </span><span class="hl-identifier">imagepng</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-var">$im</span><span class="hl-brackets">)</span><span class="hl-code">;
  </span><span class="hl-inlinetags">?&gt;</span></pre></td></tr></table></div>