File: examples.php

package info (click to toggle)
php-imlib 0.7-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,020 kB
  • ctags: 817
  • sloc: php: 2,464; ansic: 1,324; xml: 94; makefile: 67; sh: 12
file content (77 lines) | stat: -rw-r--r-- 1,819 bytes parent folder | download | duplicates (4)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<? $page = 5; include './header.inc' ?>
<?

switch ($e)
{
   case 1:
   case 2:
   case 3:
   case 4:
   case 5:
      $showcode = 1;
      break;
   default:
      $showcode = 0;
}

switch ($i)
{
   case 3:
   case 4:
   case 5:
      $showimg = 1;
      break;
   default:
      break;
}

?>
<u>Script Examples</u>
<p>
Here are some examples of using the php_imlib extension.  The first two use
only the functions provided in php_imlib, the rest use the PHP classes.
<ul>
<li><? echo ($e == 1) ?
       'Extension: Upload and Scale an Image' :
       '<a href="examples.php?e=1">Extension: Upload and Scale an Image</a>'
    ?>
<li><? echo ($e == 2) ?
       'Extension: Draw a Text String' :
       '<a href="examples.php?e=2">Extension: Draw a Text String</a>'
    ?>
<li><? echo ($e == 3) ?
       'PHP Classes: Flip, Blend, Text' :
       '<a href="examples.php?e=3">PHP Classes: Flip, Blend, Text</a>'
    ?>
<li><? echo ($e == 4) ?
       'PHP Classes: Draw Rect, Poly, Ellipse' :
       '<a href="examples.php?e=4">PHP Classes: Draw Rect, Poly, Ellipse</a>'
    ?>
<li><? echo ($e == 5) ?
       'PHP Classes: Gradients, Transparency' :
       '<a href="examples.php?e=5">PHP Classes: Gradients, Transparency</a>'
    ?>
</ul></p>
<? if ($showcode) { echo "\n"; ?>
<table border="0">
  <tr>
    <td class="d-cell">
      <? include "./example.$e.inc"; echo "\n" ?>
    </td>
  </tr>
</table>
<? } else if ($showimg) { ?>
<table border="0">
  <tr>
    <td class="d-cell">
      The image created by
      <? if ($i == 3) echo 'PHP Classes: Flip, Blend, Text:';
         else if ($i == 4) echo 'PHP Classes: Draw Rect, Poly, Ellipse:';
         else if ($i == 5) echo 'PHP Classes: Gradients, Transparency:';
      ?>
      <br><br>
      <img src="example.<? echo $i ?>.png">
    </td>
  </tr>
</table>
<? } ?>