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="114Usingacanvasscale.html"><LINK REL="Next" HREF="12AntiSpamChallenges.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="114Usingacanvasscale.html">Previous</A><A HREF="12AntiSpamChallenges.html">Next</A><HR NOSHADE><H2><A NAME="11_5">11.5 Sample application: Drawing DB schema</A></H2><P> As a final example we shortly discuss how the canvas type of graphwas used to generate the DB schema for the DDDA architecture.</P><P> The library php file "utils/misc/imgdbschema.php" included in thedistribution contains some utility classes to make the drawing of tableschemes easier. It contains two basic classes, Class ImgDBTable andClass ImgDBSchema. The first class understand how to draw an imageillustrating a single table. The second class is responsible forautomatically extract all the relevant information from a DB to draw acomplete DB Schema.</P><P> Before going into this a little bit more we show what an example ofthis might look like.<DIV class="example"><BR> <A href="exframes/frame_dbschemaex1.html" target="blank"><IMG border="0"HEIGHT="750" src="img/dbschemaex1.png" WIDTH="600"></A><BR><B>Figure 190:</B> Example of using the canvas graph style togetherwith the imgdbschema.php library to semi-automatically generate a DBschema <A href="exframes/frame_dbschemaex1.html" target="blank">[src]</A> <P></P></DIV></P><P></P><P> Before going on it should be noted that the ImgDBSchema assumes thatthe DB can be accessed through a DB abstraction layer modeled after theabstraction layer available in the 'jpdb.php' file in the DDDAarchitecture. This abstraction layer assumes a MySQL database in thebottom. This specific dependency of this particular abstraction layeris the reason why these classes is not included in the generic canvastools file.</P><P> The second thing to note is that this library does not contain acomplete automatic-layout engine but rather a very simple automaticsystem which, if nothing else is specified, just puts the table in arectangular grid. A complete graph layout engine would simple be tomuch to write in this context. This is also a very difficultoptimization problem and sofar not even any of the available researchprograms that tries this can achieve a satisfactory layout withoutmanual intervention.</P><P> The critical lines in the code to generate the above graph is<DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB"> $tblposadj</FONT><FONTcolor="#007700">=array(</FONT><FONT color="#0000BB">$tlo</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">0</FONT><FONT color="#007700">,</FONT><FONTcolor="#0000BB">$tblwidth</FONT><FONT color="#007700">+</FONT><FONT color="#0000BB">$tlo</FONT><FONT color="#007700">+</FONT><FONT color="#0000BB">2</FONT><FONTcolor="#007700">,</FONT><FONT color="#0000BB">0</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">2</FONT><FONT color="#007700">*</FONT><FONTcolor="#0000BB">$tblwidth</FONT><FONT color="#007700">+</FONT><FONT color="#0000BB">$tlo</FONT><FONT color="#007700">+</FONT><FONT color="#0000BB">4</FONT><FONTcolor="#007700">,</FONT><FONT color="#0000BB">0</FONT><FONT color="#007700">,-</FONT><FONT color="#0000BB">1</FONT><FONT color="#007700">,</FONT><FONTcolor="#0000BB">16</FONT><FONT color="#007700">,-</FONT><FONT color="#0000BB">1</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">16</FONT><FONTcolor="#007700">);<BR></FONT><FONT color="#0000BB">$dbschema </FONT><FONT color="#007700">= new </FONT><FONT color="#0000BB">ImgDBSchema</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">"jpgraph_doc"</FONT><FONT color="#007700">,</FONT><FONT color="#DD0000">"FormatTblName"</FONT><FONT color="#007700">,</FONT><FONT color="#DD0000">"FormatFldName"</FONT><FONT color="#007700">);<BR></FONT><FONT color="#0000BB">$dbschema</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">SetMargin</FONT><FONT color="#007700">(</FONT><FONTcolor="#0000BB">$leftm</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">$topm</FONT><FONT color="#007700">);<BR></FONT><FONT color="#0000BB">$dbschema</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">SetTableWidth</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">$tblwidth</FONT><FONT color="#007700">);<BR></FONT><FONT color="#0000BB">$dbschema</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">Stroke</FONT><FONT color="#007700">(</FONT><FONTcolor="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">img</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">$this</FONT><FONTcolor="#007700">-></FONT><FONT color="#0000BB">iscale</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">$tblposadj</FONT><FONT color="#007700">);</FONT><FONTcolor="#0000BB"></FONT></FONT></CODE></DIV></P><P></P><P> The rest of the code in the file is just to setup the canvas, add anindented rectangle to group some tables and generate a footer with thedate and time this image was generated.</P><P> The first line instantiates a new ImgDBSCheme layout engine askingit to draw an image for the database 'jpgraph_doc'. The following twoarguments specify two callback functions for formatting the text forheader and each field in a table.</P><P> The next line specify the top left margin where the drawing of thetables should be started.</P><P> The third line specify the width of a single table. The final linesstarts the engine and draws all tables in the database to the canvas.The final argument requires some further explanation. This is an offset(x,y) from the top left corner how each individual table should bepositioned. If the value is -1 indicates that the default value shouldbe used. If this array is not specified then the tables will simplearranged line by line.</P><P> The full source code for drawing this DB schema example is shownbelow.</P><P><DIV class="phpscript">(File: dbschemaex1.php)<BR><CODE><FONT color="#000000"> <FONT color="#0000BB"><?php<BR></FONT><FONT color="#FF8000">/*=======================================================================<BR>// File: DBSCHEMAEX1.PHP<BR>// Description: Draw a DB schema of the DDDA architecture<BR>// Created: 2002-08-25<BR>// Ver: $Id: dbschemaex1.php,v 1.1 2002/08/27 20:08:57 aditus Exp $<BR>//<BR>// License: This code is released under QPL<BR>// Copyright (C) 2001,2002 Johan Persson<BR>// Note: The actual drawing of the tables are semi-automatically<BR>// but you can easily adjust the individual tables position<BR>// with the 'tblposadj' array. <BR>//<BR>//========================================================================<BR>*/<BR></FONT><FONT color="#007700">include </FONT><FONT color="#DD0000">"../jpgraph.php"</FONT><FONT color="#007700">;<BR>include </FONT><FONT color="#DD0000">"../jpgraph_canvas.php"</FONT><FONTcolor="#007700">;<BR>include </FONT><FONT color="#DD0000">"../jpgraph_canvtools.php"</FONT><FONTcolor="#007700">;<BR>include </FONT><FONT color="#DD0000">"../imgdbschema.inc"</FONT><FONTcolor="#007700">;<BR>include </FONT><FONT color="#DD0000">"../jpdb.php"</FONT><FONT color="#007700">;<BR><BR><BR></FONT><FONT color="#FF8000">// Global callback to format the table header names<BR></FONT><FONT color="#007700">function </FONT><FONT color="#0000BB">FormatTblName</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">$aName</FONT><FONT color="#007700">) {<BR> </FONT><FONT color="#FF8000">// We want to replace any specifi references to the<BR> // 'JpGraph' project with the generic '<project>'<BR> </FONT><FONT color="#007700">return </FONT><FONT color="#0000BB">str_replace</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">'JpGraph'</FONT><FONT color="#007700">,</FONT><FONT color="#DD0000">'<project>'</FONT><FONT color="#007700">, </FONT><FONT color="#0000BB">$aName</FONT><FONT color="#007700">);<BR>}<BR><BR></FONT><FONT color="#FF8000">// Global callback to format each field name in the table<BR></FONT><FONT color="#007700">function </FONT><FONT color="#0000BB">FormatFldName</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">$aName</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">$aTable</FONT><FONTcolor="#007700">) {<BR> return </FONT><FONT color="#0000BB">$aName</FONT><FONT color="#007700">;<BR>}<BR><BR><BR>class </FONT><FONT color="#0000BB">Driver </FONT><FONT color="#007700">{<BR><BR> var </FONT><FONT color="#0000BB">$ig</FONT><FONT color="#007700">, </FONT><FONT color="#0000BB">$img</FONT><FONT color="#007700">, </FONT><FONTcolor="#0000BB">$iscale</FONT><FONT color="#007700">, </FONT><FONT color="#0000BB">$ishape</FONT><FONT color="#007700">;<BR> var </FONT><FONT color="#0000BB">$iymax</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">$ixmax</FONT><FONT color="#007700">;<BR> var </FONT><FONT color="#0000BB">$iwidth</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">$iheight</FONT><FONT color="#007700">;<BR><BR> function </FONT><FONT color="#0000BB">Driver</FONT><FONT color="#007700">() {<BR><BR> </FONT><FONT color="#FF8000">// Define Image size and coordinate grid space to work within<BR> </FONT><FONT color="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">iwidth </FONT><FONT color="#007700">= </FONT><FONTcolor="#0000BB">600</FONT><FONT color="#007700">;<BR> </FONT><FONT color="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">iheight</FONT><FONT color="#007700">= </FONT><FONTcolor="#0000BB">750</FONT><FONT color="#007700">;<BR> </FONT><FONT color="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">iymax </FONT><FONT color="#007700">= </FONT><FONTcolor="#0000BB">50</FONT><FONT color="#007700">;<BR> </FONT><FONT color="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">ixmax </FONT><FONT color="#007700">= </FONT><FONTcolor="#0000BB">55</FONT><FONT color="#007700">;<BR><BR> </FONT><FONT color="#FF8000">// Setup a basic canvas<BR> </FONT><FONT color="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">ig </FONT><FONT color="#007700">= new </FONT><FONTcolor="#0000BB">CanvasGraph</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">iwidth</FONT><FONTcolor="#007700">,</FONT><FONT color="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">iheight</FONT><FONT color="#007700">,</FONT><FONTcolor="#DD0000">'auto'</FONT><FONT color="#007700">);<BR> </FONT><FONT color="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">img </FONT><FONT color="#007700">= </FONT><FONTcolor="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">ig</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">img</FONT><FONTcolor="#007700">;<BR><BR> </FONT><FONT color="#FF8000">// Define the scale to be used<BR> </FONT><FONT color="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">iscale </FONT><FONT color="#007700">= new </FONT><FONT color="#0000BB">CanvasScale</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">ig</FONT><FONT color="#007700">);<BR> </FONT><FONT color="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">iscale</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">Set</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">0</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">$this</FONT><FONTcolor="#007700">-></FONT><FONT color="#0000BB">ixmax</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">0</FONT><FONT color="#007700">,</FONT><FONTcolor="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">iymax</FONT><FONT color="#007700">);<BR> </FONT><FONT color="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">ishape </FONT><FONT color="#007700">= new </FONT><FONT color="#0000BB">Shape</FONT><FONT color="#007700">(</FONT><FONTcolor="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">ig</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">$this</FONT><FONTcolor="#007700">-></FONT><FONT color="#0000BB">iscale</FONT><FONT color="#007700">);<BR><BR> </FONT><FONT color="#FF8000">// A small frame around the canvas<BR> </FONT><FONT color="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">ig</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">SetMargin</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">2</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">3</FONT><FONTcolor="#007700">,</FONT><FONT color="#0000BB">2</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">3</FONT><FONT color="#007700">);<BR> </FONT><FONT color="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">ig</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">SetMarginColor</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">"teal"</FONT><FONT color="#007700">);<BR> </FONT><FONT color="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">ig</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">InitFrame</FONT><FONT color="#007700">();<BR><BR> }<BR><BR> function </FONT><FONT color="#0000BB">Run</FONT><FONT color="#007700">() {<BR><BR> </FONT><FONT color="#0000BB">$leftm</FONT><FONT color="#007700">=</FONT><FONT color="#0000BB">1.5</FONT><FONT color="#007700">; </FONT><FONTcolor="#FF8000">// Left margin (for table schemes) <BR> </FONT><FONT color="#0000BB">$topm</FONT><FONT color="#007700">=</FONT><FONTcolor="#0000BB">5</FONT><FONT color="#007700">; </FONT><FONT color="#FF8000">// Top margin (for table schemes) <BR> </FONT><FONT color="#0000BB">$tblwidth</FONT><FONT color="#007700">=</FONT><FONT color="#0000BB">15</FONT><FONT color="#007700">; </FONT><FONTcolor="#FF8000">// Individual table width<BR> </FONT><FONT color="#0000BB">$tlo</FONT><FONT color="#007700">=</FONT><FONTcolor="#0000BB">1</FONT><FONT color="#007700">; </FONT><FONT color="#FF8000">// Offset for top line<BR><BR> // Add the background color for the project specific tables<BR> </FONT><FONT color="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">ishape</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">IndentedRectangle</FONT><FONT color="#007700">(</FONT><FONTcolor="#0000BB">$leftm</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">$topm</FONT><FONT color="#007700">-</FONT><FONT color="#0000BB">1</FONT><FONTcolor="#007700">,</FONT><FONT color="#0000BB">3</FONT><FONT color="#007700">*</FONT><FONT color="#0000BB">$tblwidth</FONT><FONT color="#007700">+</FONT><FONTcolor="#0000BB">$tlo</FONT><FONT color="#007700">+</FONT><FONT color="#0000BB">6</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">45</FONT><FONTcolor="#007700">,<BR> </FONT><FONT color="#0000BB">$tlo</FONT><FONT color="#007700">+</FONT><FONT color="#0000BB">2</FONT><FONT color="#007700">*</FONT><FONTcolor="#0000BB">$tblwidth</FONT><FONT color="#007700">+</FONT><FONT color="#0000BB">2</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">30</FONT><FONTcolor="#007700">,</FONT><FONT color="#0000BB">CORNER_BOTTOMLEFT</FONT><FONTcolor="#007700">,<BR> </FONT><FONT color="#DD0000">'lightblue'</FONT><FONTcolor="#007700">);<BR><BR> </FONT><FONT color="#FF8000">// Stroke the tables (series of x,y offsets, If =-1 then use the<BR> // automtic positioning<BR> </FONT><FONT color="#0000BB">$tblposadj</FONT><FONT color="#007700">=array(</FONT><FONT color="#0000BB">$tlo</FONT><FONT color="#007700">,</FONT><FONTcolor="#0000BB">0</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">$tblwidth</FONT><FONT color="#007700">+</FONT><FONT color="#0000BB">$tlo</FONT><FONTcolor="#007700">+</FONT><FONT color="#0000BB">2</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">0</FONT><FONT color="#007700">,</FONT><FONTcolor="#0000BB">2</FONT><FONT color="#007700">*</FONT><FONT color="#0000BB">$tblwidth</FONT><FONT color="#007700">+</FONT><FONT color="#0000BB">$tlo</FONT><FONTcolor="#007700">+</FONT><FONT color="#0000BB">4</FONT><FONT color="#007700">,<BR> </FONT><FONT color="#0000BB">0</FONT><FONT color="#007700">,-</FONT><FONT color="#0000BB">1</FONT><FONT color="#007700">,</FONT><FONTcolor="#0000BB">16</FONT><FONT color="#007700">,-</FONT><FONT color="#0000BB">1</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">16</FONT><FONTcolor="#007700">);<BR> </FONT><FONT color="#0000BB">$dbschema </FONT><FONT color="#007700">= new </FONT><FONT color="#0000BB">ImgDBSchema</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">'jpgraph_doc'</FONT><FONT color="#007700">,</FONT><FONT color="#DD0000">'FormatTblName'</FONT><FONT color="#007700">,</FONT><FONT color="#DD0000">'FormatFldName'</FONT><FONT color="#007700">);<BR> </FONT><FONT color="#0000BB">$dbschema</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">SetMargin</FONT><FONT color="#007700">(</FONT><FONTcolor="#0000BB">$leftm</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">$topm</FONT><FONT color="#007700">);<BR> </FONT><FONT color="#0000BB">$dbschema</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">SetTableWidth</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">$tblwidth</FONT><FONT color="#007700">);<BR> </FONT><FONT color="#0000BB">$dbschema</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">Stroke</FONT><FONT color="#007700">(</FONT><FONTcolor="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">img</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">$this</FONT><FONTcolor="#007700">-></FONT><FONT color="#0000BB">iscale</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">$tblposadj</FONT><FONT color="#007700">);<BR><BR> </FONT><FONT color="#0000BB">$tt </FONT><FONT color="#007700">= new </FONT><FONT color="#0000BB">CanvasRectangleText</FONT><FONT color="#007700">();<BR> </FONT><FONT color="#0000BB">$tt</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">SetFillColor</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">''</FONT><FONT color="#007700">);<BR> </FONT><FONT color="#0000BB">$tt</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">SetColor</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">''</FONT><FONT color="#007700">);<BR> </FONT><FONT color="#0000BB">$tt</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">SetFontColor</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">'navy'</FONT><FONT color="#007700">);<BR><BR> </FONT><FONT color="#FF8000">// Add explanation<BR> </FONT><FONT color="#0000BB">$tt</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">SetFont</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">FF_ARIAL</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">FS_NORMAL</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">12</FONT><FONTcolor="#007700">);<BR> </FONT><FONT color="#0000BB">$tt</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">Set</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">'Project specific tables'</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">$tblwidth</FONT><FONT color="#007700">+</FONT><FONT color="#0000BB">$leftm</FONT><FONT color="#007700">+</FONT><FONT color="#0000BB">3</FONT><FONTcolor="#007700">,</FONT><FONT color="#0000BB">16</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">15</FONT><FONT color="#007700">);<BR> </FONT><FONT color="#0000BB">$tt</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">Stroke</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">img</FONT><FONTcolor="#007700">,</FONT><FONT color="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">iscale</FONT><FONT color="#007700">);<BR><BR> </FONT><FONT color="#FF8000">// Add title<BR> </FONT><FONT color="#0000BB">$tt</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">SetColor</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">''</FONT><FONT color="#007700">);<BR> </FONT><FONT color="#0000BB">$tt</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">SetFont</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">FF_VERDANA</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">FS_BOLD</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">26</FONT><FONTcolor="#007700">);<BR> </FONT><FONT color="#0000BB">$tt</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">Set</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">'DDDA - DB Schema'</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">9</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">0.5</FONT><FONTcolor="#007700">,</FONT><FONT color="#0000BB">30</FONT><FONT color="#007700">);<BR> </FONT><FONT color="#0000BB">$tt</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">Stroke</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">img</FONT><FONTcolor="#007700">,</FONT><FONT color="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">iscale</FONT><FONT color="#007700">);<BR><BR> </FONT><FONT color="#FF8000">// Add a version and date<BR> </FONT><FONT color="#0000BB">$tt</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">SetFillColor</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">'yellow'</FONT><FONT color="#007700">);<BR> </FONT><FONT color="#0000BB">$tt</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">SetFont</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">FF_FONT1</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">FS_NORMAL</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">10</FONT><FONTcolor="#007700">);<BR> </FONT><FONT color="#0000BB">$tt</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">Set</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">"Generated: "</FONT><FONT color="#007700">.</FONT><FONT color="#0000BB">date</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">"ymd H:i"</FONT><FONTcolor="#007700">,</FONT><FONT color="#0000BB">time</FONT><FONT color="#007700">()),</FONT><FONT color="#0000BB">1</FONT><FONT color="#007700">,</FONT><FONTcolor="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">iymax</FONT><FONT color="#007700">*</FONT><FONT color="#0000BB">0.96</FONT><FONTcolor="#007700">,</FONT><FONT color="#0000BB">15</FONT><FONT color="#007700">); <BR> </FONT><FONT color="#0000BB">$tt</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">Stroke</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">img</FONT><FONTcolor="#007700">,</FONT><FONT color="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">iscale</FONT><FONT color="#007700">);<BR><BR> </FONT><FONT color="#0000BB">$this</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">ig</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">Stroke</FONT><FONT color="#007700">();<BR> }<BR>}<BR><BR></FONT><FONT color="#0000BB">$driver </FONT><FONT color="#007700">= new </FONT><FONT color="#0000BB">Driver</FONT><FONT color="#007700">();<BR></FONT><FONT color="#0000BB">$driver</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">Run</FONT><FONT color="#007700">();<BR><BR></FONT><FONT color="#0000BB">?><BR></FONT><BR></FONT></CODE></DIV></P><HR NOSHADE><A HREF="toc.html">Contents</A><A HREF="114Usingacanvasscale.html">Previous</A><A HREF="12AntiSpamChallenges.html">Next</A></BODY></HTML>