<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>digitalnetbizz's WebLog : MIL</title><link>http://blogs.msdn.com/digitalnetbizz/archive/tags/MIL/default.aspx</link><description>Tags: MIL</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Avalon DrawingContext ...</title><link>http://blogs.msdn.com/digitalnetbizz/archive/2004/06/11/avalon-drawingcontext.aspx</link><pubDate>Fri, 11 Jun 2004 07:11:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:153294</guid><dc:creator>digitalnetbizz</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/digitalnetbizz/comments/153294.aspx</comments><wfw:commentRss>http://blogs.msdn.com/digitalnetbizz/commentrss.aspx?PostID=153294</wfw:commentRss><description>&lt;P&gt;&lt;A href="http://longhorn.msdn.microsoft.com/lhsdk/ref/ns/system.windows.media/c/drawingcontext/drawingcontext.aspx"&gt;&lt;FONT face=Garamond size=5&gt;&lt;STRONG&gt;DrawingContext&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/A&gt;&amp;nbsp;&lt;FONT face=Garamond&gt;is Avalon's equivalent of hdc (handle to device context) in Win32 programming or &lt;A href="http://msdn.microsoft.com/library/en-us/gdicpp/GDIPlus/aboutGDIPlus/whatsnewinGDIPlus/changesintheprogrammingmodel.asp?frame=true"&gt;Graphics &lt;/A&gt;in GDI+. It provides us with low level calls to render/draw on the surface (screen/print/other visuals). &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Garamond&gt;Here's a list of useful draw method in DrawingContext:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&lt;EM&gt;1.&amp;nbsp; DrawDrawing&lt;BR&gt;2.&amp;nbsp; DrawEllipse&lt;BR&gt;3.&amp;nbsp; DrawGeometry&lt;BR&gt;4.&amp;nbsp; DrawGlyphs&lt;BR&gt;5.&amp;nbsp; DrawImage&lt;BR&gt;6.&amp;nbsp; DrawLine&lt;BR&gt;7.&amp;nbsp; DrawRectangle&lt;BR&gt;8.&amp;nbsp; DrawRoundedRectangle&lt;BR&gt;9.&amp;nbsp; DrawSubLineCollection&lt;BR&gt;10. DrawText&lt;BR&gt;11. DrawVideo&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Garamond&gt;Most of the time, DrawingContext will be used within &lt;FONT face="Courier New" color=#000080&gt;&lt;STRONG&gt;Render&lt;/STRONG&gt;(&lt;STRONG&gt;DrawingContext&lt;/STRONG&gt; &lt;FONT color=#ff0000&gt;dc&lt;/FONT&gt;).&lt;/FONT&gt; This is&amp;nbsp;a method&amp;nbsp;that custom control can override and do customize drawing. Render() will be invoked whenever the screen area is dirty. You can also imagine that certain controls like Image will make use of DrawImage, while Typography uses DrawGlyphs/DrawText and Border will use DrawRectangle. It's really up to your imagination to mix and match these capabilities to come out with something slick.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Garamond&gt;DrawVideo is definitely something fresh considering we are looking at the equivalent of HDC. IMO, this shows that Avalon is really making it easier and easier&amp;nbsp;for UI developer like me :).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Garamond&gt;Finally, Transform, Clip and Opacity&amp;nbsp;are also controllable from this class. What a powerful class!!!&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=153294" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/digitalnetbizz/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/digitalnetbizz/archive/tags/MIL/default.aspx">MIL</category></item></channel></rss>