<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2002-2-1 (1.71) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>4.14 Specifying area fill attributes</TITLE> <META NAME="description" CONTENT="4.14 Specifying area fill attributes"> <META NAME="keywords" CONTENT="GMT_Docs"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="GMT_Docs.css"> <LINK REL="next" HREF="node68.html"> <LINK REL="previous" HREF="node66.html"> <LINK REL="up" HREF="node31.html"> <LINK REL="next" HREF="node68.html"> </HEAD> <BODY bgcolor="#ffffff"> <!--Navigation Panel--> <A NAME="tex2html3498" HREF="node68.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html3492" HREF="node31.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html3486" HREF="node66.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html3494" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html3496" HREF="node256.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html3499" HREF="node68.html">4.15 Color palette tables</A> <B> Up:</B> <A NAME="tex2html3493" HREF="node31.html">4. General features</A> <B> Previous:</B> <A NAME="tex2html3487" HREF="node66.html">4.13 Specifying pen attributes</A> <B> <A NAME="tex2html3495" HREF="node1.html">Contents</A></B> <B> <A NAME="tex2html3497" HREF="node256.html">Index</A></B> <BR> <BR> <!--End of Navigation Panel--> <H1><A NAME="SECTION0012140000000000000000"> 4.14 Specifying area fill attributes</A> </H1> <P> <A NAME="18191"></A><A NAME="18192"></A><A NAME="18193"></A><A NAME="18194"></A><A NAME="18195"></A><A NAME="18196"></A><A NAME="18197"></A><A NAME="18722"></A> <A NAME="sec:fill"></A> <P> Many plotting programs will allow the user to draw filled polygons or symbols. The fill specification may take two forms: <P> <BR> <P> <B>-G</B><I>fill</I> <P> <B>-Gp</B><I>dpi/pattern</I>[:<B>B</B><I>color</I>[<B>F</B><I>color</I>]] <P> <BR> <DL> <DT><STRONG>fill:</STRONG></DT> <DD>In the first case we may specify a <I>gray</I> shade (0-255), RGB color (<I>r</I>/<I>g</I>/<I>b</I> all in the 0-255 range or in hexadecimal <I>#rrggbb</I>), HSV color (<I>hue</I>-<I>saturation</I>-<I>value</I> in the 0-360, 0-1, 0-1 range), CMYK color (<I>cyan</I>/<I>magenta</I>/<I>yellow</I>/<I>black</I>, each ranging from 0-100%), or a valid color <I>name</I>; in that respect it is similar to specifying the pen color settings (see pen color discussion under Section <A HREF="node66.html#sec:pen">4.13</A>). </DD> <DT><STRONG>pattern:</STRONG></DT> <DD>The second form allows us to use a predefined bit-image pattern. <I>pattern</I> can either be a number in the range 1-90 or the name of a 1-, 8-, or 24-bit Sun raster file. The former will result in one of the 90 predefined 64 x 64 bit-patterns provided with <A NAME="tex2html1175" HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> and reproduced in Appendix <A HREF="node200.html#app:E">E</A>. The latter allows the user to create customized, repeating images using standard Sun raster files<A NAME="tex2html1173" HREF="footnode.html#foot18723"><SUP>4.11</SUP></A>. The <I>dpi</I> parameter sets the resolution of this image on the page; the area fill is thus made up of a series of these ``tiles''. Specifying <I>dpi</I> as 0 will result in highest resolution obtainable given the present dpi setting in <U>.gmtdefaults4</U>. By specifying upper case <B>-GP</B> instead of <B>-Gp</B> the image will be bit-reversed, i.e., white and black areas will be interchanged (only applies to 1-bit images or predefined bit-image patterns). For these patterns and other 1-bit images one may specify alternative background and foreground colors (by appending :<B>B</B><I>color</I>[<B>F</B><I>color</I>]) that will replace the default white and black pixels, respectively. Setting one of the fore- or background colors to - yields a <I>transparent</I> image where only the back- <I>or</I> foreground pixels will be painted. </DD> </DL> <P> Due to <I>PostScript</I> implementation limitations the raster images used with <B>-G</B> must be less than 146 x 146 pixels in size; for larger images see <A NAME="tex2html1176" HREF="../man/psimage.html"><I><B>psimage</B></I></A><A NAME="19408"></A>. The format of Sun raster files is outlined in Appendix <A HREF="node173.html#app:B">B</A>. Note that under <I>PostScript</I> Level 1 the patterns are filled by using the polygon as a <I>clip path</I>. Complex clip paths may require more memory than the <I>PostScript</I> interpreter has been assigned. There is therefore the possibility that some <I>PostScript</I> interpreters (especially those supplied with older laserwriters) will run out of memory and abort. Should that occur we recommend that you use a regular grayshade fill instead of the patterns. Installing more memory in your printer <I>may or may not</I> solve the problem! <P> Table <A HREF="#tbl:fillex">4.6</A> contains a few examples of fill specifications. <P> <BR><P></P> <DIV ALIGN="CENTER"><A NAME="18266"></A> <TABLE> <CAPTION><STRONG>Table 4.6:</STRONG> A few examples of fill specifications.</CAPTION> <TR><TD> <DIV ALIGN="CENTER"><TABLE CELLPADDING=3 BORDER="1"> <TR><TD ALIGN="CENTER" COLSPAN=1><I>Fill example</I></TD> <TD ALIGN="CENTER" COLSPAN=1><I>Comment</I></TD> </TR> <TR><TH ALIGN="LEFT"><B>-G</B>128</TH> <TD ALIGN="LEFT">Solid gray</TD> </TR> <TR><TH ALIGN="LEFT"><B>-G</B>127/255/0</TH> <TD ALIGN="LEFT">Chartreuse, R/G/B-style</TD> </TR> <TR><TH ALIGN="LEFT"><B>-G</B>#00ff00</TH> <TD ALIGN="LEFT">Green, hexadecimal RGB code</TD> </TR> <TR><TH ALIGN="LEFT"><B>-G</B>25-0.86-0.82</TH> <TD ALIGN="LEFT">Chocolate, h-s-v - style</TD> </TR> <TR><TH ALIGN="LEFT"><B>-G</B>DarkOliveGreen1</TH> <TD ALIGN="LEFT">One of the named colors</TD> </TR> <TR><TH ALIGN="LEFT"><B>-Gp</B>300/7</TH> <TD ALIGN="LEFT">Simple diagonal hachure pattern in b/w at 300 dpi</TD> </TR> <TR><TH ALIGN="LEFT"><B>-Gp</B>300/7:Bred</TH> <TD ALIGN="LEFT">Same, but with red lines on white</TD> </TR> <TR><TH ALIGN="LEFT"><B>-Gp</B>300/7:BredF-</TH> <TD ALIGN="LEFT">Now the gaps between red lines are transparent</TD> </TR> <TR><TH ALIGN="LEFT"><B>-Gp</B>100/marble.ras</TH> <TD ALIGN="LEFT">Using user image of marble as the fill at 100 dpi</TD> </TR> </TABLE> <A NAME="tbl:fillex"></A></DIV></TD></TR> </TABLE> </DIV><P></P> <BR> <P> <HR> <!--Navigation Panel--> <A NAME="tex2html3498" HREF="node68.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html3492" HREF="node31.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html3486" HREF="node66.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html3494" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html3496" HREF="node256.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html3499" HREF="node68.html">4.15 Color palette tables</A> <B> Up:</B> <A NAME="tex2html3493" HREF="node31.html">4. General features</A> <B> Previous:</B> <A NAME="tex2html3487" HREF="node66.html">4.13 Specifying pen attributes</A> <B> <A NAME="tex2html3495" HREF="node1.html">Contents</A></B> <B> <A NAME="tex2html3497" HREF="node256.html">Index</A></B> <!--End of Navigation Panel--> <ADDRESS> Paul Wessel 2010-07-14 </ADDRESS> </BODY> </HTML>