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="921Timingthegenerationofgraphs.html"><LINK REL="Next" HREF="923Addingiconsontothegraph.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="921Timingthegenerationofgraphs.html">Previous</A><A HREF="923Addingiconsontothegraph.html">Next</A><HR NOSHADE><H2><A NAME="9_22">9.22 Using country flags in various context</A></H2><P> JpGraph has built-in support for over 200 country flags, i.e. theyare available to be used in graphs without any external imagedefinitions.</P><P> Country flags can be used in primarily two settings</P><OL><LI> As image markers in line and scatter graphs</LI><LI> As background images for graphs</LI><LI> As a special type of icons (using the IconPlot()) which can beadded to the graph in any arbitrary position. See next section</LI></OL><P> In order to make it easy to find the appropriate country flags theycan be specified with either full or partial name or as an numericindex. The routines in JpGraph are "smart" enough to figure out whichway you are trying to specify a particular flag.</P><P> To specify a country flag as a marker you have to specify thespecial mark type as one of MARK_FLAG1,MARK_FLAG2,MARK_FLAG3 orMARK_FLAG4</P><P> Flags are internally stored in 4 different sizes which is indicatedby the number in the mark types. Flags may also be arbitrary scaledwhen displayed. Since this is partially overlapping functionality youmight very well ask why the flags are stored in four different basicsizes. The reason is of course performance. It you only want a verysmall flag it takes processing time to scale down a large image to,say, a small icon size. At the same time for large flags to be used asbackground a small original flag might not have enough details to bescaled up to a large size. Hence the reason for storing the flags in 4different sizes.</P><P> The example below shows how to use country flags as markers<DIV class="example"><BR> <A href="exframes/frame_markflagex1.html" target="blank"><IMG border="0"HEIGHT="200" src="img/img/img/img/img/img/markflagex1.png" WIDTH="300"></A><BR><B>Figure 183:</B> Using country flags as line plot markers <A href="exframes/frame_markflagex1.html"target="blank">[src]</A> <P></P></DIV></P><P> To use country flags as background one has to use the methodGraph::SetBackgroundCountryFlag(). With this method you can specifyboth how much of the image should be filled as well as how much of theflag should be mixed into the background.</P><P> To see a list of all supported country flags you can run the script"listallcountryflags.php" in the Example directory. This will show youa table with all flags.</P><HR NOSHADE><A HREF="toc.html">Contents</A><A HREF="921Timingthegenerationofgraphs.html">Previous</A><A HREF="923Addingiconsontothegraph.html">Next</A></BODY></HTML>