Blame | Letzte Änderung | Log anzeigen | RSS feed
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1"><LINK REL="Start" HREF="index.html"><LINK REL="Contents" HREF="toc.html"><LINK REL="Prev" HREF="121GeneratingAntiSpamchallenge.html"><LINK REL="Next" HREF="131AdjustingthesizeoftheLEDdigits.html"><STYLE TYPE="text/css"><!--BODY { font-family: serif }H1 { font-family: sans-serif }H2 { font-family: sans-serif }H3 { font-family: sans-serif }H4 { font-family: sans-serif }H5 { font-family: sans-serif }H6 { font-family: sans-serif }SUB { font-size: smaller }SUP { font-size: smaller }PRE { font-family: monospace }A { text-decoration: none }--></STYLE></HEAD><BODY><A HREF="toc.html">Contents</A><A HREF="121GeneratingAntiSpamchallenge.html">Previous</A><A HREF="131AdjustingthesizeoftheLEDdigits.html">Next</A><HR NOSHADE><H1><A NAME="13">13 Generating LED-like digits with JpGraph</A></H1>Starting with v1.21 it is possible to generate LED like digits withJpGraph. This is accomplished by the usage of the "jpgraph_led.php"module.<P> The creation of LED digits and letters are extremely simple. Thefollowing complete example demonstrates the creation of a LED display<DIVclass="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB"> <BR><BR></FONT><FONT color="#007700">include </FONT><FONT color="#DD0000">"../jpgraph.php"</FONT><FONT color="#007700">;<BR>include </FONT><FONT color="#DD0000">"../jpgraph_led.php"</FONT><FONTcolor="#007700">;<BR><BR></FONT><FONT color="#FF8000">// By default each "LED" circle has a radius of 3 pixels<BR></FONT><FONT color="#0000BB">$led </FONT><FONT color="#007700">= new </FONT><FONT color="#0000BB">DigitalLED74</FONT><FONT color="#007700">();<BR></FONT><FONT color="#0000BB">$led</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">Stroke</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">'0123456789. ABCDEFGHIJKL'</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">LEDC_GREEN</FONT><FONT color="#007700">); <BR></FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV></P><P> The result of running this script can be seen by running the"Examples/ledex1.php" Example in the example directory. As can be seenfrom the above example the color to be used for the LED digits isspecified as the second argument to the DigitalLED74::Stroke() method.Available color for LED digits is given by the table below</P><TABLE style="border:darkgray solid 1px;"><TR><TD><B>Symbolic name</B></TD><TD><B>Color</B></TD></TR><TR><TD>LEDC_RED</TD><TD>Red</TD></TR><TR><TD>LEDC_GREEN</TD><TD>Green</TD></TR><TR><TD>LEDC_BLUE</TD><TD>Blue</TD></TR><TR><TD>LEDC_YELLOW</TD><TD>Yellow</TD></TR><TR><TD>GREY</TD><TD>Grey</TD></TR></TABLE><P> Since the standard LED matrix of 7x4 dots does not lend itself toaccurately represent all normal ASCII characters only the followingnumbers and letters can be displayed.</P><TABLE style="border:darkgray solid 1px;"><TR><TD>All digits, 0-9</TD></TR><TR><TD>Capital Letters, A-L</TD></TR></TABLE><HR NOSHADE><A HREF="toc.html">Contents</A><A HREF="121GeneratingAntiSpamchallenge.html">Previous</A><A HREF="131AdjustingthesizeoftheLEDdigits.html">Next</A></BODY></HTML>