PHP Classes

File: sample.html

Recommend this page to a friend!
  Classes of Huda M Elmatsani   DigiDisplayer   sample.html   Download  
File: sample.html
Role: Example script
Content type: text/plain
Description: sample and note
Class: DigiDisplayer
Generate graphic images representing number digits
Author: By
Last change: change sampel, using class FrameMaker to add border.
Date: 20 years ago
Size: 4,197 bytes
 

Contents

Class file image Download
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Sample Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 {font-size: 36px}
-->
</style>
</head>

<body>
<table width="100%" border="2" cellspacing="0" cellpadding="4">
  <tr align="center">
    <td colspan="3"><span class="style1">DigiDisplayer</span></td>
  </tr>
  <tr align="center">
    <td width="159">presentations</td>
    <td width="174">notes</td>
    <td width="434">codes</td>
  </tr>
  <tr valign="top">
    <td align="center"><img src="display1.php"></td>
    <td>- no strip image<br>
      - no border </td>
    <td>$counter = new DigiDisplayer($number);<br>
    $counter-&gt;display_digit();</td>
  </tr>
  <tr valign="top">
    <td align="center"><img src="test2.php"></td>
    <td>- with strip image<br>
- no border <br>
- length 10 digit </td>
    <td>$rand_number = rand(32441234,99875432);<br>
      $counter = new DigiDisplayer($rand_number,'strip02.gif',10);<br>
    $counter-&gt;display_digit();</td>
  </tr>
  <tr valign="top">
    <td align="center"><img src="test3.php"></td>
    <td>- with strip image<br>
    - with border <br>
    </td>
    <td>include(&quot;digidisplayer.php&quot;);<br>
      include(&quot;framemaker.php&quot;);
      <p>$rand_number = rand(32441234,99875432);<br>
        $counter = new DigiDisplayer($rand_number,'strip08.jpg');<br>
        $img = $counter-&gt;draw_digit();</p>
      <p>$border = new FrameMaker();<br>
        $border-&gt;set_image($img);<br>
        $border-&gt;set_border(12,&quot;938348&quot;,&quot;sunken&quot;);<br>
        $border-&gt;show_picture();<br>
    </p></td>
  </tr>
</table>
<p>&nbsp;</p>
<table width="100%" border="1" cellspacing="0" cellpadding="2">
  <tr valign="top">
    <td width="46%">Class DigiDisplayer</td>
    <td width="54%">Serve graphical numbers using various strip image.</td>
  </tr>
  <tr valign="top">
    <td>DigiDisplayer($count,$strip=&quot;&quot;,$length=0)</td>
    <td>Constructor.<br>
      $count - the number to be converted.<br>
      $strip - the strip image file name<br>
      $length - digit length </td>
  </tr>
  <tr valign="top">
    <td>load_strip()</td>
    <td>Check wether the strip exists. </td>
  </tr>
  <tr valign="top">
    <td>display_digit($type='JPEG')</td>
    <td>Output as the image.<br>
      $type - what image type you want </td>
  </tr>
  <tr valign="top">
    <td>draw_digit()</td>
    <td>Draw the digit numbers by arranging strip image slices. </td>
  </tr>
  <tr valign="top">
    <td>draw_strip()</td>
    <td>Create strip image object if no strip image file. </td>
  </tr>
  <tr valign="top">
    <td>draw_frame()</td>
    <td>if border is set, call this function for placing border. </td>
  </tr>
  <tr valign="top">
    <td>get_imagetype($file)</td>
    <td>ask the image type of strip image file. </td>
  </tr>
  <tr valign="top">
    <td>hex2rgb($color)</td>
    <td>convert hexadecimal color to rgb format.<br>
      $color - in hex. </td>
  </tr>
  <tr valign="top">
    <td>gradient($coldeb, $colfin, $n)</td>
    <td>create gradient color.<br>
      $coldeb - start color.<br>
      $colorfin - end color.<br>
      $n - grad step.</td>
  </tr>
  <tr valign="top">
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr valign="top">
    <td>Huda M Elmatsani - 7 August 2004 </td>
    <td>STRIP IMAGES </td>
  </tr>
  <tr valign="top">
    <td>&nbsp;</td>
    <td><img src="strips/strip01.gif" width="150" height="20"><br>
    <img src="strips/strip02.gif" width="150" height="20"><br>
    <img src="strips/strip03.gif" width="120" height="15"><br>
    <img src="strips/strip04.gif" width="222" height="25"><br>
    <img src="strips/strip05.gif" width="120" height="23"><br>
    <img src="strips/strip06.gif" width="200" height="23"><br>
    <img src="strips/strip07.gif" width="150" height="20"><br>
    <img src="strips/strip08.jpg" width="160" height="20"></td>
  </tr>
</table>
<p>&nbsp;</p>
</body>
</html>