<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>Debenu Quick PDF Library - PDF SDK Community Forum : How to draw hatches</title>
  <link>http://www.quickpdf.org/forum/</link>
  <description><![CDATA[This is an XML content feed of; Debenu Quick PDF Library - PDF SDK Community Forum : I need help - I can help : How to draw hatches]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 09 Jun 2026 09:45:01 +0000</pubDate>
  <lastBuildDate>Fri, 03 Feb 2012 20:18:11 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 11.01</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.quickpdf.org/forum/RSS_post_feed.asp?TID=2124</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Debenu Quick PDF Library - PDF SDK Community Forum]]></title>
   <url>http://www.quickpdf.org/forum/forum_images/QPDF_Forum_Title.png</url>
   <link>http://www.quickpdf.org/forum/</link>
  </image>
  <item>
   <title><![CDATA[How to draw hatches :   Hi,there is something more...]]></title>
   <link>http://www.quickpdf.org/forum/how-to-draw-hatches_topic2124_post9061.html#9061</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1569">edvoigt</a><br /><strong>Subject:</strong> 2124<br /><strong>Posted:</strong> 03 Feb 12 at 8:18PM<br /><br />Hi,<br><br>there is something more to say. Because hatch or not hatch is a question of orientation. <br><img src="http://www.edvoigt.de/extra/2012-02-03%2020h56_41.png" height="312" width="335" border="0" /><br>My first example shows a normal drawn box and for clipping a path consisting of a circle and a hatch-box in it. Here the source:<br><font face="Courier New, Courier, mono">&nbsp; QP.SetOrigin(0);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Bottomleft<br>&nbsp; QP.SetMeasurementUnits(1);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Millimeter<br>&nbsp; QP.SetPageDimensions(210, 297);<br><br>&nbsp; QP.SetLineWidth(0.1);<br>&nbsp; QP.SetLineColor(1, 0, 0);<br>&nbsp; QP.SetFillColor(1, 1, 0);<br>&nbsp; x0 := 25; x1 := 175;<br>&nbsp; y0 := 170; y1 := 270;<br>&nbsp; r := 70;<br>&nbsp; // 1. draw without clipping<br>&nbsp; QP.DrawBox(x0, y1, x1-x0, y1-y0, 1);<br>&nbsp; QP.DrawCircle((x0+x1)/2, y1-r, r, 0);<br><br>&nbsp; QP.SaveState; // for later use without clipping<br>&nbsp; // 2. define clipping path<br>&nbsp; QP.StartPath((x0+x1)/2, y1);<br>&nbsp; QP.AddArcToPath((x0+x1)/2, y1-r, 360);&nbsp; // the "normal" path for clipping<br>&nbsp; // 3. hatch-box-building<br>&nbsp; // hatch or not hatch is a question of orientation<br>&nbsp; QP.MovePath(x0+20, y0+75); // upper left corner<br>&nbsp; QP.AddLineToPath(x0+20, y0+50); // lower left<br>&nbsp; QP.AddLineToPath(x0+50, y0+50); // lower right<br>&nbsp; QP.AddLineToPath(x0+50, y0+75); // upper right<br>&nbsp; QP.AddLineToPath(x0+20, y0+75); // close hatch, important!<br>&nbsp; QP.SetClippingPath;<br>&nbsp; // 4. draw clipped things<br>&nbsp; // it will be drawn only inside the first circle and outside our hatchbox<br>&nbsp; QP.DrawBox(x0, y1, x1-x0, y1-y0, 0);<br>&nbsp; for i:=0 to 52 do QP.DrawLine(x1-i*5, y0, x1, y0+i*5);<br>&nbsp; QP.SetFillColor(0, 1, 0);<br>&nbsp; QP.DrawCircle(x0+50, y0+75, 10, 2);<br><br>&nbsp; QP.LoadState; // stop clipping from here<br><br>&nbsp; QP.SetLineColor(0, 0, 0);<br>&nbsp; QP.DrawLine(x0, y0, (x0+x1)/2, y1);<br></font><br>The second example is more interessting. Using four lines two triangles are builded, but only one of them becomes to be hatch.&nbsp; <br><br>That's so because of orientation during AddLineToPath-sequence.<br><img src="http://www.edvoigt.de/extra/2012-02-03%2020h58_22.png" height="250" width="153" border="0" /><br>Wandering from P1 over P2 to P3 upper triangle is ever on your right side. But the other Triangle is on the way from P3 over P4 to P1 on left side. Areas on right side are are parts of the path, but areas on left side dont't belong to path, they are hatches.<br><br>Source for this:<br><font face="Courier New, Courier, mono">&nbsp; x0 := 100; y1 := y0-50; y0 := 20;&nbsp; r := 30;<br>&nbsp; QP.SaveState; // for later use without clipping<br>&nbsp; QP.StartPath(x0-r-5, y1+5);<br>//first a box as clipping area<br>&nbsp; QP.AddLineToPath(x0+2*r, y1);<br>&nbsp; QP.AddLineToPath(x0+2*r, y0-1);<br>&nbsp; QP.AddLineToPath(x0-r, y0-1);<br>&nbsp; QP.AddLineToPath(x0-r, y1);<br>// and now a special kind of half hatch<br>&nbsp; QP.MovePath(x0, y1);<br>&nbsp; QP.AddLineToPath(x0+r, y1);<br>&nbsp; QP.AddLineToPath(x0-r, y0);<br>&nbsp; QP.AddLineToPath(x0+r, y0);<br>&nbsp; QP.AddLineToPath(x0, y1);<br>&nbsp; QP.SetClippingPath;<br>&nbsp; QP.DrawBox(x0-r, y1, 2*r, y1-y0, 1);<br>// show hatch construction<br>&nbsp; QP.SetLineColor(0, 0, 0);<br>&nbsp; QP.SetLineWidth(1.0);<br>&nbsp; QP.DrawLine(x0, y1, x0+r, y1); // show the contour <br>&nbsp; QP.DrawLine(x0+r, y1, x0-r, y0);<br>&nbsp; QP.DrawLine(x0-r, y0, x0+r, y0);<br>&nbsp; QP.DrawLine(x0+r, y0, x0, y1);<br><br>&nbsp; QP.LoadState; // stop clipping now again<br>&nbsp; QP.DrawText(x0, y1+2, 'P1');<br>&nbsp; QP.DrawText(x0+r, y1+2, 'P2');<br>&nbsp; QP.DrawText(x0-r, y0-5, 'P3');<br>&nbsp; QP.DrawText(x0+r, y0-5, 'P4');<br></font><br>Cheers,<br>Werner<br><span style="font-size:10px"><br /><br />Edited by edvoigt - 03 Feb 12 at 8:20PM</span>]]>
   </description>
   <pubDate>Fri, 03 Feb 2012 20:18:11 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/how-to-draw-hatches_topic2124_post9061.html#9061</guid>
  </item> 
  <item>
   <title><![CDATA[How to draw hatches : Thank you that worked for me very...]]></title>
   <link>http://www.quickpdf.org/forum/how-to-draw-hatches_topic2124_post9056.html#9056</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1833">kaiken1987</a><br /><strong>Subject:</strong> 2124<br /><strong>Posted:</strong> 02 Feb 12 at 1:58PM<br /><br />Thank you that worked for me very well.]]>
   </description>
   <pubDate>Thu, 02 Feb 2012 13:58:03 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/how-to-draw-hatches_topic2124_post9056.html#9056</guid>
  </item> 
  <item>
   <title><![CDATA[How to draw hatches : Here is some code to draw a hollow...]]></title>
   <link>http://www.quickpdf.org/forum/how-to-draw-hatches_topic2124_post9040.html#9040</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1483">AndrewC</a><br /><strong>Subject:</strong> 2124<br /><strong>Posted:</strong> 01 Feb 12 at 8:25AM<br /><br />Here is some code to draw a hollow star..<div><br></div><div><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">// Draw a hollow star</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.SetFillColor(1, 0, 0);</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.SetLineColor(0, 1, 0);</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.StartPath(100, 60);</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.AddLineToPath(306, 600);</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.AddLineToPath(512, 60);</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.AddLineToPath(20, 400);</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.AddLineToPath(592, 400);</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.ClosePath();</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.DrawPathEvenOdd(2);</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Draw a hollow donut</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.NewPage();</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.SetFillColor(1, 0, 0);</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.SetLineColor(0, 1, 0);</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.StartPath(100, 200);</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.AddArcToPath(200, 200, 360);</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.MovePath(150, 200);</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.AddArcToPath(200, 200, 360);</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.ClosePath();</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.DrawPathEvenOdd(2);</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "></div><div><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><br></span></div>]]>
   </description>
   <pubDate>Wed, 01 Feb 2012 08:25:39 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/how-to-draw-hatches_topic2124_post9040.html#9040</guid>
  </item> 
  <item>
   <title><![CDATA[How to draw hatches : I&amp;#039;m trying to find a way...]]></title>
   <link>http://www.quickpdf.org/forum/how-to-draw-hatches_topic2124_post9038.html#9038</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1833">kaiken1987</a><br /><strong>Subject:</strong> 2124<br /><strong>Posted:</strong> 31 Jan 12 at 2:56PM<br /><br />I'm trying to find a way to draw filled polygons with holes in them, something like the widows GDI polypolygon function. The only way I've been able to figure out is to call GetCanvasDC, RenderToDC, use the polypolygon function and then call LoadFromCanvasDC. That seems terribly slow and&nbsp;inefficient&nbsp;and I assume the must be a better way then that.]]>
   </description>
   <pubDate>Tue, 31 Jan 2012 14:56:59 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/how-to-draw-hatches_topic2124_post9038.html#9038</guid>
  </item> 
 </channel>
</rss>