<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 - Entries tagged with Media</title>
    <atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Tags/media/RSS"></atom:link>
    <itunes:summary></itunes:summary>
    <itunes:author>Microsoft</itunes:author>
    <itunes:subtitle></itunes:subtitle>
    <image>
      <url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
      <title>Channel 9 - Entries tagged with Media</title>
      <link>http://channel9.msdn.com/Tags/media</link>
    </image>
    <itunes:image href=""></itunes:image>
    <itunes:category text="Technology"></itunes:category>
    <description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
    <link>http://channel9.msdn.com/Tags/media</link>
    <language>en</language>
    <pubDate>Sat, 25 May 2013 22:39:22 GMT</pubDate>
    <lastBuildDate>Sat, 25 May 2013 22:39:22 GMT</lastBuildDate>
    <generator>Rev9</generator>
    <c9:totalResults>46</c9:totalResults>
    <c9:pageCount>2</c9:pageCount>
    <c9:pageSize>25</c9:pageSize>
  <item>
      <title>The FoxFast Windows 8 App</title>
      <description><![CDATA[<p>Twentieth Century Fox Television Distribution licenses TV shows and movies to broadcasters around the world.&nbsp; In 30 days, a team of Silverlight and .NET developers at Fox built an app for Windows 8 and published it to the Windows Store.&nbsp; The <a href="http://apps.microsoft.com/webpdp/app/b8b8218c-b0b3-4aca-bce9-449a6007e908" target="_blank">FoxFast app for Windows 8</a> is for their worldwide&nbsp;broadcast partners to find, learn about, securely screen, and pick marketing assets to use to promote their shows.&nbsp; Take a look at this video about the app that they created to share their excitement with their broadcast partners.</p><p>If you are a fan of Twentieth Century Fox shows or movies, you should check out the <a href="http://apps.microsoft.com/webpdp/app/ae8b012f-7354-4d75-bb31-80cd181c2923" target="_blank">Fox Now</a> and <a href="http://apps.microsoft.com/webpdp/app/0decf0d6-9d2d-4cd7-ad5f-b614876e867b" target="_blank">FX Networks</a> Windows 8 Apps in the Windows Store today.</p><p>Because this video contains copyright material, it is not available for download.</p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:7de0e6245d3a41ea9e82a0f5007203ee">]]></description>
      <comments>http://channel9.msdn.com/Shows/Communicating/FoxFast8</comments>
      <itunes:summary>Twentieth Century Fox Television Distribution licenses TV shows and movies to broadcasters around the world.&amp;nbsp; In 30 days, a team of Silverlight and .NET developers at Fox built an app for Windows 8 and published it to the Windows Store.&amp;nbsp; The FoxFast app for Windows 8 is for their worldwide&amp;nbsp;broadcast partners to find, learn about, securely screen, and pick marketing assets to use to promote their shows.&amp;nbsp; Take a look at this video about the app that they created to share their excitement with their broadcast partners. If you are a fan of Twentieth Century Fox shows or movies, you should check out the Fox Now and FX Networks Windows 8 Apps in the Windows Store today. Because this video contains copyright material, it is not available for download. </itunes:summary>
      <itunes:duration>70</itunes:duration>
      <link>http://channel9.msdn.com/Shows/Communicating/FoxFast8</link>
      <pubDate>Tue, 30 Oct 2012 05:00:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Shows/Communicating/FoxFast8</guid>
      <media:thumbnail url="http://media.ch9.ms/ch9/f797/170624fe-1a33-4935-ab6f-6f4c3e78f797/FoxFast8_100.jpg" height="56" width="100"></media:thumbnail>
      <media:thumbnail url="http://media.ch9.ms/ch9/f797/170624fe-1a33-4935-ab6f-6f4c3e78f797/FoxFast8_220.jpg" height="123" width="220"></media:thumbnail>
      <media:thumbnail url="http://media.ch9.ms/ch9/f797/170624fe-1a33-4935-ab6f-6f4c3e78f797/FoxFast8_512.jpg" height="288" width="512"></media:thumbnail>
      <media:group>
        <media:content url="http://smooth.ch9.ms/ch9/f797/170624fe-1a33-4935-ab6f-6f4c3e78f797/FoxFast8.ism/manifest" expression="full" duration="70" fileSize="8566" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <dc:creator>Michael S. Scherotter</dc:creator>
      <itunes:author>Michael S. Scherotter</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Shows/Communicating/FoxFast8/RSS</wfw:commentRss>
      <category>Media</category>
      <category>Windows 8</category>
    </item>
  <item>
      <title>Building a rich and extensible Media Platform</title>
      <description><![CDATA[<p>Engaging with rich media—whether watching a movie, video chatting, or playing music—is one of the most prevalent and enjoyable things we do on our PCs today. <a href="http://blogs.msdn.com/b/b8/archive/2012/06/08/building-a-rich-and-extensible-media-platform.aspx">http://blogs.msdn.com/b/b8/archive/2012/06/08/building-a-rich-and-extensible-media-platform.aspx</a></p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:7938cce818a94b399b54a067013b5512">]]></description>
      <comments>http://channel9.msdn.com/posts/Building-a-rich-and-extensible-Media-Platform</comments>
      <itunes:summary>Engaging with rich media—whether watching a movie, video chatting, or playing music—is one of the most prevalent and enjoyable things we do on our PCs today. http://blogs.msdn.com/b/b8/archive/2012/06/08/building-a-rich-and-extensible-media-platform.aspx </itunes:summary>
      <itunes:duration>485</itunes:duration>
      <link>http://channel9.msdn.com/posts/Building-a-rich-and-extensible-Media-Platform</link>
      <pubDate>Thu, 21 Jun 2012 21:09:26 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/posts/Building-a-rich-and-extensible-Media-Platform</guid>
      <media:thumbnail url="http://media.ch9.ms/ch9/4910/6a26d0ae-bd95-4bad-9d05-82e465b94910/BuildingarichandextensibleMediaPlaformNew_100.jpg" height="56" width="100"></media:thumbnail>
      <media:thumbnail url="http://media.ch9.ms/ch9/4910/6a26d0ae-bd95-4bad-9d05-82e465b94910/BuildingarichandextensibleMediaPlaformNew_220.jpg" height="123" width="220"></media:thumbnail>
      <media:thumbnail url="http://media.ch9.ms/ch9/4910/6a26d0ae-bd95-4bad-9d05-82e465b94910/BuildingarichandextensibleMediaPlaformNew_512.jpg" height="288" width="512"></media:thumbnail>
      <media:group>
        <media:content url="http://media.ch9.ms/ch9/4910/6a26d0ae-bd95-4bad-9d05-82e465b94910/BuildingarichandextensibleMediaPlaformNew.mp3" expression="full" duration="485" fileSize="7774215" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://media.ch9.ms/ch9/4910/6a26d0ae-bd95-4bad-9d05-82e465b94910/BuildingarichandextensibleMediaPlaformNew.mp4" expression="full" duration="485" fileSize="45613632" type="video/mp4" medium="video"></media:content>
        <media:content url="http://media.ch9.ms/ch9/4910/6a26d0ae-bd95-4bad-9d05-82e465b94910/BuildingarichandextensibleMediaPlaformNew.webm" expression="full" duration="485" fileSize="18595556" type="video/webm" medium="video"></media:content>
        <media:content url="http://media.ch9.ms/ch9/4910/6a26d0ae-bd95-4bad-9d05-82e465b94910/BuildingarichandextensibleMediaPlaformNew.wma" expression="full" duration="485" fileSize="3934263" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://media.ch9.ms/ch9/4910/6a26d0ae-bd95-4bad-9d05-82e465b94910/BuildingarichandextensibleMediaPlaformNew.wmv" expression="full" duration="485" fileSize="72152395" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://media.ch9.ms/ch9/4910/6a26d0ae-bd95-4bad-9d05-82e465b94910/BuildingarichandextensibleMediaPlaformNew_high.mp4" expression="full" duration="485" fileSize="101104815" type="video/mp4" medium="video"></media:content>
        <media:content url="http://media.ch9.ms/ch9/4910/6a26d0ae-bd95-4bad-9d05-82e465b94910/BuildingarichandextensibleMediaPlaformNew_mid.mp4" expression="full" duration="485" fileSize="70254486" type="video/mp4" medium="video"></media:content>
        <media:content url="http://media.ch9.ms/ch9/4910/6a26d0ae-bd95-4bad-9d05-82e465b94910/BuildingarichandextensibleMediaPlaformNew_Source.wmv" expression="full" duration="485" fileSize="214408470" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://smooth.ch9.ms/ch9/4910/6a26d0ae-bd95-4bad-9d05-82e465b94910/BuildingarichandextensibleMediaPlaformNew.ism/manifest" expression="full" duration="485" fileSize="8894" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://media.ch9.ms/ch9/4910/6a26d0ae-bd95-4bad-9d05-82e465b94910/BuildingarichandextensibleMediaPlaformNew.wmv" length="72152395" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Roxanne Beaver</dc:creator>
      <itunes:author>Roxanne Beaver</itunes:author>
      <slash:comments>2</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/posts/Building-a-rich-and-extensible-Media-Platform/rss</wfw:commentRss>
      <category>Media</category>
      <category>Music</category>
      <category>Movies</category>
      <category>Windows 8</category>
    </item>
  <item>
      <title>Settling Down to a Movie? It Must Be Popcorn Hour!</title>
      <description><![CDATA[ <p>Is 2010 the year of the media streamer? Certainly the category has had more than its fair share of headlines this year, with the likes of the Boxee Box and others thrilling the tech community. One of the products that gets a lot of buzz amongst digital media enthusiasts is <a href="http://www.popcornhour.com/">Popcorn Hour</a>.</p><p>Their latest streamer, the <a href="http://www.popcornhour.com/onlinestore/index.php?pluginoption=catalog&amp;mainItemId=24">A-210</a> is due for release next week, and I’ve been lucky enough to get hold of a review unit a little ahead of time. Like other products in the range, the A-210 boasts an insane level of support for a heap of audio, video and photo file formats – throw what you like at it, and chances are it’ll gobble up the file and stream out your desired entertainment, no questions asked.</p><p>The really cool think about this new model is that it takes a look at your music and video files, and as long as you have a wired or wireless internet connection, the Popcorn Hour will go and hunt out cover artwork and other metadata for movies including cast and crew information, ratings, synopses and more.</p><p>It’s all displayed in a stunning new user interface which allows you to browse your media collection by cover, file or category – sweet! Dig down into the menu and you’ll find a host of online services supported, including SHOUTcast Radio, BBC Podcasts, Flickr, ABC News, CNN and a whole lot more.</p><p>If you’re looking for a streamer during the holidays, make sure you check out the new Popcorn Hour alongside other streamers.</p><p>&nbsp;</p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:2d81a175586946b29a8f9e390138c0e1">]]></description>
      <comments>http://channel9.msdn.com/Blogs/coolstuff/Settling-Down-to-a-Movie-It-Must-Be-Popcorn-Hour</comments>
      <itunes:summary> Is 2010 the year of the media streamer? Certainly the category has had more than its fair share of headlines this year, with the likes of the Boxee Box and others thrilling the tech community. One of the products that gets a lot of buzz amongst digital media enthusiasts is Popcorn Hour. Their latest streamer, the A-210 is due for release next week, and I’ve been lucky enough to get hold of a review unit a little ahead of time. Like other products in the range, the A-210 boasts an insane level of support for a heap of audio, video and photo file formats – throw what you like at it, and chances are it’ll gobble up the file and stream out your desired entertainment, no questions asked. The really cool think about this new model is that it takes a look at your music and video files, and as long as you have a wired or wireless internet connection, the Popcorn Hour will go and hunt out cover artwork and other metadata for movies including cast and crew information, ratings, synopses and more. It’s all displayed in a stunning new user interface which allows you to browse your media collection by cover, file or category – sweet! Dig down into the menu and you’ll find a host of online services supported, including SHOUTcast Radio, BBC Podcasts, Flickr, ABC News, CNN and a whole lot more. If you’re looking for a streamer during the holidays, make sure you check out the new Popcorn Hour alongside other streamers. &amp;nbsp; </itunes:summary>
      <link>http://channel9.msdn.com/Blogs/coolstuff/Settling-Down-to-a-Movie-It-Must-Be-Popcorn-Hour</link>
      <pubDate>Thu, 25 Nov 2010 18:59:52 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/coolstuff/Settling-Down-to-a-Movie-It-Must-Be-Popcorn-Hour</guid>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/234a12d2-73a4-4a6d-9fe1-20762fb6a3c9.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/a7253773-3609-4663-afa0-8bf1120360ba.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/21e2ced9-832c-46a1-be41-f8b71c3fd82d.jpg" height="240" width="320"></media:thumbnail>      
      <dc:creator>Terry Walsh</dc:creator>
      <itunes:author>Terry Walsh</itunes:author>
      <slash:comments>2</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/coolstuff/Settling-Down-to-a-Movie-It-Must-Be-Popcorn-Hour/RSS</wfw:commentRss>
      <category>Media</category>
      <category>Streaming</category>
      <category>Streaming Media</category>
    </item>
  <item>
      <title>SilverShader – Introduction to Silverlight and WPF Pixel Shaders</title>
      <description><![CDATA[
<p>This article explains how to write pixel shaders for the Microsoft Silverlight and WPF platform with HLSL, as well as how to write an extensible Silverlight application for shader demos.

</p>
<h3>Introduction</h3>
<p>Almost 10 years ago, <a href="http://www.microsoft.com/Presspass/press/2000/nov00/directxlaunchpr.mspx">
Microsoft announced DirectX 8.0</a>, including the huge real-time computer graphics milestone, Direct3D 8.0. Direct3D 8.0 introduced programmable
<a href="http://en.wikipedia.org/wiki/Shader_(computer_science)">shaders</a> and gave the developers a chance to create never-before-seen effects and experiences apart from the fixed-function graphics pipeline. With Direct3D 8.0's new shader capabilities, it
 became possible to compute neat custom-rendering effects on mainstream graphics hardware. Today's graphics hardware is capable of running hundreds of shaders in parallel and modern games make heavy use of this technology t to achieve stunning effects.
</p>
<p>A shader is a rather small program, a so-called kernel function, typically executed in parallel for each data element.
<a href="http://en.wikipedia.org/wiki/Pixel_shader">Pixel shaders</a>, for example, are executed for each pixel of a bitmap, and therefore used to implement per-pixel effects.
</p>
<p>This introductory article will explain how to write pixel shaders for Silverlight and WPF, what tools should be used, and how to work with the tools. Furthermore, it will show how to build an extensible Silverlight shader application.</p>
<h3>Demo Application</h3>
<p>The demo application makes it possible to apply different shaders to an image or to the live stream from the webcam. The application not only comes with the two shaders that will be implemented in this article, it also contains three other shaders I've written
 before. The complete source code is licensed under the <a href="http://www.opensource.org/licenses/ms-pl.html">
Ms-PL</a> and can be downloaded from the <a href="http://silvershader.codeplex.com">
CodePlex site</a>.</p>
<p>You need at least the Silverlight 4 runtime installed to run the sample and a webcam is needed in order to exploit the full functionality. The runtime is available for
<a href="http://go.microsoft.com/fwlink/?LinkID=149156">Windows</a> and <a href="http://go.microsoft.com/fwlink/?LinkId=107365">
Mac</a>. </p>
<p><a href="http://dl.dropbox.com/u/2681028/CodeplexData/SilverShader/Sample/SilverShaderTestPage.html">Open the sample</a></p>
<p align="center"><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/5428.clip_5F00_image002_5F00_3589A3B6.jpg"><strong><img title="clip_image002" border="0" alt="clip_image002" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/5444.clip_5F00_image002_5F00_thumb_5F00_5DF85FFD.jpg" width="500" height="526"></strong></a></p>
<p align="center"><strong>Figure 1: Screenshot of the demo application</strong></p>
<h4>How To Use?</h4>
<p>You can start and stop the webcam with the <a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/6014.clip_5F00_image004_5F00_7B8A3AFC.gif">
<img title="clip_image004" border="0" alt="clip_image004" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/5037.clip_5F00_image004_5F00_thumb_5F00_467DABCC.gif" width="21" height="21"></a>
 Button, or you can load an image from disk with the <a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/2311.clip_5F00_image006_5F00_023D4480.gif">
<img title="clip_image006" border="0" alt="clip_image006" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/8662.clip_5F00_image006_5F00_thumb_5F00_3AE7EE8D.gif" width="20" height="20"></a>
 Button. Use the ComboBox to change the pixel shader that is applied to the source. Each shader has its own controls to change the used parameters. The controls should be pretty much self-explaining. Just try them out.
</p>
<p>When you click the <a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/3465.clip_5F00_image007_5F00_4CC4825A.gif">
<img title="clip_image007" border="0" alt="clip_image007" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/4035.clip_5F00_image007_5F00_thumb_5F00_217FEB53.gif" width="20" height="20"></a>
 Button for the first time, you'll need to give permission for the capturing. This application uses the default Silverlight capture device. You can specify default video and audio devices with the Silverlight Configuration. Just press the right mouse button
 over the application, click &quot;Silverlight&quot; in the context menu, and select the &quot;Webcam / Mic&quot; tab to set them.</p>
<h3>Where do start?</h3>
<h4>What do we have in Silverlight and WPF? </h4>
<p>Pixel shaders were introduced with WPF 3.5 SP1, and later with Silverlight 3, as so-called
<a href="http://msdn.microsoft.com/en-us/library/system.windows.media.effects.shadereffect.aspx">
ShaderEffects</a>. <a href="http://msdn.microsoft.com/en-us/library/system.windows.media.effects.shadereffect.aspx">
ShaderEffects</a> can be applied to any control to create both nice visual effects and new user experiences. WPF 3.5 SP1 and Silverlight support the
<a href="http://msdn.microsoft.com/en-us/library/bb219843%28v=VS.85%29.aspx">Shader Model 2</a>, which is limited to a total of 96 instructions (64 arithmetic and 32 texture instructions). Modern DirectX 11 graphics cards already support
<a href="http://msdn.microsoft.com/en-us/library/ff471356(v=VS.85).aspx">Shader Model 5</a>, which doesn't have such limits. Silverlight pixel shaders, however, are executed on the
<a href="http://en.wikipedia.org/wiki/Central_processing_unit">CPU</a> and not on the specialized
<a href="http://en.wikipedia.org/wiki/Graphics_processing_unit">GPU</a>. Since the software rendering pipelines make use of modern CPU capabilities like
<a href="http://en.wikipedia.org/wiki/Streaming_SIMD_Extensions">SSE</a> and multi-core execution, they still
<a href="http://kodierer.blogspot.com/2009/08/silverlight-3-writeablebitmap.html">
run pretty fast and are the right way to implement effects</a> in Silverlight. </p>
<p>WPF renders the shaders slightly different. If the shader is applied to an element which is rendered on the graphics card, the shader will also be executed on the GPU. But if the element is being rendered for printing, certain
<a href="http://msdn.microsoft.com/en-us/library/system.windows.media.tilebrush.aspx">
TileBrushs</a> are used or any other reason <a href="http://msdn.microsoft.com/en-us/library/ms742196.aspx">
prevents hardware acceleration</a>, the element and the shader will be rendered in software. This rendering is done on WPF's render thread and the software shader unit also uses fast SSE instructions like Silverlight's renderer, but does not take advantage
 of multiple CPU cores.</p>
<p>WPF 4 supports <a href="http://msdn.microsoft.com/en-us/library/bb509656(v=VS.85).aspx">
Shader Model 3</a> with a much <a href="http://msdn.microsoft.com/en-us/library/bb219845(v=VS.85).aspx">
higher instruction count limit</a> and these pixel shaders are only executed on the GPU. Due to the more complex computation there's no software rendering fallback. The shader will simply be ignored if it's applied to an element being rendered in software or
 the graphics hardware doesn't support Shader Model 3.</p>
<p>This article targets Silverlight and WPF and therefore stays within the bounds of the
<a href="http://msdn.microsoft.com/en-us/library/bb219843%28v=VS.85%29.aspx">Shader Model 2</a>.</p>
<p></p>
<p></p>
<p></p>
<h4>How to program shaders?</h4>
<p>There are several ways to write and compile shader programs. Nowadays, the most common method used in the
<a href="http://en.wikipedia.org/wiki/Direct3D">Direct3D</a> and Windows world is a language called High Level Shading Language (<a href="http://en.wikipedia.org/wiki/High_Level_Shader_Language">HLSL</a>). The Direct3D shader compiler
<a href="http://msdn.microsoft.com/en-us/library/bb232919(VS.85).aspx">fxc.exe</a> compiles the HLSL code into byte-code, which is then executed by the runtime.
</p>
<p>HLSL is a C-style language with some special data types and intrinsic functions, but without pointers. If you know how to write code in a C-style language like C#, you will quickly learn how to write a shader with HLSL. By the way, if you know HLSL, you
 also know NVIDIA's shading language <a href="http://en.wikipedia.org/wiki/Cg_(programming_language)">
Cg</a>. Cg and HLSL have the same root and are very similar.</p>
<p>HLSL defines scalar and various vector / matrix <a href="http://msdn.microsoft.com/en-us/library/bb509587(v=VS.85).aspx">
data types</a> for integer and floating point operations. The <a href="http://msdn.microsoft.com/en-us/library/ff471376(v=VS.85).aspx">
built-in intrinsic functions</a> support scalar and vector data types. <a href="http://msdn.microsoft.com/en-us/library/bb509600(v=VS.85).aspx">
Flow-control statements</a>—such as if, switch, for, and while—are also possible. Of course, the curly brace is used for code blocks and most of the C
<a href="http://msdn.microsoft.com/en-us/library/bb509631(v=VS.85).aspx">operators</a> are also supported. The compiler uses
<a href="http://msdn.microsoft.com/en-us/library/bb509647(v=VS.85).aspx#PS">semantics</a> to both determine the intended usage of a parameter and provide the right data for it. The
<a href="http://msdn.microsoft.com/en-us/library/dd607359(v=VS.85).aspx">register</a> keyword is typically used to pass a parameter into the shader program. The elements of the vector types can be accessed through various aliases, such as x, y, z, w; r, g,
 b, a; u, v; etc. It's also possible to combine these and write nice and short statements by using swizzling:</p>
<p><b>HLSL <br>
</b></p>
<pre class="csharpcode"><span class="rem">// Create 3D float vector a and b with different syntax</span>
float3 a = float3(1, 2, 3);
float3 b = {5, 6, 7};

<span class="rem">// Calculate cross product of vector a and b using swizzling</span>
float3 crossProduct = a.yzx * b.zxy - a.zxy * b.yzx;</pre>
<style type="text/css">
<!--
.csharpcode, .csharpcode 
	{font-size:small;
	color:black;
	font-family:consolas,"Courier New",courier,monospace;
	background-color:#ffffff}
.csharpcode 
	{margin:0em}
.csharpcode .rem
	{color:#008000}
.csharpcode .kwrd
	{color:#0000ff}
.csharpcode .str
	{color:#006080}
.csharpcode .op
	{color:#0000c0}
.csharpcode .preproc
	{color:#cc6633}
.csharpcode .asp
	{background-color:#ffff00}
.csharpcode .html
	{color:#800000}
.csharpcode .attr
	{color:#ff0000}
.csharpcode .alt
	{background-color:#f4f4f4;
	width:100%;
	margin:0em}
.csharpcode .lnum
	{color:#606060}
-->
</style>
<p>The <a href="http://msdn.microsoft.com/en-us/library/bb509638(v=VS.85).aspx">MSDN</a> is a great resource for HLSL and provides detailed explanations of the syntax and functions. The following examples will make it clearer and the explanations should help
 to get you started.</p>
<h4>What tools to use?</h4>
<p>Of course, it's possible to write a pixel shader with a simple text editor and compile it with the command line tool
<a href="http://msdn.microsoft.com/en-us/library/bb232919(VS.85).aspx">fxc.exe</a>, but there's a great tool available that makes the process a lot easier. The
<a href="http://shazzam-tool.com/">Shazzam Tool</a> by <a href="http://blog.waltritscher.com">
Walt Ritscher</a> is THE utility for Silverlight and WPF shader development. It comes with an HLSL editor, which includes syntax highlighting, that compiles the shader and applies it right away to a sample input. It also generates controls for each parameter,
 which may be used to change the shader settings on the fly, and it creates the needed C# or VB source code file with a class that is derived from
<a href="http://msdn.microsoft.com/en-us/library/system.windows.media.effects.shadereffect.aspx">
ShaderEffect</a>. </p>
<p>Here's what you need to get started:</p>
<ol>
<li><a href="http://msdn.microsoft.com/en-us/directx/aa937788.aspx">Download the DirectX SDK</a> and install it.
</li><li><a href="http://shazzam-tool.com/publish.htm">Download the Shazzam Tool</a> and install it.
</li><li>After the Shazzam Tool is started, verify that the path to the <i>DirectX FX compiler</i> is set (Figure 2). The fxc.exe is normally located in the DirectX SDK installation folder under Utilities\bin\x86. Also make sure the right
<i>Target framework</i> is selected and a <i>Generated namespace</i> is set. </li><li>To see if everything works, open a <i>Sample Shader</i> with the <i>Shader Loader</i>, select a sample tab page, and try the controls on the
<i>Change Shader Settings</i> page (Figure 3). </li></ol>
<p align="center"><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/5037.clip_5F00_image009_5F00_6C735C22.jpg"><strong><img title="clip_image009" border="0" alt="clip_image009" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/3872.clip_5F00_image009_5F00_thumb_5F00_32F04C2B.jpg" width="271" height="536"></strong></a></p>
<p align="center"><strong>Figure 2: Shazzam Tool Settings</strong></p>
<p align="center"><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/5543.clip_5F00_image011_5F00_796D3C33.jpg"><strong><img title="clip_image011" border="0" alt="clip_image011" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/1323.clip_5F00_image011_5F00_thumb_5F00_1124739A.jpg" width="500" height="429"></strong></a></p>
<p align="center"><strong>Figure 3: Shazzam Tool Overview</strong></p>
<h3>How to write a pixel shader?</h3>
<p>Now that we have the right tools installed and configured, we are ready to write the first pixel shader and the Silverlight application that will use it.</p>
<h4>Example 1: The Tint Shader</h4>
<p>The first pixel shader we're writing is a rather simple tint shader that converts the pixel into gray and tints it with a parameterized color.</p>
<p>In the Shazzam Tool, select <i>File </i>à<i> New Shader File</i>,<i> </i>choose a location for the HLSL FX file, and name it TintShader. Shazzam will automatically create the basic pixel shader code, including a
<b>float</b> parameter SampleI. Hit the F5 key to compile and apply the shader to the selected sample image.</p>
<p><b>HLSL <br>
</b></p>
<pre class="csharpcode">sampler2D input : register(s0);

<span class="rem">/// &lt;summary&gt;Explain the purpose of this variable.&lt;/summary&gt;</span>
<span class="rem">/// &lt;minValue&gt;05/minValue&gt;</span>
<span class="rem">/// &lt;maxValue&gt;10&lt;/maxValue&gt;</span>
<span class="rem">/// &lt;defaultValue&gt;3.5&lt;/defaultValue&gt;</span>
<span class="kwrd">float</span> SampleI : register(C0);

float4 main(float2 uv : TEXCOORD) : COLOR 
{
    float4 Color; 
    Color = tex2D(input, uv.xy);
    <span class="kwrd">return</span> Color; 
}</pre>
<p>The input register is the actual bitmap / texture that holds the pixels and is sampled inside the pixel shader. This pixel shader
<b>main</b> function is the entry point and is executed for each pixel of the input bitmap. The coordinate of the current pixel that is processed is passed as the<b> float2</b> parameter uv. This coordinate is normalized to the range [0, 1]. The color of the
 pixel at the passed uv coordinate is sampled as <b>float4 </b>with the built-in <a href="http://msdn.microsoft.com/en-us/library/bb509677(v=VS.85).aspx">
<b>tex2D</b> intrinsic function</a>. A <b>float4</b> <b>COLOR</b> value is expected as the return value of the pixel shader.</p>
<p align="center"><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/7178.clip_5F00_image013_5F00_0ADF78AA.jpg"><strong></strong></a><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/5100.clip_5F00_image013_5F00_236F15FA.jpg"><img title="clip_image013" border="0" alt="clip_image013" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/7026.clip_5F00_image013_5F00_thumb_5F00_14E2186A.jpg" width="398" height="262"></a></p>
<p align="center"><strong>Figure 4: Output of the initial shader code (original image)</strong></p>
<p>The initial pixel shader code returns the original color for each pixel and we use this as the starter for our gray scale conversion.</p>
<h4>Gray Conversion</h4>
<p><b>HLSL <br>
</b></p>
<pre class="csharpcode">sampler2D input : register(s0);

float4 main(float2 uv : TEXCOORD) : COLOR 
{
   <span class="rem">// Sample the original color at the coordinate</span>
   float4 color = tex2D(input, uv);
    
   <span class="rem">// Convert the color to gray</span>
  <span class="kwrd">float</span> gray = dot(color.rgb, float3(0.2126, 0.7152, 0.0722));
    
   <span class="rem">// Return gray with the original alpha value</span>
   <span class="kwrd">return</span> float4(gray, gray, gray, color.a); 
}</pre>
<p></p>
<p>The original color is sampled and then converted to gray using the <a href="http://msdn.microsoft.com/en-us/library/bb509594(v=VS.85).aspx">
<b>dot</b></a> product of the <b>r</b>ed, <b>g</b>reen, and <b>b</b>lue values with a constant
<b>float3</b> vector. The result actually represents the <a href="http://en.wikipedia.org/wiki/Luminance_(relative)">
luminance</a> of the pixel. The <a href="http://en.wikipedia.org/wiki/Dot_product">
dot product</a> multiplies the elements of the color vector with the elements of constant vector and adds the three products, thus resulting in a scalar
<b>float</b> value. The return value of the pixel shader is a new color made up of the gray value for RGB and the original alpha (transparency) of the sampled pixel.</p>
<p align="center"><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/5826.clip_5F00_image015_5F00_5C19C007.jpg"><strong></strong></a><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/3365.clip_5F00_image015_5F00_709F0F85.jpg"><img title="clip_image015" border="0" alt="clip_image015" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/4073.clip_5F00_image015_5F00_thumb_5F00_79C9495B.jpg" width="398" height="268"></a></p>
<p align="center"><strong>Figure 5: Output of the gray conversion shader</strong></p>
<h4>Parametric Tinting </h4>
<p>The gray conversion shader can now be extended to tint the output in a color that is passed as a parameter through a shader
<b>register</b>.</p>
<p><b>HLSL <br>
</b></p>
<pre class="csharpcode"><span class="rem">/// &lt;summary&gt;The tint color.&lt;/summary&gt;</span>
<span class="rem">/// &lt;type&gt;Color&lt;/type&gt;</span>
<span class="rem">/// &lt;defaultValue&gt;0.9,0.7,0.3,1&lt;/defaultValue&gt;</span>
float4 TintColor : register(C0);

sampler2D Input : register(s0);

float4 main(float2 uv : TEXCOORD) : COLOR 
{
   <span class="rem">// Sample the original color at the coordinate</span>
   float4 color = tex2D(Input, uv);
    
   <span class="rem">// Convert the color to gray</span>
   <span class="kwrd">float</span> gray = dot(color.rgb, float3(0.2126, 0.7152, 0.0722)); 
    
   <span class="rem">// Create the gray color with the original alpha value</span>
   float4 grayColor = float4(gray, gray, gray, color.a); 
   
   <span class="rem">// Return the tinted pixel</span>
   <span class="kwrd">return</span> grayColor * TintColor;
}</pre>
<p>The color used to tint every pixel is passed as a parameter and therefore defined as the first
<b>register</b> C0 (the next parameter should then be in the <b>register</b> C1). The XML comment is used by Shazzam to both create convenient controls and initialize the generated code. Shazzam creates the appropriate controls for the data type and uses the
 defaultValue, minValue and maxValue (Figure 6). The changed value of the control is applied directly to the Sample image, which allows a quick and easy shader development.
</p>
<p>Each element (RGBA) of the passed TintColor parameter is then multiplied with the
<b>float4</b> gray color and returned. The result of the default TintColor values is a
<a href="http://en.wikipedia.org/wiki/Sepia_tone">sepia-toned</a> image (Figure 7).</p>
<p align="center"><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/5481.clip_5F00_image017_5F00_7D676438.jpg"><img title="clip_image017" border="0" alt="clip_image017" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/5700.clip_5F00_image017_5F00_thumb_5F00_4378214C.jpg" width="528" height="344"></a></p>
<p align="center"><strong>Figure 6: Shazzam Tool Shader Settings</strong></p>
<p align="center"><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/2744.clip_5F00_image019_5F00_62BAC81F.jpg"><img title="clip_image019" border="0" alt="clip_image019" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/1754.clip_5F00_image019_5F00_thumb_5F00_624E952A.jpg" width="398" height="268"></a></p>
<p align="center"><strong>Figure 7: Output of the tint shader</strong></p>
<h4>Wiring it together with Silverlight </h4>
<p>Now it's time to use the shader in a Silverlight application and apply it to an Image, MediaElement, or whatever
<a href="http://msdn.microsoft.com/en-us/library/system.windows.uielement(VS.95).aspx">
UIElement</a> you like.</p>
<ol>
<li>Start Visual Studio, create a new <i>Silverlight Application</i> project, and select at least Silverlight 3 as the target framework.
</li><li>In the Shazzam Tool, click on <i>Compile Shader</i> in the<i> Tools</i> menu and then on
<i>Explore Compiled Shaders</i>. Make sure the <i>Generated namespace</i> setting (Figure 2) matches the assembly name of the Silverlight application.
</li><li>Copy the compiled shader file TintShader.ps and the corresponding C# or VB TintShaderEffect.cs|vb file from the
<i>GeneratedShaders</i> folder and the CS|VB subfolder into the Silverlight project directory.
</li><li>In Visual Studio, add the TintShaderEffect.cs|vb and the TintShader.ps file to the project. The property
<i>Build Action</i> of the TintShader.ps file must be set to <i>Resource</i>. Rebuild the solution.
</li><li>Open the MainPage.xaml file and add the namespace declaration and a Button or any other control that has the TintShaderEffect class applied (see below).
</li><li>Hit the F5 key and see your Silverlight shader application in action (Figure 8).
</li></ol>
<p><b>XAML </b></p>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">UserControl</span> <span class="attr">x:Class</span><span class="kwrd">=&quot;ShaderDemoApp.MainPage&quot;</span>
    <span class="attr">xmlns</span><span class="kwrd">=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span>
    <span class="attr">xmlns:x</span><span class="kwrd">=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</span>
    <span class="attr">xmlns:d</span><span class="kwrd">=&quot;http://schemas.microsoft.com/expression/blend/2008&quot;</span>
    <span class="attr">xmlns:mc</span><span class="kwrd">=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot;</span>
    <span class="attr">mc:Ignorable</span><span class="kwrd">=&quot;d&quot;</span>
    <span class="attr">d:DesignHeight</span><span class="kwrd">=&quot;300&quot;</span> <span class="attr">d:DesignWidth</span><span class="kwrd">=&quot;400&quot;</span>
    <span class="attr">xmlns:local</span><span class="kwrd">=&quot;clr-namespace:ShaderDemoApp&quot;</span><span class="kwrd">&gt;</span>

    <span class="kwrd">&lt;</span><span class="html">Grid</span> <span class="attr">x:Name</span><span class="kwrd">=&quot;LayoutRoot&quot;</span> <span class="attr">Background</span><span class="kwrd">=&quot;Gray&quot;</span><span class="kwrd">&gt;</span>
        <span class="kwrd">&lt;</span><span class="html">Button</span> <span class="attr">Content</span><span class="kwrd">=&quot;Big Tinted Button&quot;</span> <span class="attr">Width</span><span class="kwrd">=&quot;200&quot;</span> 
                <span class="attr">Height</span><span class="kwrd">=&quot;200&quot;</span> <span class="attr">Background</span><span class="kwrd">=&quot;Blue&quot;</span><span class="kwrd">&gt;</span>
            <span class="kwrd">&lt;</span><span class="html">Button.Effect</span><span class="kwrd">&gt;</span>
                <span class="kwrd">&lt;</span><span class="html">local:TintShaderEffect</span> <span class="kwrd">/&gt;</span>
            <span class="kwrd">&lt;/</span><span class="html">Button.Effect</span><span class="kwrd">&gt;</span>
        <span class="kwrd">&lt;/</span><span class="html">Button</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;/</span><span class="html">Grid</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">UserControl</span><span class="kwrd">&gt;</span></pre>
<p>&nbsp;</p>
<p align="center"><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/1667.clip_5F00_image021_5F00_41C75578.jpg"><strong><img title="clip_image021" border="0" alt="clip_image021" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/6064.clip_5F00_image021_5F00_thumb_5F00_61762F40.jpg" width="398" height="296"></strong></a></p>
<p align="center"><strong>Figure 8: The TintShader applied to the Button</strong></p>
<p>That's all that's needed to get a pixel shader working inside a Silverlight application. Please note that no manual C# or VB code-behind was written.</p>
<h4>Example 2: The Mosaic Shader aka The Donut Shader</h4>
<p>The second post process shader effect we'll write is a bit more advanced. It starts with pixelating the image before rounding the blocks until we've the final Mosaic-like result.
</p>
<p>For the development of this shader, we can use a different image. To do so, click the
<i>Open Image File</i> menu item in Shazzam's <i>File</i> menu. I used a famous test picture for image processing algorithms:
<a href="http://en.wikipedia.org/wiki/Lenna">Lenna</a>. By the way, there's an interesting
<a href="http://ndevilla.free.fr/lena/">story</a> behind this picture of Lena Söderberg.</p>
<p align="center"><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/7127.clip_5F00_image023_5F00_0EF74F04.jpg"><strong><img title="clip_image023" border="0" alt="clip_image023" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/7633.clip_5F00_image023_5F00_thumb_5F00_3F3E23BA.jpg" width="284" height="284"></strong></a></p>
<p align="center"><strong>Figure 9: Original Lenna test image</strong></p>
<h4>Pixelating the Input</h4>
<p><b>HLSL <br>
</b></p>
<pre class="csharpcode"><span class="rem">/// &lt;summary&gt;The number of pixel blocks.&lt;/summary&gt;</span>
<span class="rem">/// &lt;type&gt;Single&lt;/type&gt;</span>
<span class="rem">/// &lt;defaultValue&gt;25&lt;/defaultValue&gt;</span>
<span class="kwrd">float</span> BlockCount : register(C0);

sampler2D input : register(S0);

<span class="rem">// Static computed vars for optimization</span>
<span class="kwrd">static</span> <span class="kwrd">float</span> BlockSize = 1.0f / BlockCount; 

float4 main(float2 uv : TEXCOORD) : COLOR
{
   <span class="rem">// Calculate block center</span>
   float2 blockPos = floor(uv * BlockCount);
   float2 blockCenter = blockPos * BlockSize &#43; BlockSize * 0.5;
            
   <span class="rem">// Sample color at the calculated coordinate</span>
   <span class="kwrd">return</span> tex2D(input, blockCenter);
}</pre>
<p>The <b>float </b>BlockCount parameter defines into the number of blocks (large pixels) into which the resulting image will be divided (pixelated). The size of a block (BlockSize) is the inverse of the BlockCount and calculated as
<b>static </b><b>float</b> to save some clock cycles. The coordinate of the current pixel (uv) is then used to determine the block to which it belongs. This determination depends on the BlockCount and is a result of the built-in
<a href="http://msdn.microsoft.com/en-us/library/bb509599(v=VS.85).aspx">floor</a> function. To get the color of the output pixel, the center coordinate of each block is sampled for all the pixels that are part of the block.</p>
<p align="center"><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/4745.clip_5F00_image025_5F00_6CBF437D.jpg"><strong><img title="clip_image025" border="0" alt="clip_image025" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/6557.clip_5F00_image025_5F00_thumb_5F00_6C531088.jpg" width="284" height="284"></strong></a></p>
<p align="center"><strong>Figure 10: Output of the pixelation step</strong></p>
<h4>Rounding the Pixels </h4>
<p><b>HLSL </b></p>
<pre class="csharpcode"><span class="rem">/// &lt;summary&gt;The number of pixel blocks.&lt;/summary&gt;</span>
<span class="rem">/// &lt;type&gt;Single&lt;/type&gt;</span>
<span class="rem">/// &lt;defaultValue&gt;25&lt;/defaultValue&gt;</span>
<span class="kwrd">float</span> BlockCount : register(C0);

<span class="rem">/// &lt;summary&gt;The rounding of a pixel block.&lt;/summary&gt;</span>
<span class="rem">/// &lt;type&gt;Single&lt;/type&gt;</span>
<span class="rem">/// &lt;defaultValue&gt;0.45&lt;/defaultValue&gt;</span>
<span class="kwrd">float</span> Max : register(C2);

sampler2D input : register(S0);

<span class="rem">// Static computed vars for optimization</span>
<span class="kwrd">static</span> <span class="kwrd">float</span> BlockSize = 1.0f / BlockCount; 

float4 main(float2 uv : TEXCOORD) : COLOR
{
   <span class="rem">// Calculate block center</span>
   float2 blockPos = floor(uv * BlockCount);
   float2 blockCenter = blockPos * BlockSize &#43; BlockSize * 0.5;
        
   <span class="rem">// Round the block by testing the distance </span>
   <span class="rem">// of the pixel coordinate to the center</span>
   <span class="kwrd">float</span> dist = length(uv - blockCenter) * BlockCount;
   <span class="kwrd">if</span>(dist &gt; Max)
   {
      <span class="kwrd">return</span> 0;
   }
    
   <span class="rem">// Sample color at the calculated coordinate</span>
   <span class="kwrd">return</span> tex2D(input, blockCenter);
}</pre>
<b></b>
<p>The Max parameter defines the maximum distance of a pixel to its block center and, therefore, the rounding of a pixel block. If the length of the vector between the current pixel coordinate (uv) and its block center is greater than the Max parameter, a transparent
 pixel (0) is returned. The built-in <a href="http://msdn.microsoft.com/en-us/library/bb509617(v=VS.85).aspx">
<b>length</b></a> function is used to calculate the scalar length of the distance vector.</p>
<p align="center"><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/0310.clip_5F00_image027_5F00_424589D8.jpg"><strong></strong></a><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/6082.clip_5F00_image027_5F00_6FC6A99B.jpg"><img title="clip_image027" border="0" alt="clip_image027" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/6560.clip_5F00_image027_5F00_thumb_5F00_6A3611BF.jpg" width="284" height="284"></a></p>
<p align="center"><strong>Figure 11: Output of the rounding step (Max = 0.45)</strong></p>
<p align="center"><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/6507.clip_5F00_image029_5F00_683B3A2E.jpg"><strong></strong></a><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/0333.clip_5F00_image029_5F00_15BC59F2.jpg"><img title="clip_image029" border="0" alt="clip_image029" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/6406.clip_5F00_image029_5F00_thumb_5F00_27E2F97C.jpg" width="284" height="284"></a></p>
<p align="center"><strong>Figure 12: Output of the rounding step (Max = 0.60)</strong></p>
<h4>Baking Donuts </h4>
<p><b>HLSL</b></p>
<pre class="csharpcode"><span class="rem">/// &lt;summary&gt;The number of pixel blocks.&lt;/summary&gt;</span>
<span class="rem">/// &lt;type&gt;Single&lt;/type&gt;</span>
<span class="rem">/// &lt;defaultValue&gt;25&lt;/defaultValue&gt;</span>
<span class="kwrd">float</span> BlockCount : register(C0);

<span class="rem">/// &lt;summary&gt;The rounding of a pixel block.&lt;/summary&gt;</span>
<span class="rem">/// &lt;type&gt;Single&lt;/type&gt;</span>
<span class="rem">/// &lt;defaultValue&gt;0.2&lt;/defaultValue&gt;</span>
<span class="kwrd">float</span> Min : register(C1);

<span class="rem">/// &lt;summary&gt;The rounding of a pixel block.&lt;/summary&gt;</span>
<span class="rem">/// &lt;type&gt;Single&lt;/type&gt;</span>
<span class="rem">/// &lt;defaultValue&gt;0.45&lt;/defaultValue&gt;</span>
<span class="kwrd">float</span> Max : register(C2);

sampler2D input : register(S0);

<span class="rem">// Static computed vars for optimization</span>
<span class="kwrd">static</span> <span class="kwrd">float</span> BlockSize = 1.0f / BlockCount; 

float4 main(float2 uv : TEXCOORD) : COLOR
{
   <span class="rem">// Calculate block center</span>
   float2 blockPos = floor(uv * BlockCount);
   float2 blockCenter = blockPos * BlockSize &#43; BlockSize * 0.5;
        
   <span class="rem">// Round the block by testing the distance </span>
   <span class="rem">// of the pixel coordinate to the center</span>
   <span class="kwrd">float</span> dist = length(uv - blockCenter) * BlockCount;
   <span class="kwrd">if</span>(dist &lt; Min || dist &gt; Max)
   {
      <span class="kwrd">return</span> 0;
   }
    
   <span class="rem">// Sample color at the calculated coordinate</span>
   <span class="kwrd">return</span> tex2D(input, blockCenter);
} </pre>
<b></b>
<p>The last thing left to do in order to get some nice rings (donuts) is to add a test for the minimum distance. This is pretty easy and done with the additional Min parameter.</p>
<p align="center"><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/4861.clip_5F00_image031_5F00_4747C787.jpg"><strong></strong></a><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/8640.clip_5F00_image031_5F00_3492CDD0.jpg"><img title="clip_image031" border="0" alt="clip_image031" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/2625.clip_5F00_image031_5F00_thumb_5F00_48C64656.jpg" width="284" height="284"></a></p>
<p align="center"><strong>Figure 13: Output of the ring step (Min = 0.20, Max = 0.45)</strong></p>
<p>Please note that all of the parameters can be animated, which could result in a nice (transition) effect when two images are overlaid. The Shazzam Tool also supports animation with the generated Shader Settings controls.</p>
<h3>How does the Demo Application work? </h3>
<p>The Silverlight demo application is quite flexible and can be used for many different shader effects without touching the core functionality. This last part of the article will show how this extensibility was achieved. Explanations of how to use the webcam
 with Silverlight and how to load an image from disk were detailed in my last <a href="http://blogs.msdn.com/coding4fun/archive/2010/03/24/9984015.aspx">
Silverlight Face Detection</a> article.</p>
<p>The application's extensibility was mainly accomplished by using the <a href="http://en.wikipedia.org/wiki/Managed_Extensibility_Framework">
Managed Extensibility Framework (MEF)</a> and a <a href="http://en.wikipedia.org/wiki/Model_View_ViewModel">
View-ViewModel approach</a> for the shader parameters. MEF is a great way to make decoupled and flexible applications and has been part of the Silverlight framework since version 4. MEF is like
<a href="http://www.drugabuse.gov/drugpages/methamphetamine.html">Meth</a> for .Net and Silverlight developers, but without all the undesirable side effects.
</p>
<p>The beauty of MEF is best illustrated using source code. As you can see in the demo application (Figure 1), it's possible to select a pixel shader with a ComboBox. The items in the MainPage's shader ComboBox are populated through
<a href="http://msdn.microsoft.com/en-us/library/cc278072(VS.95).aspx">data binding</a> an
<a href="http://msdn.microsoft.com/en-us/library/ms668604(VS.95).aspx">ObservableCollection &lt;T&gt;</a> and MEF is used to build this collection.</p>
<p><b>C# <br>
</b></p>
<pre class="csharpcode"><span class="rem">/// &lt;summary&gt;</span>
<span class="rem">/// The main Page of the application.</span>
<span class="rem">/// &lt;/summary&gt;</span>
<span class="kwrd">public</span> <span class="kwrd">partial</span> <span class="kwrd">class</span> MainPage : UserControl
{
   [ImportMany(AllowRecomposition = <span class="kwrd">true</span>)]
   <span class="kwrd">public</span> ObservableCollection&lt;IShaderViewModel&gt; Shaders;

   <span class="kwrd">public</span> MainPage()
   {
      InitializeComponent();
   }

   <span class="kwrd">private</span> <span class="kwrd">void</span> Initialize()
   {
      <span class="rem">// Compose the parts with MEF</span>
      var container = <span class="kwrd">new</span> CompositionContainer(
            <span class="kwrd">new</span> AssemblyCatalog(GetType().Assembly));
      container.ComposeParts(<span class="kwrd">this</span>);

      <span class="rem">// Fill ComboBox</span>
      CmbShaders.ItemsSource = Shaders;
      CmbShaders.DisplayMemberPath = <span class="str">&quot;Name&quot;</span>;
      CmbShaders.SelectedIndex = 0;

      <span class="rem">// ...</span>
   }

   <span class="rem">// ...</span>
}

<span class="rem">/// &lt;summary&gt;</span>
<span class="rem">/// Interface of a ViewModel for a shader effect.</span>
<span class="rem">/// &lt;/summary&gt;</span>
[InheritedExport]
<span class="kwrd">public</span> <span class="kwrd">interface</span> IShaderViewModel
{
   <span class="kwrd">string</span> Name { get; }
   ShaderEffect Shader { get; }
   UserControl View { get; }
}</pre>
<p>The MainPage has a Shaders collection property containing items that implement the IShaderViewModel interface. This collection is initialized by using MEF's CompositionContainer with an AssemblyCatalog and the ComposeParts method. ComposeParts analyses all
 types in the provided Catalog (here, the assembly), checks if they have certain <a href="http://msdn.microsoft.com/en-us/library/e8kc3626(v=VS.100).aspx">
attributes</a> attached, and wires these so-called parts together. To put it simply, an instance of a type decorated with an
<a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.composition.exportattribute(VS.95).aspx">
Export attribute</a> is created and assigned to each field / property / parameter of the type that has an
<a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.composition.importattribute(v=VS.95).aspx">
Import attribute</a> attached.</p>
<p>The IShaderViewModel interface has the <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.composition.inheritedexportattribute(v=VS.95).aspx">
InheritedExport attribute</a> attached, which means that implementations of this interface will automatically provide that export. The Shaders collection in turn uses the
<a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.composition.importmanyattribute(v=VS.95).aspx">
ImportMany attribute</a>, telling MEF to populate the list with all matching exports (here, all classes that implement the IShaderViewModel interface).</p>
<p>After MEF fills the collection, it is data bound to the ItemsSource property of the ComboBox. The Name property of the IShaderViewModel interface is used as DisplayMember.</p>
<p>The advantage of MEF should be pretty obvious here: you have to implement an IShaderViewModel and maybe a View
<a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.usercontrol(VS.95).aspx">
UserControl</a> for the shader's parameters, but you don't need to add an instance of the shader ViewModel to the Shaders collection manually. Since the IShaderViewModel has the
<a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.composition.inheritedexportattribute(v=VS.95).aspx">
InheritedExport attribute</a> attached, it's not even necessary to add a special MEF attribute to the new shader ViewModel type. Additionally, it's possible to load an extra assembly asynchronously and let MEF compose the parts and update the collection afterwards.
 By setting the AllowRecomposition parameter of the <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.composition.importmanyattribute(v=VS.95).aspx">
ImportMany attribute</a> to true we're asking MEF to allow dynamic updates.</p>
<p>As you can see, MEF is pretty easy but also very powerful. But we have just scratched the surface—this
<a href="http://blogs.msdn.com/mcsuksoldev/archive/2010/04/28/managed-extensibility-framework-overview.aspx">
blog post</a> and the MSDN are good starters if you want to <a href="http://msdn.microsoft.com/en-us/library/ee155691(v=VS.100).aspx">
learn more about MEF</a>. </p>
<h3>Further Resources </h3>
<p>There are many great HLSL shader development resources available on the web. The following list contains some sites focused on Silverlight / WPF pixel shaders. If I forgot a great resource, please post it in a comment.
</p>
<ul>
<li>The open source <a href="http://wpffx.codeplex.com">WPF Pixel Shader Effects Library at CodePlex</a> contains a lot of common pixel shader effects.
</li><li>Nikola Mihaylov (aka Nokola) wrote a <a href="http://nokola.com/EasyPainter">
great online image editor</a> in Silverlight that uses pixel shaders for the effects. He
<a href="http://nokola.com/blog/?tag=/Pixel&#43;Shader">released the pixel shaders</a> that are used in EasyPainter as open source. And he also released the custom controls from his tool. The Slider and the ColorPicker used in the demo application are from
<a href="http://nokola.com/blog/post/2010/03/11/EasyPainter-Source-Pack-1-Refresh-(Bug-Fixes).aspx">
there</a>. I just changed some properties to <a href="http://msdn.microsoft.com/en-us/library/cc221408(VS.95).aspx">
Dependency Properties</a> to make the controls bindable. So Kudos to Nikola! </li><li>Walt Ritscher's amazing <a href="http://shazzam-tool.com/">Shazzam Tool</a> also comes with many cool pixel shaders as samples. Kudos to Walt for making such a great tool!
</li><li>Additionally, from time to time I write some shaders and put them <a href="http://kodierer.blogspot.com/search/label/Shader">
up on my blog</a>. Now that we have an extensible Silverlight shader demo application, I will surely integrate my upcoming shaders directly into it.
</li></ul>
<p>While I was writing this article, an open source project called <a href="http://wpfmetaeffects.codeplex.com">
WPF Meta-Effects</a> was released on CodePlex. The WPF Meta-Effects framework makes it possible to write Shaders for WPF in C# by using attributes, delegates, and dynamic HLSL compilation. It's a neat idea, but due to its dynamic compilation of shaders it's
 limited to WPF and can't be used with Silverlight. Additionally, I much prefer the simplicity of HLSL to C# when writing shaders. There's a reason why HLSL was invented:
<a href="http://wpfmetaeffects.codeplex.com/">see the examples yourself</a>.</p>
<h3>Conclusion</h3>
<p>This article explained what shaders and HLSL are, as well as how to write pixel shaders for Silverlight and WPF. It also showed what tools / frameworks to use for the best developer experience and gave an introduction on how to write an extensible application
 with MEF. </p>
<p>I hope it diminished any fear of the HLSL language and the shader development. I also hope it both inspires and helps you to write your own shaders. I'm eager to see what you come up with. Have fun!</p>
<p>The links to the live demo app and source code are at the top of the article.</p>
<h3>About The Author</h3>
<p><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/8463.clip_5F00_image033_5F00_60E9B0B1.jpg"><img title="clip_image033" border="0" hspace="12" alt="clip_image033" align="right" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10014965/7506.clip_5F00_image033_5F00_thumb_5F00_192827CA.jpg" width="140" height="140"></a>René
 Schulte is a .Net / Silverlight developer and Microsoft <a href="http://mvp.support.microsoft.com/profile/Rene.Schulte">
Silverlight MVP</a> passionate about real-time computer graphics, physics, AI, and algorithms. He loves C#, Shaders, Augmented Reality, and computer vision. He started the
<a href="http://SLARToolkit.codeplex.com">SLARToolkit</a>, the <a href="http://WriteableBitmapEx.codeplex.com">
WriteableBitmapEx</a>, and the <a href="http://Matrix3DEx.codeplex.com">Matrix3DEx</a> Silverlight open source projects, and he has a
<a href="http://rene-schulte.info">Silverlight website</a> powered by real time soft body physics. He is also a regular author for Microsoft's Coding4Fun. Contact information can be found on his
<a href="http://rene-schulte.info">Silverlight website</a>, his <a href="http://blog.rene-schulte.info">
blog</a>, or via <a href="http://twitter.com/rschu">Twitter</a>.</p>
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:db33c6aa6ce24903b5059e7600c94b7c">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/articles/SilverShader--Introduction-to-Silverlight-and-WPF-Pixel-Shaders</comments>
      <itunes:summary>
This article explains how to write pixel shaders for the Microsoft Silverlight and WPF platform with HLSL, as well as how to write an extensible Silverlight application for shader demos.

 
Introduction
Almost 10 years ago, 
Microsoft announced DirectX 8.0, including the huge real-time computer graphics milestone, Direct3D 8.0. Direct3D 8.0 introduced programmable
shaders and gave the developers a chance to create never-before-seen effects and experiences apart from the fixed-function graphics pipeline. With Direct3D 8.0&#39;s new shader capabilities, it
 became possible to compute neat custom-rendering effects on mainstream graphics hardware. Today&#39;s graphics hardware is capable of running hundreds of shaders in parallel and modern games make heavy use of this technology t to achieve stunning effects.
 
A shader is a rather small program, a so-called kernel function, typically executed in parallel for each data element.
Pixel shaders, for example, are executed for each pixel of a bitmap, and therefore used to implement per-pixel effects.
 
This introductory article will explain how to write pixel shaders for Silverlight and WPF, what tools should be used, and how to work with the tools. Furthermore, it will show how to build an extensible Silverlight shader application. 
Demo Application
The demo application makes it possible to apply different shaders to an image or to the live stream from the webcam. The application not only comes with the two shaders that will be implemented in this article, it also contains three other shaders I&#39;ve written
 before. The complete source code is licensed under the 
Ms-PL and can be downloaded from the 
CodePlex site. 
You need at least the Silverlight 4 runtime installed to run the sample and a webcam is needed in order to exploit the full functionality. The runtime is available for
Windows and 
Mac.  
Open the sample 
 
Figure 1: Screenshot of the demo application 
How To Use?
You can start and stop the webcam with the 

 Button, or</itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/articles/SilverShader--Introduction-to-Silverlight-and-WPF-Pixel-Shaders</link>
      <pubDate>Tue, 25 May 2010 15:51:14 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/articles/SilverShader--Introduction-to-Silverlight-and-WPF-Pixel-Shaders</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/c4f/images/10014965_100.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/c4f/images/10014965_220.jpg" height="165" width="220"></media:thumbnail>      
      <dc:creator>Rene Schulte</dc:creator>
      <itunes:author>Rene Schulte</itunes:author>
      <slash:comments>10</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/articles/SilverShader--Introduction-to-Silverlight-and-WPF-Pixel-Shaders/RSS</wfw:commentRss>
      <category>HLSL</category>
      <category>Media</category>
      <category>Silverlight</category>
      <category>WebCam</category>
      <category>WPF</category>
      <category>Pixel Shaders</category>
    </item>
  <item>
      <title>Generating Sound Waves with C# Wave Oscillators</title>
      <description><![CDATA[
<p>For the longest time, I've been baffled by the concept of sound in computing. How in the world is sound store? How is it played back? In classic Coding4Fun style, we'll learn by doing in this article—by building a wave oscillator application.
</p>
<h3>Optional Reading</h3>
<p>I cover the basics of this article in a multi-part blog series, which you should check out if you have trouble:</p>
<p><a href="http://blogs.msdn.com/dawate/archive/2009/06/22/intro-to-audio-programming-part-1-how-audio-data-is-represented.aspx">Part 1 - How Audio Data is Represented</a>
<br>
<a href="http://blogs.msdn.com/dawate/archive/2009/06/23/intro-to-audio-programming-part-2-demystifying-the-wav-format.aspx">Part 2 - Demystifying the WAV Format</a>
<br>
<a href="http://blogs.msdn.com/dawate/archive/2009/06/24/intro-to-audio-programming-part-3-synthesizing-simple-wave-audio-using-c.aspx">Part 3 - Synthesizing Simple WAV Audio Using C#</a>
<br>
<a href="http://blogs.msdn.com/dawate/archive/2009/06/25/intro-to-audio-programming-part-4-algorithms-for-different-sound-waves-in-c.aspx">Part 4 - Algorithms for Different Sound Waves in C#</a></p>
<h3>What's An Oscillator?</h3>
<p>An oscillator is a device or application that generates a waveform. In electrical engineering terms, it's a device that outputs an electrical current with varying voltage. If you plot the voltage over time, you get a regular wave in a particular form, such
 as a sine, square, triangle or sawtooth.</p>
<p>An oscillator is the most basic type of synthesizer. Analog synths use electrical circuits to output a sound wave. Digital synthesizers do the same thing, but with software.</p>
<p>You can create a pretty neat sounding instrument by combining the outputs of multiple oscillators. For example, if you have three oscillators oscillating at a frequency of 440Hz (concert A pitch), but each of them has a different waveform (saw, square, sine)
 you get a very interesting, layered sound. </p>
<p>But before we get too deep into this subject, let's briefly explore the physics of sound.</p>
<h3>The Physics of Sound</h3>
<p>Sound happens when air pressure changes on your ear drum. When you clap in an empty room, pressure waves bounce all over the place and dance on your eardrum. The changes in pressure are detected continuously by your ear.
</p>
<p>Digitally, “pressure” is referred to by a scalar value called <i>amplitude. </i>
The amplitude (loudness) of the wave is measured thousands of times per second (44,100 times per second on CDs). Every measurement of pressure (aka
<i>amplitude</i>) is called a <i>sample</i>—CDs are recorded with 44,100 <i>samples</i> per second, each with a value between the minimum and maximum amplitude for the bit depth.
</p>
<p>Think about 44,100 samples per second. That's a <i>lot</i> of stuff for your ear to detect. That's how we're able to hear so much stuff going on in the mix of a song, especially in stereo tracks where you have 44,100 samples per second, per ear.
</p>
<p>It turns out that there is a <a href="http://en.wikipedia.org/wiki/Nyquist-Shannon_sampling_theorem">
horribly intense mathematical theorem</a> which basically tells us that 44,100 samples per second is enough to accurately represent a pitch as high as 22 KHz. The human ear can really hear only up to 20KHz, so a 44.1KHz sampling rate is a more than high-enough
 sampling rate. </p>
<p>This whole section is expanded in detail on my blog:</p>
<p><a href="http://blogs.msdn.com/dawate/archive/2009/06/22/intro-to-audio-programming-part-1-how-audio-data-is-represented.aspx">Part 1 - How Audio Data is Represented</a></p>
<h3>Terminology</h3>
<p>So now you have a rather glancing overview of how sound works, and perhaps some clues as to how we should go about representing it in computers. Let's go over all this new terminology (plus some even newer terms) in delicious, bulleted format:</p>
<p>· <b>Sample: </b>A measurement of a sound wave at a very small point in time. 44,100 of these measurements in a row form a single channel of CD-quality audio.</p>
<p>· <b>Amplitude: </b>The value of a sample. Max and min values are dependent upon the bit depth.</p>
<p>· <b>Bit depth: </b>The number of bits used to represent a sample. 16-bit, 32-bit, etc. Max amplitude is (2^depth) / 2 – 1.</p>
<p>· <b>Sample rate (aka sampling rate, aka bit rate): </b>The number of samples per second of audio. 44,100 is standard for CD-quality audio.</p>
<h3>How sound is represented</h3>
<p>By now, you've probably surmised that a second of audio data is somehow represented by an array of some integer data type, which has a length of 44,100. You would be correct in that assumption. However, if you want sound to play from a computer's sound card,
 that data has to be accompanied with a bunch of format information. WAV is probably the easiest format to deal with.
</p>
<p>See more in the following article:</p>
<p><a href="http://blogs.msdn.com/dawate/archive/2009/06/23/intro-to-audio-programming-part-2-demystifying-the-wav-format.aspx">Part 2 - Demystifying the WAV Format</a></p>
<p>You can also see how to build out a WAV file, old school and binary style, in the 3<sup>rd</sup> part of that series:</p>
<p><a href="http://blogs.msdn.com/dawate/archive/2009/06/24/intro-to-audio-programming-part-3-synthesizing-simple-wave-audio-using-c.aspx">Part 3 - Synthesizing Simple WAV Audio Using C#</a></p>
<p>However, we are taking a slightly easier route, by using DirectSound. DirectSound gives us a lot of nice classes for all the format information, abstracting all that stuff away and allowing us to pump a stream of data into a DirectSound object and play it.
 Perfect for a synthesizer app!</p>
<p>So, let's get started!</p>
<h3>Building the app</h3>
<p>I learned some Blend while working with this app, since it's built on WPF. The image buttons are just radio buttons. I had to differentiate the group number per instance of the user control at runtime (in the constructor of the Oscillator class).</p>
<p><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10006604/image_2.png"><img title="image" border="0" alt="image" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10006604/image_thumb.png" width="379" height="442"></a>
</p>
<p>I'm a terrible UI designer for the most part, so this is about as sexy as I'm willing to make this application. But feel free to make it look and act better!</p>
<h4>Designing the UI</h4>
<p>There's a dirty little secret in this application. It says it can oscillate 3 waves, but in truth, there's a constant (set to 3) that you can modify. You could have six if you wanted. How did I accomplish this? Each synth that you see is an instance of a
 WPF user control called Oscillator.xaml:</p>
<p><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10006604/image_4.png"><img title="image" border="0" alt="image" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10006604/image_thumb_1.png" width="380" height="102"></a>
</p>
<p>I have a StackPanel called Oscs in the main window. In the Window_Loaded event handler of the main window, I use this bit of code to add instances of the usercontrol:</p>
<p><b>C# <br>
</b></p>
<pre class="csharpcode"><span class="rem">// Add 3 oscillators</span>
Oscillator tmp;
<span class="kwrd">for</span> (<span class="kwrd">int</span> i = 0; i &lt; NUM_GENERATORS; i&#43;&#43;)
{
    tmp = <span class="kwrd">new</span> Oscillator();
    Oscs.Children.Add(tmp);
    mixer.Oscillators.Add(tmp);
}</pre>
<style type="text/css">
<!--
.csharpcode, .csharpcode 
	{font-size:small;
	color:black;
	font-family:consolas,"Courier New",courier,monospace;
	background-color:#ffffff}
.csharpcode 
	{margin:0em}
.csharpcode .rem
	{color:#008000}
.csharpcode .kwrd
	{color:#0000ff}
.csharpcode .str
	{color:#006080}
.csharpcode .op
	{color:#0000c0}
.csharpcode .preproc
	{color:#cc6633}
.csharpcode .asp
	{background-color:#ffff00}
.csharpcode .html
	{color:#800000}
.csharpcode .attr
	{color:#ff0000}
.csharpcode .alt
	{background-color:#f4f4f4;
	width:100%;
	margin:0em}
.csharpcode .lnum
	{color:#606060}
-->
</style>
<p><b>VB <br>
</b></p>
<pre class="csharpcode"><span class="rem">' Add 3 oscillators</span>
<span class="kwrd">Dim</span> tmp <span class="kwrd">As</span> Oscillator
<span class="kwrd">Dim</span> i <span class="kwrd">As</span> <span class="kwrd">Integer</span> = 0
<span class="kwrd">While</span> i &lt; NUM_GENERATORS
    tmp = <span class="kwrd">New</span> Oscillator()
    Oscs.Children.Add(tmp)
    mixer.Oscillators.Add(tmp)
    System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
<span class="kwrd">End</span> While</pre>
<p></p>
<p>The long rectangular canvas is used to plot the values of the generated wave, so you can visualize the wave as it's played. It is scaled along the X axis so you can see the general shape of the wave, which would be impossible without scaling it with 44,100
 samples per second.</p>
<p><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10006604/image_6.png"><img title="image" border="0" alt="image" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10006604/image_thumb_2.png" width="376" height="441"></a>
</p>
<p>Earlier in the article, I noted that a sound file is basically a <i>really, really long array</i> of 16- or 32-bit floating point numbers between -1 and 1. We use this data to plot the graph as well. More on that later.</p>
<p>Now that we have the UI figured out (dynamic addition of oscillators), let's take a look at exactly how the sound is produced.
</p>
<h3>Bzzzzt! Making Sounds and the Mixer</h3>
<p>One of the many cool things about DirectSound is that it basically wraps the WAV format for you. You set the buffering/format options and then shove a bunch of data into it, and it will play. Magic.</p>
<p>The way I've architected the solution is a little more modular. None of the oscillators has the ability to play itself—rather, uses its UI to control some values such as frequency, amplitude and wave type. These values are tied to public properties. The
 Oscillator component does virtually no audio work at all. </p>
<p>The generation of audio data is handled by the custom Mixer class, which takes a collection of Oscillators and, based on their properties, creates a composite of all the generators. This is done by averaging the samples in every oscillator and putting them
 into a new array of data.</p>
<p><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10006604/image_8.png"><img title="image" border="0" alt="image" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10006604/image_thumb_3.png" width="345" height="189"></a>
</p>
<p>The <b>Mixer</b> class looks like this:</p>
<p><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10006604/image_10.png"><img title="image" border="0" alt="image" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10006604/image_thumb_4.png" width="343" height="372"></a>
</p>
<p>One of the workhorses of the Mixer class is the method <b>GenerateOscillatorSampleData</b>. This takes an Oscillator as an argument to give access to the public properties set in the UI. From there, the algorithm generates 1 second of sample data (specified
 by the member <b>bufferDurationSeconds</b>) based on the wave type that has been selected in the UI. This is where the mathy stuff comes in to play. Check out this method and the different cases in the switch statement that determine what kind of wave to create
 below.</p>
<p><b>C# <br>
</b></p>
<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">short</span>[] GenerateOscillatorSampleData(Oscillator osc)
{
    <span class="rem">// Creates a looping buffer based on the params given</span>
    <span class="rem">// Fill the buffer with whatever waveform at the specified frequency            </span>
    <span class="kwrd">int</span> numSamples = Convert.ToInt32(bufferDurationSeconds * 
        waveFormat.SamplesPerSecond);
    <span class="kwrd">short</span>[] sampleData = <span class="kwrd">new</span> <span class="kwrd">short</span>[numSamples];
    <span class="kwrd">double</span> frequency = osc.Frequency;
    <span class="kwrd">int</span> amplitude = osc.Amplitude;
    <span class="kwrd">double</span> angle = (Math.PI * 2 * frequency) / 
        (waveFormat.SamplesPerSecond * waveFormat.Channels);            

    <span class="kwrd">switch</span> (osc.WaveType)
    {
        <span class="kwrd">case</span> WaveType.Sine:
            {
                <span class="kwrd">for</span> (<span class="kwrd">int</span> i = 0; i &lt; numSamples; i&#43;&#43;)
                    <span class="rem">// Generate a sine wave in both channels.</span>
                    sampleData[i] = Convert.ToInt16(amplitude * 
        Math.Sin(angle * i));
            }
            <span class="kwrd">break</span>;
        <span class="kwrd">case</span> WaveType.Square:
            {
                <span class="kwrd">for</span> (<span class="kwrd">int</span> i = 0; i &lt; numSamples; i&#43;&#43;)
                {
                    <span class="rem">// Generate a square wave in both channels.</span>
                    <span class="kwrd">if</span> (Math.Sin(angle * i) &gt; 0)
                        sampleData[i] = Convert.ToInt16(amplitude);
                    <span class="kwrd">else</span>
                        sampleData[i] = Convert.ToInt16(-amplitude);
                }
            }
            <span class="kwrd">break</span>;
        <span class="kwrd">case</span> WaveType.Sawtooth:
            {
                <span class="kwrd">int</span> samplesPerPeriod = Convert.ToInt32(
        waveFormat.SamplesPerSecond / 
        (frequency / waveFormat.Channels));
                <span class="kwrd">short</span> sampleStep = Convert.ToInt16(
        (amplitude * 2) / samplesPerPeriod);
                <span class="kwrd">short</span> tempSample = 0;

                <span class="kwrd">int</span> i = 0;
                <span class="kwrd">int</span> totalSamplesWritten = 0;
                <span class="kwrd">while</span> (totalSamplesWritten &lt; numSamples)
                {
                    tempSample = (<span class="kwrd">short</span>)-amplitude;
                    <span class="kwrd">for</span> (i = 0; i &lt; samplesPerPeriod &amp;&amp; 
        totalSamplesWritten &lt; numSamples; i&#43;&#43;)
                    {
                        tempSample &#43;= sampleStep;
                        sampleData[totalSamplesWritten] = tempSample;

                        totalSamplesWritten&#43;&#43;;
                    }
                }
            }
            <span class="kwrd">break</span>;
        <span class="kwrd">case</span> WaveType.Noise:
            {
                Random rnd = <span class="kwrd">new</span> Random();
                <span class="kwrd">for</span> (<span class="kwrd">int</span> i = 0; i &lt; numSamples; i&#43;&#43;)
                {
                    sampleData[i] = Convert.ToInt16(
        rnd.Next(-amplitude, amplitude));
                }
            }
            <span class="kwrd">break</span>;
    }
    <span class="kwrd">return</span> sampleData;
}</pre>
<p></p>
<p><b>VB.Net <br>
</b></p>
<pre class="csharpcode"><span class="kwrd">Public</span> <span class="kwrd">Function</span> GenerateOscillatorSampleData(<span class="kwrd">ByVal</span> osc <span class="kwrd">As</span> Oscillator) <span class="kwrd">As</span> <span class="kwrd">Short</span>()
    <span class="rem">' Creates a looping buffer based on the params given</span>
    <span class="rem">' Fill the buffer with whatever waveform at the specified frequency </span>
    <span class="kwrd">Dim</span> numSamples <span class="kwrd">As</span> <span class="kwrd">Integer</span> = Convert.ToInt32(
     bufferDurationSeconds * waveFormat.SamplesPerSecond)
    <span class="kwrd">Dim</span> sampleData <span class="kwrd">As</span> <span class="kwrd">Short</span>() = <span class="kwrd">New</span> <span class="kwrd">Short</span>(numSamples - 1) {}
    <span class="kwrd">Dim</span> frequency <span class="kwrd">As</span> <span class="kwrd">Double</span> = osc.Frequency
    <span class="kwrd">Dim</span> amplitude <span class="kwrd">As</span> <span class="kwrd">Integer</span> = osc.Amplitude
    <span class="kwrd">Dim</span> angle <span class="kwrd">As</span> <span class="kwrd">Double</span> = (Math.PI * 2 * frequency) /
     (waveFormat.SamplesPerSecond * waveFormat.Channels)

    <span class="kwrd">Select</span> <span class="kwrd">Case</span> osc.WaveType
        <span class="kwrd">Case</span> WaveType.Sine
            <span class="kwrd">If</span> <span class="kwrd">True</span> <span class="kwrd">Then</span>
                <span class="kwrd">For</span> i <span class="kwrd">As</span> <span class="kwrd">Integer</span> = 0 <span class="kwrd">To</span> numSamples - 1
                    <span class="rem">' Generate a sine wave in both channels.</span>
                    sampleData(i) =
                     Convert.ToInt16(amplitude * Math.Sin(angle * i))
                <span class="kwrd">Next</span>
            <span class="kwrd">End</span> <span class="kwrd">If</span>
            <span class="kwrd">Exit</span> <span class="kwrd">Select</span>
        <span class="kwrd">Case</span> WaveType.Square
            <span class="kwrd">If</span> <span class="kwrd">True</span> <span class="kwrd">Then</span>
                <span class="kwrd">For</span> i <span class="kwrd">As</span> <span class="kwrd">Integer</span> = 0 <span class="kwrd">To</span> numSamples - 1
                    <span class="rem">' Generate a square wave in both channels.</span>
                    <span class="kwrd">If</span> Math.Sin(angle * i) &gt; 0 <span class="kwrd">Then</span>
                        sampleData(i) = Convert.ToInt16(amplitude)
                    <span class="kwrd">Else</span>
                        sampleData(i) = Convert.ToInt16(-amplitude)
                    <span class="kwrd">End</span> <span class="kwrd">If</span>
                <span class="kwrd">Next</span>
            <span class="kwrd">End</span> <span class="kwrd">If</span>
            <span class="kwrd">Exit</span> <span class="kwrd">Select</span>
        <span class="kwrd">Case</span> WaveType.Sawtooth
            <span class="kwrd">If</span> <span class="kwrd">True</span> <span class="kwrd">Then</span>
                <span class="kwrd">Dim</span> samplesPerPeriod <span class="kwrd">As</span> <span class="kwrd">Integer</span> =
                 Convert.ToInt32(waveFormat.SamplesPerSecond /
                      (frequency / waveFormat.Channels))
                <span class="kwrd">Dim</span> sampleStep <span class="kwrd">As</span> <span class="kwrd">Short</span> =
                 Convert.ToInt16((amplitude * 2) / samplesPerPeriod)
                <span class="kwrd">Dim</span> tempSample <span class="kwrd">As</span> <span class="kwrd">Short</span> = 0

                <span class="kwrd">Dim</span> i <span class="kwrd">As</span> <span class="kwrd">Integer</span> = 0
                <span class="kwrd">Dim</span> totalSamplesWritten <span class="kwrd">As</span> <span class="kwrd">Integer</span> = 0
                <span class="kwrd">While</span> totalSamplesWritten &lt; numSamples
                    tempSample = <span class="kwrd">CShort</span>(-amplitude)
                    i = 0
                    <span class="kwrd">While</span> i &lt; samplesPerPeriod <span class="kwrd">AndAlso</span> totalSamplesWritten &lt; numSamples
                        tempSample &#43;= sampleStep
                        sampleData(totalSamplesWritten) = tempSample

                        totalSamplesWritten &#43;= 1
                        i &#43;= 1
                    <span class="kwrd">End</span> <span class="kwrd">While</span>
                <span class="kwrd">End</span> <span class="kwrd">While</span>
            <span class="kwrd">End</span> <span class="kwrd">If</span>
            <span class="kwrd">Exit</span> <span class="kwrd">Select</span>
        <span class="kwrd">Case</span> WaveType.Noise
            <span class="kwrd">If</span> <span class="kwrd">True</span> <span class="kwrd">Then</span>
                <span class="kwrd">Dim</span> rnd <span class="kwrd">As</span> <span class="kwrd">New</span> Random()
                <span class="kwrd">For</span> i <span class="kwrd">As</span> <span class="kwrd">Integer</span> = 0 <span class="kwrd">To</span> numSamples - 1
                    sampleData(i) = Convert.ToInt16(
                     rnd.[<span class="kwrd">Next</span>](-amplitude, amplitude))
                <span class="kwrd">Next</span>
            <span class="kwrd">End</span> <span class="kwrd">If</span>
            <span class="kwrd">Exit</span> <span class="kwrd">Select</span>
    <span class="kwrd">End</span> <span class="kwrd">Select</span>
    <span class="kwrd">Return</span> sampleData
<span class="kwrd">End</span> Function</pre>
<p></p>
<p>The Mixer is the heart of the app, and it's a beautiful example of object orientation and cohesion. Give it three things (oscillators) and it spits out a new thing you can use (an array of sample data).
</p>
<p>Now that we have the sample data, all we have to do is play it back using DirectSound.</p>
<h3>Sound Playback with DirectSound</h3>
<p>As I mentioned, DirectSound provides a wrapper over the WAV format. You set up your buffer and format information and then feed it a bunch of data in the form of an array of shorts (arrays of trousers are known to cause errors).</p>
<p>First, we initialize the format information and buffer in the Window_Loaded event handler of the main form. The values below are not really arbitrary; there is an explanation of them in the Optional Reading section above (see
<a href="http://blogs.msdn.com/dawate/archive/2009/06/23/intro-to-audio-programming-part-2-demystifying-the-wav-format.aspx">
Demystifying the WAV Format</a>). This code also contains the code to add the oscillators, as shown earlier in the article.</p>
<p><b>C#</b> <br>
</p>
<pre class="csharpcode"><span class="kwrd">private</span> <span class="kwrd">void</span> Window_Loaded(<span class="kwrd">object</span> sender, System.Windows.RoutedEventArgs e)
{
    WindowInteropHelper helper = 
        <span class="kwrd">new</span> WindowInteropHelper(Application.Current.MainWindow);
    device.SetCooperativeLevel(helper.Handle, CooperativeLevel.Normal);

    waveFormat = <span class="kwrd">new</span> Microsoft.DirectX.DirectSound.WaveFormat();
    waveFormat.SamplesPerSecond = 44100;
    waveFormat.Channels = 2;
    waveFormat.FormatTag = WaveFormatTag.Pcm;
    waveFormat.BitsPerSample = 16;
    waveFormat.BlockAlign = 4;
    waveFormat.AverageBytesPerSecond = 176400;

    bufferDesc = <span class="kwrd">new</span> BufferDescription(waveFormat);
    bufferDesc.DeferLocation = <span class="kwrd">true</span>;
    bufferDesc.BufferBytes = Convert.ToInt32(
        bufferDurationSeconds * waveFormat.AverageBytesPerSecond / waveFormat.Channels);

    <span class="rem">// Add 3 oscillators</span>
    Oscillator tmp;
    <span class="kwrd">for</span> (<span class="kwrd">int</span> i = 0; i &lt; NUM_GENERATORS; i&#43;&#43;)
    {
        tmp = <span class="kwrd">new</span> Oscillator();
        Oscs.Children.Add(tmp);
        mixer.Oscillators.Add(tmp);
    }            
}</pre>
<p><b>VB <br>
</b></p>
<pre class="csharpcode"><span class="kwrd">Private</span> <span class="kwrd">Sub</span> Window_Loaded(<span class="kwrd">ByVal</span> sender <span class="kwrd">As</span> <span class="kwrd">Object</span>, <span class="kwrd">ByVal</span> e <span class="kwrd">As</span> System.Windows.RoutedEventArgs)
    <span class="kwrd">Dim</span> helper <span class="kwrd">As</span> <span class="kwrd">New</span> WindowInteropHelper(Application.Current.MainWindow)
    device.SetCooperativeLevel(helper.Handle, CooperativeLevel.Normal)

    waveFormat = <span class="kwrd">New</span> Microsoft.DirectX.DirectSound.WaveFormat()
    waveFormat.SamplesPerSecond = 44100
    waveFormat.Channels = 2
    waveFormat.FormatTag = WaveFormatTag.Pcm
    waveFormat.BitsPerSample = 16
    waveFormat.BlockAlign = 4
    waveFormat.AverageBytesPerSecond = 176400

    bufferDesc = <span class="kwrd">New</span> BufferDescription(waveFormat)
    bufferDesc.DeferLocation = <span class="kwrd">True</span>
    bufferDesc.BufferBytes = Convert.ToInt32(
     bufferDurationSeconds * waveFormat.AverageBytesPerSecond / waveFormat.Channels)

    <span class="rem">' Add 3 oscillators</span>
    <span class="kwrd">Dim</span> tmp <span class="kwrd">As</span> Oscillator
    <span class="kwrd">For</span> i <span class="kwrd">As</span> <span class="kwrd">Integer</span> = 0 <span class="kwrd">To</span> NUM_GENERATORS - 1
        tmp = <span class="kwrd">New</span> Oscillator()
        Oscs.Children.Add(tmp)
        mixer.Oscillators.Add(tmp)
    <span class="kwrd">Next</span>
<span class="kwrd">End</span> Sub</pre>
<p></p>
<p>When you click the Play button, the application takes its collection of oscillators and passes the values of the UI controls to the Mixer (which is initialized on each click with a reference to the main form window, so it can grab the Oscillator user controls).</p>
<p>The mixer outputs an array of shorts, which we write to a DirectSound buffer.</p>
<p>Here is the code for the Play button's click event handler:</p>
<p><b>C# <br>
</b></p>
<pre class="csharpcode"><span class="kwrd">private</span> <span class="kwrd">void</span> btnPlay_Click(<span class="kwrd">object</span> sender, System.Windows.RoutedEventArgs e)
{                                    
    mixer.Initialize(Application.Current.MainWindow);

    <span class="kwrd">short</span>[] sampleData = mixer.MixToStream();
    buffer = <span class="kwrd">new</span> SecondaryBuffer(bufferDesc, device);            
    buffer.Write(0, sampleData, LockFlag.EntireBuffer);
    buffer.Play(0, BufferPlayFlags.Default);            

    GraphWaveform(sampleData);
}</pre>
<p></p>
<p><b>VB <br>
</b></p>
<pre class="csharpcode"><span class="kwrd">Private</span> <span class="kwrd">Sub</span> btnPlay_Click(sender <span class="kwrd">As</span> <span class="kwrd">Object</span>, e <span class="kwrd">As</span> System.Windows.RoutedEventArgs)
    mixer.Initialize(Application.Current.MainWindow)

    <span class="kwrd">Dim</span> sampleData <span class="kwrd">As</span> <span class="kwrd">Short</span>() = mixer.MixToStream()
    buffer = <span class="kwrd">New</span> SecondaryBuffer(bufferDesc, device)
    buffer.Write(0, sampleData, LockFlag.EntireBuffer)
    buffer.Play(0, BufferPlayFlags.[<span class="kwrd">Default</span>])

    GraphWaveform(sampleData)
<span class="kwrd">End</span> Sub</pre>
<p></p>
<h3>Drawing Pretty Graphs</h3>
<p>All that's left is to draw the graph of the waveform on the canvas. Below is the GraphWaveform method. This method could graph anything it wanted to, as long as it was an array of shorts (not trousers). It's reminiscent of trying to graph things using Flash
 back in the day, when you had to actually figure out points and lines (most likely on paper), but WPF's Polyline object makes this rather trivial.</p>
<p><b>C#</b> <br>
</p>
<pre class="csharpcode"><span class="kwrd">private</span> <span class="kwrd">void</span> GraphWaveform(<span class="kwrd">short</span>[] data)
{
    cvDrawingArea.Children.Clear();

    <span class="kwrd">double</span> canvasHeight = cvDrawingArea.Height;
    <span class="kwrd">double</span> canvasWidth = cvDrawingArea.Width;

    <span class="kwrd">int</span> observablePoints = 1800;
            
    <span class="kwrd">double</span> xScale = canvasWidth / observablePoints;
    <span class="kwrd">double</span> yScale = (canvasHeight / 
        (<span class="kwrd">double</span>)(amplitude * 2)) * ((<span class="kwrd">double</span>)amplitude / MAX_AMPLITUDE);            

    Polyline graphLine = <span class="kwrd">new</span> Polyline();
    graphLine.Stroke = Brushes.Black;
    graphLine.StrokeThickness = 1;

    <span class="kwrd">for</span> (<span class="kwrd">int</span> i = 0; i &lt; observablePoints; i&#43;&#43;)
    {
        graphLine.Points.Add(
            <span class="kwrd">new</span> Point(i * xScale, (canvasHeight / 2) - (data[i] * yScale) ));
    }

    cvDrawingArea.Children.Add(graphLine);            
}</pre>
<p><b>VB <br>
</b></p>
<pre class="csharpcode"><span class="kwrd">Private</span> <span class="kwrd">Sub</span> GraphWaveform(<span class="kwrd">ByVal</span> data <span class="kwrd">As</span> <span class="kwrd">Short</span>())
    cvDrawingArea.Children.Clear()

    <span class="kwrd">Dim</span> canvasHeight <span class="kwrd">As</span> <span class="kwrd">Double</span> = cvDrawingArea.Height
    <span class="kwrd">Dim</span> canvasWidth <span class="kwrd">As</span> <span class="kwrd">Double</span> = cvDrawingArea.Width

    <span class="kwrd">Dim</span> observablePoints <span class="kwrd">As</span> <span class="kwrd">Integer</span> = 1800

    <span class="kwrd">Dim</span> xScale <span class="kwrd">As</span> <span class="kwrd">Double</span> = canvasWidth / observablePoints
    <span class="kwrd">Dim</span> yScale <span class="kwrd">As</span> <span class="kwrd">Double</span> = (canvasHeight / <span class="kwrd">CDbl</span>((amplitude * 2))) * (<span class="kwrd">CDbl</span>(amplitude) / MAX_AMPLITUDE)

    <span class="kwrd">Dim</span> graphLine <span class="kwrd">As</span> <span class="kwrd">New</span> Polyline()
    graphLine.Stroke = Brushes.Black
    graphLine.StrokeThickness = 1

    <span class="kwrd">For</span> i <span class="kwrd">As</span> <span class="kwrd">Integer</span> = 0 <span class="kwrd">To</span> observablePoints - 1
        graphLine.Points.Add(
         <span class="kwrd">New</span> Point(i * xScale, (canvasHeight / 2) - (data(i) * yScale)))
    <span class="kwrd">Next</span>

    cvDrawingArea.Children.Add(graphLine)
<span class="kwrd">End</span> Sub</pre>
<p></p>
<h3>Conclusion</h3>
<p>This was a really fun little project that took way less time to code than it does to explain. It's a great exercise because it requires you to think about an ancillary field of science before you can sit down and code, which is really what coding for fun's
 all about, anyway!</p>
<p>If you want to try this out, the download link for the source code is at the top of the article.</p>
<h3>About The Author</h3>
<p>Dan Waters is an Academic Evangelist at Microsoft, covering schools in the Pacific Northwest, Alaska, and Hawaii. He is based in Bellevue, WA. Dan has way too many guitars at home and tries to entice both of his young daughters to learn how to play them.
 Music, technology, and music&#43;technology are among his favorite hobbies, along with snowboarding and trying to maintain cool dad status. You can find his blog at
<a href="http://www.danwaters.com">www.danwaters.com</a> or follow him on Twitter at
<a href="http://www.twitter.com/danwaters">www.twitter.com/danwaters</a>.</p>
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:2bd34398dc634955bf3a9e7600c975ca">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/articles/Generating-Sound-Waves-with-C-Wave-Oscillators</comments>
      <itunes:summary>
For the longest time, I&#39;ve been baffled by the concept of sound in computing. How in the world is sound store? How is it played back? In classic Coding4Fun style, we&#39;ll learn by doing in this article—by building a wave oscillator application.
 
Optional Reading
I cover the basics of this article in a multi-part blog series, which you should check out if you have trouble: 
Part 1 - How Audio Data is Represented

Part 2 - Demystifying the WAV Format

Part 3 - Synthesizing Simple WAV Audio Using C#

Part 4 - Algorithms for Different Sound Waves in C# 
What&#39;s An Oscillator?
An oscillator is a device or application that generates a waveform. In electrical engineering terms, it&#39;s a device that outputs an electrical current with varying voltage. If you plot the voltage over time, you get a regular wave in a particular form, such
 as a sine, square, triangle or sawtooth. 
An oscillator is the most basic type of synthesizer. Analog synths use electrical circuits to output a sound wave. Digital synthesizers do the same thing, but with software. 
You can create a pretty neat sounding instrument by combining the outputs of multiple oscillators. For example, if you have three oscillators oscillating at a frequency of 440Hz (concert A pitch), but each of them has a different waveform (saw, square, sine)
 you get a very interesting, layered sound.  
But before we get too deep into this subject, let&#39;s briefly explore the physics of sound. 
The Physics of Sound
Sound happens when air pressure changes on your ear drum. When you clap in an empty room, pressure waves bounce all over the place and dance on your eardrum. The changes in pressure are detected continuously by your ear.
 
Digitally, “pressure” is referred to by a scalar value called amplitude. 
The amplitude (loudness) of the wave is measured thousands of times per second (44,100 times per second on CDs). Every measurement of pressure (aka
amplitude) is called a sample—CDs are recorded with 44,100 samples per second, each w</itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/articles/Generating-Sound-Waves-with-C-Wave-Oscillators</link>
      <pubDate>Mon, 03 May 2010 17:24:35 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/articles/Generating-Sound-Waves-with-C-Wave-Oscillators</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/c4f/images/10006604_100.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/c4f/images/10006604_220.jpg" height="165" width="220"></media:thumbnail>      
      <dc:creator>Dan Waters</dc:creator>
      <itunes:author>Dan Waters</itunes:author>
      <slash:comments>4</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/articles/Generating-Sound-Waves-with-C-Wave-Oscillators/RSS</wfw:commentRss>
      <category>Audio</category>
      <category>DirectX</category>
      <category>Media</category>
    </item>
  <item>
      <title>XNA Effects – ASCII Art in 3D</title>
      <description><![CDATA[
<p>In this article, I'll demonstrate how to create a post-processing effect to turn 3D renders into ASCII Art.
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="157">
<p><strong>Louis Ingenthron <br>
FV Productions</strong></p>
</td>
<td valign="top" width="481">
<p><b>Code It:</b> <a href="http://xnaascii.codeplex.com/">http://xnaascii.codeplex.com/</a>
<br>
<b>Run It:</b> <a href="http://xnaascii.codeplex.com/">http://xnaascii.codeplex.com/</a></p>
<p><b>Difficulty:</b> Intermediate <br>
<b>Time Required:</b> 1-4 hours <br>
<b>Cost:</b> FREE <br>
<b>Software Needed: </b><a href="http://www.microsoft.com/express/download/">Visual C# Express</a>,
<a href="http://msdn.microsoft.com/en-us/netframework/default.aspx">.NET Framework 3.5</a>,
<a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=80782277-D584-42D2-8024-893FCD9D3E82&amp;displaylang=en">
XNA Game Studio 3.1</a> <br>
<b>Hardware:</b> Windows PC</p>
</td>
</tr>
</tbody>
</table>
</p>
<h3>Introduction</h3>
<p>Back in November of 2009, I was met with an interesting challenge. Those of you who frequent the XNA Community Forums have probably heard of Nick Gravelyn. He was an XNA MVP, and now he works for the XNA team. He started a little contest called xna7day,
 which was designed to challenge developers to make a game in 7 days using a pre-defined theme.</p>
<p>The theme in November was “Text Based” and its rule was that you were only allowed to use text in the visuals of your game. I saw some of the cool stuff other developers were working on, including one that looked like it had text characters that could walk
 and talk, like people. But my mind immediately went to a different solution: I wanted to make a game that was fully 3D (effectively breaking the rule of rendering text), but then post-process the render into ASCII art, so it would look like it was text.</p>
<p>In this article, I'm going to show you how to do just that:</p>
<p align="center"><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9994745/clip_image002_2.jpg"><img title="clip_image002" border="0" alt="clip_image002" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9994745/clip_image002_thumb.jpg" width="240" height="180"></a><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9994745/clip_image004_2.jpg"><img title="clip_image004" border="0" alt="clip_image004" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9994745/clip_image004_thumb.jpg" width="240" height="180"></a></p>
<h4>Setup</h4>
<p>Alright, let's dive right in. Open up the base project. It should compile and run as is. It's a simple, if ugly, first-person shooter. Play through the first level. Go ahead, I'll wait. Bonus points to anyone who recognizes the level design!</p>
<p>Okay, got a playthrough? Let's start! I separated this into three projects so the ASCII stuff can be extracted into other games. We'll be doing most of our work in the ASCII_Renderer project, so let's open that up and add a new class to the Source\ascii
 folder called “Renderer.” I use the namespace “ASCII3D” for all files in this project, so get rid of the extra folder sub-namespaces. Add these using statements, too:</p>
<p><b>C# </b></p>
<pre class="csharpcode"><span class="kwrd">using</span> Microsoft.Xna.Framework;
<span class="kwrd">using</span> Microsoft.Xna.Framework.Content;
<span class="kwrd">using</span> Microsoft.Xna.Framework.Graphics; </pre>
<style type="text/css">
<!--
.csharpcode, .csharpcode 
	{font-size:small;
	color:black;
	font-family:consolas,"Courier New",courier,monospace;
	background-color:#ffffff}
.csharpcode 
	{margin:0em}
.csharpcode .rem
	{color:#008000}
.csharpcode .kwrd
	{color:#0000ff}
.csharpcode .str
	{color:#006080}
.csharpcode .op
	{color:#0000c0}
.csharpcode .preproc
	{color:#cc6633}
.csharpcode .asp
	{background-color:#ffff00}
.csharpcode .html
	{color:#800000}
.csharpcode .attr
	{color:#ff0000}
.csharpcode .alt
	{background-color:#f4f4f4;
	width:100%;
	margin:0em}
.csharpcode .lnum
	{color:#606060}
-->
</style>
<p>This is going to be a post-processing effect, so we'll try to make it portable. Add the following empty function declarations:</p>
<p><b>C# </b></p>
<pre class="csharpcode"><span class="kwrd">public</span> Renderer(ContentManager content, <span class="kwrd">int</span> xRes, <span class="kwrd">int</span> yRes)
{ }

<span class="kwrd">public</span> <span class="kwrd">void</span> StartScene()
{ }

<span class="kwrd">public</span> <span class="kwrd">void</span> EndScene()
{ }</pre>
<p>The constructor takes three arguments: The ContentManager, which we will use to load in our font and post-processing shader, and the resolution variables, which will basically tell us how many lines of text to draw and how many characters in each line. Since
 we have these prototyped, we'll make our only edits to the ASCIIFPS project in the Source\Game1.cs file. But first, we need to define and initialize a new Renderer object. Add a new class variable:<b></b></p>
<p><b>C# <br>
</b></p>
<pre class="csharpcode"><span class="rem">/// &lt;summary&gt;</span>
<span class="rem">/// This is what handles the ASCII conversion</span>
<span class="rem">/// &lt;/summary&gt;</span>
<span class="kwrd">private</span> Renderer renderer; </pre>
<p>And at the end of the LoadContent function:</p>
<p><b>C# <br>
</b></p>
<pre class="csharpcode"><span class="rem">// and initialize our ASCII renderer</span>
<span class="rem">// the variables we pass make each character</span>
<span class="rem">// appx 10x14 which seems to be the smallest</span>
<span class="rem">// readable size</span>
renderer = <span class="kwrd">new</span> Renderer(Content, Global.ScreenWidth/10,Global.ScreenHeight/14);</pre>
<p></p>
<p>Finally, call the BeginScene and EndScene functions. Modify Game1's Draw function to look like this:<b></b></p>
<p><b>C# <br>
</b></p>
<pre class="csharpcode"><span class="kwrd">protected</span> <span class="kwrd">override</span> <span class="kwrd">void</span> Draw(GameTime gameTime)
{
    <span class="rem">// notice we only wrap StartScene and</span>
    <span class="rem">// EndScene if we are UsingASCII</span>
    <span class="kwrd">if</span> (UsingASCII)
        renderer.StartScene();

    currentState.Draw(gameTime);

    <span class="kwrd">if</span> (UsingASCII)
        renderer.EndScene();

    <span class="kwrd">base</span>.Draw(gameTime);
}</pre>
<p>The Boolean variable UsingASCII is defined for us. It defaults to false and can be toggled any time in-game by pressing the [M] key. If you want to default it to true for testing purposes, just change its value in Game1's Initialize function. At this point,
 the Renderer is all hooked up, so changes will go right in.</p>
<p>I skimmed over the other classes earlier in the article, but I need to touch on a few of them. Almost everything in GlobalModules is fairly standard utility stuff. We'll be using it, so you might want to glance at the Global class. The ASCIIFPS has the FPS
 engine in it and is almost entirely irrelevant to this article, except that it offers a fun test-bed for our effect. Feel free to go through the code, but I'll warn you: I wrote it for a 7-day contest, so some of it looks like gibberish and is only incidentally
 functional. Finally, we have the ASCII_Renderer project. This already has two files in it: BitmapFontGenerator and Letter. The latter are for generating a bitmap font map that we'll use in a bit.</p>
<p>The functionality isn't specific to this article, since any artist could easily make this. But I'm no artist, which is why I had the computer do it for me. Basically, BitmapFontGenerator has a static function that will take a texture of letters (see the
 Content project in ASCII_Renderer), trim them, sort them by how much they fill their space, and print them into a new Texture for our functions. Feel free to read through the code for this process; I commented it pretty well.</p>
<h4>Post-Processing Basics</h4>
<p>We need to cover the basics of post-processing before we start coding the next part. When post-processing a scene, you first render the entire scene off-screen on a RenderTarget. Then, you can apply any effects you want to the resolved texture before putting
 it on the screen. That's it. Here's how in XNA:<b></b></p>
<p><b>C# <br>
</b></p>
<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">class</span> Renderer
{
    <span class="kwrd">private</span> RenderTarget2D SrcImage;

    <span class="kwrd">public</span> Renderer(ContentManager content, <span class="kwrd">int</span> xRes, <span class="kwrd">int</span> yRes)
    {
        SrcImage = <span class="kwrd">new</span> RenderTarget2D(Global.Graphics, 
            xRes, yRes, 1, SurfaceFormat.Color);
    }

    <span class="kwrd">public</span> <span class="kwrd">void</span> StartScene()
    {
        Global.Graphics.SetRenderTarget(0, SrcImage);
        Global.Graphics.Clear(Color.Black);
    }

    <span class="kwrd">public</span> <span class="kwrd">void</span> EndScene()
    {
        Global.Graphics.SetRenderTarget(0, <span class="kwrd">null</span>);
        Global.Graphics.Clear(Color.Black);

        <span class="rem">// TODO: draw the texture from the RenderTarget</span>
    }
}</pre>
<p>We create the RenderTarget2D we need in the constructor. Notice that the size of the RenderTarget is the same as the number of ASCII characters we plan to draw on screen. I'll explain that in the next section. In the StartScene function, we set the RenderTarget
 on the device so that all draw calls will actually draw to it. Then we clear the buffer, because RenderTargets' content from frame to frame is undefined. In EndScene, the RenderTarget is set to null, which is DirectX's way of saying “use the screen's framebuffer.”
 Now we need to actually draw the rendered image. XNA requires shaders for all draw calls, even if they're veiled by BasicEffect and SpriteBatch. We need to create a very simple shader to draw the texture to screen. Create a new Effect file in ASCII_Renderer's
 Content project and name it TextEffect. We'll start it out with this:<b></b></p>
<p><b>HLSL <br>
</b></p>
<pre class="csharpcode">texture2D sourceTex;
sampler2D SourceTextureSampler = sampler_state
{
    Texture = &lt;sourceTex&gt;;
    MinFilter = point;
    MagFilter = point;
    MipFilter = point;
    AddressU = wrap;
    AddressV = wrap;
};

<span class="kwrd">struct</span> VertexShaderInput
{
    float4 Position : POSITION0;
    float2 TexCoords : TEXCOORD0;
};

<span class="kwrd">struct</span> VertexShaderOutput
{
    float4 Position : POSITION0;
    float2 TexCoords : TEXCOORD0;
};

VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
{
    VertexShaderOutput output;
    
    output.Position = input.Position;
    output.TexCoords = input.TexCoords;

    <span class="kwrd">return</span> output;
}

float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
{
    float4 sourceColor = tex2D(SourceTextureSampler,input.TexCoords);
    
    <span class="kwrd">return</span> sourceColor;
}

technique Technique1
{
    pass Pass1
    {
        VertexShader = compile vs_2_0 VertexShaderFunction();
        PixelShader = compile ps_2_0 PixelShaderFunction();
    }
}</pre>
<p>There are a couple things I want to note about the base shader. First, notice that we use point filtering. I'll explain why in the next section, but it's important to see where we did it. Next, notice that we took out all the default transformation matrices.
 We're going to be drawing a single full screen quad, so we can just pass in the coordinates in screen-space—no processing required. Now we need to make a few changes to the Renderer class to use this Effect and draw the rendered game. First, we need to add
 some new class variables:<b></b></p>
<p><b>C# <br>
</b></p>
<pre class="csharpcode"><span class="kwrd">private</span> Effect effect;

<span class="kwrd">private</span> VertexPositionTexture[] verts;
<span class="kwrd">private</span> VertexDeclaration vd;</pre>
<p></p>
<p>The vertices are going to be for a simple quad that takes up the whole screen. They should be initialized in the LoadContent function like this:<b>
</b></p>
<p><b>C# <br>
</b></p>
<pre class="csharpcode">effect = content.Load&lt;Effect&gt;(<span class="str">&quot;TextEffect&quot;</span>);

verts = <span class="kwrd">new</span> VertexPositionTexture[6];
verts[0] = <span class="kwrd">new</span> VertexPositionTexture(
    <span class="kwrd">new</span> Vector3(-1, -1, 0), <span class="kwrd">new</span> Vector2(0, 1));
verts[1] = <span class="kwrd">new</span> VertexPositionTexture(
    <span class="kwrd">new</span> Vector3(1, -1, 0), <span class="kwrd">new</span> Vector2(1, 1));
verts[2] = <span class="kwrd">new</span> VertexPositionTexture(
    <span class="kwrd">new</span> Vector3(-1, 1, 0), <span class="kwrd">new</span> Vector2(0, 0));
verts[3] = verts[1];
verts[4] = verts[2];
verts[5] = <span class="kwrd">new</span> VertexPositionTexture(
    <span class="kwrd">new</span> Vector3(1, 1, 0), <span class="kwrd">new</span> Vector2(1, 0));

vd = <span class="kwrd">new</span> VertexDeclaration(
    Global.Graphics, VertexPositionTexture.VertexElements);</pre>
<p></p>
<p>And finally, we add our draw code to the Draw function:<b></b></p>
<p><b>C# <br>
</b></p>
<pre class="csharpcode">effect.Begin();
effect.CurrentTechnique.Passes[0].Begin();

effect.Parameters[<span class="str">&quot;sourceTex&quot;</span>].SetValue(SrcImage.GetTexture());
effect.CommitChanges();
Global.Graphics.RenderState.CullMode = CullMode.None;

Global.Graphics.VertexDeclaration = vd;
Global.Graphics.DrawUserPrimitives&lt;VertexPositionTexture&gt;
     (PrimitiveType.TriangleList, verts, 0, 2);

effect.CurrentTechnique.Passes[0].End();
effect.End();</pre>
<p></p>
<p>We set the texture we got from the RenderTarget, turn off culling (what would be culled in this geometry?), and draw it. Run the project. You should be able to toggle a difference in-game with the [M] key.<b></b></p>
<p><b><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9994745/clip_image006_2.jpg"><img title="clip_image006" border="0" alt="clip_image006" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9994745/clip_image006_thumb.jpg" width="322" height="242"></a></b></p>
<h3>Drawing Some Text</h3>
<p>“Okay,” you say, “it runs at a lower resolution with the [M] key. So what?” Remember what we set the resolution to in the RenderTarget? Yes, every pixel on this low-resolution version will be a character in the final image. How do we turn these big pixels
 into characters? First we need to define a texture bitmap font. Let's add a Texture2D class variable to Renderer and a const int for the BitmapFontGenerator:
</p>
<p><b>C# <br>
</b></p>
<pre class="csharpcode"><span class="kwrd">public</span> Texture2D text; 
<span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> NUM_SLOTS = 256;</pre>
<p></p>
<p>Then we'll use the BitmapFontGenerator to construct this texture:</p>
<p><b>C# <br>
</b></p>
<pre class="csharpcode">text = BitmapFontGenerator.GenerateTextTexture(content, NUM_SLOTS);</pre>
<p></p>
<p>Okay, that's all for now. Let's go back to the TextEffect.fx. We need to add a few variables:<b></b></p>
<p><b>HLSL <br>
</b></p>
<pre class="csharpcode">float2 dstLetterSize;

<span class="kwrd">int</span> numLetters;

texture2D textTex;
sampler2D TextTextureSampler = sampler_state
{
    Texture = &lt;textTex&gt;;
    MinFilter = point;
    MagFilter = point;
    MipFilter = point;
    AddressU = wrap;
    AddressV = wrap;
};</pre>
<p>The variable “dstLetterSize” will tell us how big the letters on the screen are. The “numLetters” variable will tell us how many letters are in the font texture. And then there's the font texture itself. Here's how we draw actual characters in the Pixel
 Shader:<b></b></p>
<p><b>HLSL <br>
</b></p>
<pre class="csharpcode">float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
{
     float4 sourceColor = tex2D(SourceTextureSampler,input.TexCoords);
    
     float2 texCoords = float2(
          input.TexCoords.x-((<span class="kwrd">int</span>)
               (input.TexCoords.x/dstLetterSize.x)*dstLetterSize.x),
          input.TexCoords.y-((<span class="kwrd">int</span>)
               (input.TexCoords.y/dstLetterSize.y)*dstLetterSize.y));
     texCoords /= dstLetterSize;
     texCoords.x /= numLetters;
    
     float4 letterColor = tex2D(TextTextureSampler,texCoords);
    
     <span class="kwrd">return</span> letterColor;
}</pre>
<p></p>
<p>We've already seen the source color line. The next line will get the offset into the letter in letter size by subtracting the rounded-down (or integer-casted) texture coordinates scaled down. The line after that scales it back up to a 0-1 range. So now we
 have the new variable texCoords that is filled with the texture coordinates of the letter in 0-1 terms. We divide the x by numLetters because our texture is one long horizontal line of letters. Finally we get the letter color with these new texture coordinates.
 This letter color is grayscale, and when multiplied by the source color, we've assured that each letter is rendered in its own slot with the color from the original 3D render. The last thing we have to do is set those effect variables we defined from Renderer's
 EndScene function. Where we once just set the source texture, we now set these:<b></b></p>
<p><b>C# <br>
</b></p>
<pre class="csharpcode">effect.Parameters[<span class="str">&quot;dstLetterSize&quot;</span>].SetValue(
     <span class="kwrd">new</span> Vector2(1.0f/(<span class="kwrd">float</span>)SrcImage.Width, 1.0f/(<span class="kwrd">float</span>)SrcImage.Height));
effect.Parameters[<span class="str">&quot;numLetters&quot;</span>].SetValue(NUM_SLOTS);
effect.Parameters[<span class="str">&quot;sourceTex&quot;</span>].SetValue(SrcImage.GetTexture());
effect.Parameters[<span class="str">&quot;textTex&quot;</span>].SetValue(text);
effect.CommitChanges();</pre>
<p></p>
<p>Most of these are self explanatory, but the dstLetterSize is a bit more complicated. To get the size of the letter in the 0-1 texture space, you take the total size (0 to 1) divided by the number of letters in that axis which, in our case, is the RenderTarget
 size.<b></b></p>
<p><b></b></p>
<p><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9994745/clip_image008_2.jpg"><img title="clip_image008" border="0" alt="clip_image008" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9994745/clip_image008_thumb.jpg" width="322" height="242"></a></p>
<h3>Wheel of Fortune</h3>
<p>‘M's aren't very interesting. In traditional ASCII art, the whole point is that you use characters that take more space or less space to handle shading. Let's add this code after the multiplication of the texCoords.x:<b></b></p>
<p><b>HLSL <br>
</b></p>
<pre class="csharpcode"><span class="kwrd">float</span> lum = (sourceColor.r&#43;sourceColor.g&#43;sourceColor.b)/3.0; 
<span class="kwrd">float</span> val = max(fullValueColor.r,
     max(fullValueColor.g,fullValueColor.b));
    
<span class="kwrd">int</span> ind = ((numLetters-1)-
     max(0,min((numLetters-1),(<span class="kwrd">int</span>)(lum*numLetters))));

texCoords.x &#43;= ind*(1.0/numLetters);</pre>
<p></p>
<p><b></b></p>
<p>The first line gets the luminosity of the source color. The next gets the value. The next line gets the letter index from the luminosity. Subtracting it from (numLetters-1) reverses the index, because we want luminosity=1 to equate to index=0, because that
 has the letter that takes up the most space. Run the game. You'll see it now shows value, but it's still pretty hard to tell what's on the screen:</p>
<p><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9994745/clip_image010_2.jpg"><img title="clip_image010" border="0" alt="clip_image010" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9994745/clip_image010_thumb.jpg" width="322" height="242"></a></p>
<p>The last thing we can do is colorize it. You could just multiply it by the source color and get something like this…</p>
<p><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9994745/clip_image012_2.jpg"><img title="clip_image012" border="0" alt="clip_image012" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9994745/clip_image012_thumb.jpg" width="322" height="242"></a></p>
<p>…but everything looks too dark because the source color still has its value. Plus we're already practically multiplying it by choosing the letter. So we need to get the full value color first:</p>
<p><b></b></p>
<p><b>HLSL <br>
</b></p>
<pre class="csharpcode">float4 fullValueColor = sourceColor * (1.0/val);</pre>
<p></p>
<p>We just multiply the original color by the inverse of the value. And then multiply that fullValueColor by the letter color in the return:<b></b></p>
<p><b>HLSL <br>
</b></p>
<pre class="csharpcode"><span class="kwrd">return</span> fullValueColor * letterColor;</pre>
<p></p>
<p>That should produce a nice result:</p>
<p><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9994745/clip_image014_2.jpg"><img title="clip_image014" border="0" alt="clip_image014" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9994745/clip_image014_thumb.jpg" width="407" height="305"></a><b></b></p>
<h3>Conclusion</h3>
<p>And there it is! We have a real-time 3D render transformed into ASCII art. It's difficult to see and it's not very useful, but it's sure neat, eh? Why not add it as an unlockable easter egg in your next XBL Indie Game? I'm looking forward to seeing how people
 use this effect! If you use it, please <a href="mailto:louisingenthron@fvproductions.org">
send me an email</a> with a screenshot!</p>
<h3>About The Author</h3>
<p>Louis Ingenthron is a Game Developer in Orlando, FL. He works on commercial Console and PC titles, but runs his own Indie Games company, FV Productions, on the side. He is best known for his open source XNA rhythm game Unsigned and specializes in real-time
 Graphics programming. He has been working with XNA since the 2.0 Beta and with .NET C# for just as long. He is also familiar with several other development languages, such as C, C&#43;&#43;, and Java. Occasionally, he can even be found doing web development and Flash.
 Louis also writes for MSDN's Coding4Fun website, contributing articles on a monthly basis.</p>
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:bfa52c016c3640c7a8699e7600c99302">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/articles/XNA-Effects--ASCII-Art-in-3D</comments>
      <itunes:summary>
In this article, I&#39;ll demonstrate how to create a post-processing effect to turn 3D renders into ASCII Art.




Louis Ingenthron 
FV Productions 


Code It: http://xnaascii.codeplex.com/

Run It: http://xnaascii.codeplex.com/ 
Difficulty: Intermediate 
Time Required: 1-4 hours 
Cost: FREE 
Software Needed: Visual C# Express,
.NET Framework 3.5,

XNA Game Studio 3.1 
Hardware: Windows PC 




 
Introduction
Back in November of 2009, I was met with an interesting challenge. Those of you who frequent the XNA Community Forums have probably heard of Nick Gravelyn. He was an XNA MVP, and now he works for the XNA team. He started a little contest called xna7day,
 which was designed to challenge developers to make a game in 7 days using a pre-defined theme. 
The theme in November was “Text Based” and its rule was that you were only allowed to use text in the visuals of your game. I saw some of the cool stuff other developers were working on, including one that looked like it had text characters that could walk
 and talk, like people. But my mind immediately went to a different solution: I wanted to make a game that was fully 3D (effectively breaking the rule of rendering text), but then post-process the render into ASCII art, so it would look like it was text. 
In this article, I&#39;m going to show you how to do just that: 
 
Setup
Alright, let&#39;s dive right in. Open up the base project. It should compile and run as is. It&#39;s a simple, if ugly, first-person shooter. Play through the first level. Go ahead, I&#39;ll wait. Bonus points to anyone who recognizes the level design! 
Okay, got a playthrough? Let&#39;s start! I separated this into three projects so the ASCII stuff can be extracted into other games. We&#39;ll be doing most of our work in the ASCII_Renderer project, so let&#39;s open that up and add a new class to the Source\ascii
 folder called “Renderer.” I use the namespace “ASCII3D” for all files in this project, so get rid of the extra folder sub-namespaces. Add these using statemen</itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/articles/XNA-Effects--ASCII-Art-in-3D</link>
      <pubDate>Wed, 14 Apr 2010 13:00:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/articles/XNA-Effects--ASCII-Art-in-3D</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/c4f/images/9994745_100.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/c4f/images/9994745_220.jpg" height="165" width="220"></media:thumbnail>      
      <dc:creator>Louis Ingenthron </dc:creator>
      <itunes:author>Louis Ingenthron </itunes:author>
      <slash:comments>11</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/articles/XNA-Effects--ASCII-Art-in-3D/RSS</wfw:commentRss>
      <category>Gaming</category>
      <category>Media</category>
      <category>XNA</category>
      <category>Mash Up</category>
      <category>XNA framework</category>
    </item>
  <item>
      <title>Windows Azure Lessons Learned: Archetype</title>
      <description><![CDATA[
<p>In this episode I talk to Danny Riddell and Luigi Rosso, CEO and CTO of <a shape="rect" href="http://www.archetype-inc.com/" target="_blank" shape="rect">
Archetype</a>.&nbsp; Archetype is a rich internet application (RIA) development and design shop.&nbsp; They provide both products and development/design services using Silverlight and Flash with .NET and SQL Server back-ends.&nbsp;
</p>
<p>Archetype saw the trend around video and media related solutions moving to the cloud and took the initiative to build out their end-to-end solution.&nbsp; They had a couple of projects where they had to be able to handle large scale very quickly.&nbsp; In general
 they had trouble scaling up quickly and then back down once the project was over. Windows Azure gave them that capability in both their services and product businesses.</p>
<p>One of their products is a media content management system called Archetype Media Platform (AMP) that allows enterprises to control all their media assets.&nbsp; Danny and Luigi spent some time here showing off some of the video content management and editing
 capabilities of the AMP solution running on Windows Azure.</p>
<p>Towards the end of the video Luigi shares some of his experiences porting to Windows Azure (first cut working in less than a week).&nbsp; The solution architecture use web roles for the front end and web services as well as worker roles for various activities
 in the background (e.g. encoding or analyzing media).&nbsp; SQL Azure is used for content metadata and Windows Azure blob storage for the video files.</p>
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:dcdf30a755ca42199b9e9deb00102026">]]></description>
      <comments>http://channel9.msdn.com/Blogs/benriga/Windows-Azure-Lessons-Learned-Archetype</comments>
      <itunes:summary>
In this episode I talk to Danny Riddell and Luigi Rosso, CEO and CTO of 
Archetype.&amp;nbsp; Archetype is a rich internet application (RIA) development and design shop.&amp;nbsp; They provide both products and development/design services using Silverlight and Flash with .NET and SQL Server back-ends.&amp;nbsp;
 
Archetype saw the trend around video and media related solutions moving to the cloud and took the initiative to build out their end-to-end solution.&amp;nbsp; They had a couple of projects where they had to be able to handle large scale very quickly.&amp;nbsp; In general
 they had trouble scaling up quickly and then back down once the project was over. Windows Azure gave them that capability in both their services and product businesses. 
One of their products is a media content management system called Archetype Media Platform (AMP) that allows enterprises to control all their media assets.&amp;nbsp; Danny and Luigi spent some time here showing off some of the video content management and editing
 capabilities of the AMP solution running on Windows Azure. 
Towards the end of the video Luigi shares some of his experiences porting to Windows Azure (first cut working in less than a week).&amp;nbsp; The solution architecture use web roles for the front end and web services as well as worker roles for various activities
 in the background (e.g. encoding or analyzing media).&amp;nbsp; SQL Azure is used for content metadata and Windows Azure blob storage for the video files. 
</itunes:summary>
      <itunes:duration>1371</itunes:duration>
      <link>http://channel9.msdn.com/Blogs/benriga/Windows-Azure-Lessons-Learned-Archetype</link>
      <pubDate>Sat, 27 Mar 2010 00:30:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/benriga/Windows-Azure-Lessons-Learned-Archetype</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/100/517086_100x75.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/220/517086_220x165.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/6/8/0/7/1/5/AzureLessonsLearnedArchetype_320_ch9.png" height="240" width="320"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/6/8/0/7/1/5/AzureLessonsLearnedArchetype_512_ch9.png" height="384" width="512"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/6/8/0/7/1/5/AzureLessonsLearnedArchetype_85_ch9.png" height="64" width="85"></media:thumbnail>
      <media:group>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/8/0/7/1/5/AzureLessonsLearnedArchetype_2MB_ch9.wmv" expression="full" duration="1371" fileSize="427677651" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/8/0/7/1/5/AzureLessonsLearnedArchetype_ch9.mp3" expression="full" duration="1371" fileSize="10974207" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/8/0/7/1/5/AzureLessonsLearnedArchetype_ch9.mp4" expression="full" duration="1371" fileSize="226166632" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/8/0/7/1/5/AzureLessonsLearnedArchetype_ch9.wma" expression="full" duration="1371" fileSize="11104751" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/8/0/7/1/5/AzureLessonsLearnedArchetype_ch9.wmv" expression="full" duration="1371" fileSize="286584721" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/8/0/7/1/5/AzureLessonsLearnedArchetype_Zune_ch9.wmv" expression="full" duration="1371" fileSize="183944773" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://ecn.channel9.msdn.com/o9/ch9/6/8/0/7/1/5/AzureLessonsLearnedArchetype_ch9.wmv" length="286584721" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Ben Riga</dc:creator>
      <itunes:author>Ben Riga</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/benriga/Windows-Azure-Lessons-Learned-Archetype/RSS</wfw:commentRss>
      <category>Azure Lessons Learned</category>
      <category>Media</category>
      <category>SQL Azure</category>
      <category>Windows Azure</category>
    </item>
  <item>
      <title>FFT and oscilloscopes in Silverlight</title>
      <description><![CDATA[
<p>This is something I've wanted to see for a very long time.&nbsp; A managed mp3 player with a bunch of visual playback features.&nbsp;
<a href="http://salusemediakit.codeplex.com/">Ahura Mazda created the Saluse Media Kit for Silverlight</a> and it is awesome!&nbsp; There is a demo over at
<a title="http://prefix.teddywino.com/post/SilverlightMediaKitLiveDemo.aspx" href="http://prefix.teddywino.com/post/SilverlightMediaKitLiveDemo.aspx">
http://prefix.teddywino.com/post/SilverlightMediaKitLiveDemo.aspx</a>.</p>
<p><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9962132/image_2.png"><img title="image" border="0" alt="image" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9962132/image_thumb.png" width="240" height="99"></a></p>
<p>Ahura based his MediaStreamSource off a MSDN example called the <a href="http://code.msdn.microsoft.com/ManagedMediaHelpers">
ManagedMediaHelpers</a>.</p>
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:a0ea5054008b4e6aa1b09e7600ca264a">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/blog/FFT-and-oscilloscopes-in-Silverlight</comments>
      <itunes:summary>
This is something I&#39;ve wanted to see for a very long time.&amp;nbsp; A managed mp3 player with a bunch of visual playback features.&amp;nbsp;
Ahura Mazda created the Saluse Media Kit for Silverlight and it is awesome!&amp;nbsp; There is a demo over at

http://prefix.teddywino.com/post/SilverlightMediaKitLiveDemo.aspx. 
 
Ahura based his MediaStreamSource off a MSDN example called the 
ManagedMediaHelpers. 
</itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/blog/FFT-and-oscilloscopes-in-Silverlight</link>
      <pubDate>Thu, 11 Feb 2010 15:49:22 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/blog/FFT-and-oscilloscopes-in-Silverlight</guid>      
      <dc:creator>Clint Rutkas</dc:creator>
      <itunes:author>Clint Rutkas</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/blog/FFT-and-oscilloscopes-in-Silverlight/RSS</wfw:commentRss>
      <category>Media</category>
      <category>Silverlight</category>
      <category>C4FNews</category>
    </item>
  <item>
      <title>Creating torn images</title>
      <description><![CDATA[
<p><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9951019/tornphotodemo5_5B1_5D_2.jpg"><img title="tornphotodemo5[1]" border="0" alt="tornphotodemo5[1]" align="right" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9951019/tornphotodemo5_5B1_5D_thumb.jpg" width="240" height="165"></a>
 Adam Kinney did a pretty neat port of a flash application that <a href="http://adamkinney.wordpress.com/2010/01/09/image-blitting-in-silverlight-with-writeablebitmapex/">
creates an effect that gives an image like it was torn and crumpled up in Silverlight using the WriteableBitmapEx.</a></p>
<p>Blitting is the act of blending multiple images together.&nbsp; More about the <a href="http://en.wikipedia.org/wiki/Bit_blit">
BLIT operation can be found at Wikipedia</a>.</p>
<p>Adam used the Blit method with different blend modes to achieve the effect from the standard image.&nbsp; With masking, alpha blending, and the multiply mode combined with a few masks and textures, he was able start with a standard image and give it that “pulled
 out of my pocket” effect.</p>
<p>The WriteableBitmapEx team over at <a title="http://writeablebitmapex.codeplex.com/" href="http://writeablebitmapex.codeplex.com/">
http://writeablebitmapex.codeplex.com/</a> really did a great job with their library too!</p>
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:67234425fd154bafb6629e7600ca440f">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/blog/Creating-torn-images</comments>
      <itunes:summary>

 Adam Kinney did a pretty neat port of a flash application that 
creates an effect that gives an image like it was torn and crumpled up in Silverlight using the WriteableBitmapEx. 
Blitting is the act of blending multiple images together.&amp;nbsp; More about the 
BLIT operation can be found at Wikipedia. 
Adam used the Blit method with different blend modes to achieve the effect from the standard image.&amp;nbsp; With masking, alpha blending, and the multiply mode combined with a few masks and textures, he was able start with a standard image and give it that “pulled
 out of my pocket” effect. 
The WriteableBitmapEx team over at 
http://writeablebitmapex.codeplex.com/ really did a great job with their library too! 
</itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/blog/Creating-torn-images</link>
      <pubDate>Wed, 20 Jan 2010 16:28:04 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/blog/Creating-torn-images</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/c4f/images/9951019_100.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/c4f/images/9951019_220.jpg" height="165" width="220"></media:thumbnail>      
      <dc:creator>Clint Rutkas</dc:creator>
      <itunes:author>Clint Rutkas</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/blog/Creating-torn-images/RSS</wfw:commentRss>
      <category>Media</category>
      <category>Silverlight</category>
      <category>C4FNews</category>
      <category>image manipulation</category>
    </item>
  <item>
      <title>Video ambient lighting effects</title>
      <description><![CDATA[
<p><a href="http://fun3md.blogspot.com/2009/12/overview-of-my-setup.html">Fun3 MD created a DIY version with an Arduino</a> of the
<a href="http://www.microsofttranslator.com/BV.aspx?ref=Internal&amp;a=http%3a%2f%2fwww.vdr-wiki.de%2fwiki%2findex.php%2fAtmo-plugin">
AtmoLight</a>, which is a clone of the Philip Amblight system.&nbsp; Awesome job of leveraging a pre-existing technology instead of re-inventing the wheel.</p>
<p></p>
<div id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:9534d779-09f3-487d-a911-6f15d8d26a23" class="wlWriterEditableSmartContent">
<div id="193e7b7a-5cd9-40d2-badc-511024f789ef">
<div><a href="http://www.youtube.com/watch?v=i4JnrAwullI&amp;hl=en_US&amp;fs=1&amp;rel=0" target="_new"><img src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9945861/video3e08c3c3474a.jpg" alt=""></a></div>
</div>
</div>
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:ce789e9195784b9a90639e7600ca6a4e">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/blog/Video-ambient-lighting-effects</comments>
      <itunes:summary>
Fun3 MD created a DIY version with an Arduino of the

AtmoLight, which is a clone of the Philip Amblight system.&amp;nbsp; Awesome job of leveraging a pre-existing technology instead of re-inventing the wheel. 
 





</itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/blog/Video-ambient-lighting-effects</link>
      <pubDate>Fri, 08 Jan 2010 16:12:30 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/blog/Video-ambient-lighting-effects</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/c4f/images/9945861_100.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/c4f/images/9945861_220.jpg" height="165" width="220"></media:thumbnail>      
      <dc:creator>Clint Rutkas</dc:creator>
      <itunes:author>Clint Rutkas</itunes:author>
      <slash:comments>1</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/blog/Video-ambient-lighting-effects/RSS</wfw:commentRss>
      <category>Hardware</category>
      <category>Media</category>
      <category>Just Neat</category>
    </item>
  <item>
      <title>The Coding4Fun Show: WPF MediaKit with Jeremiah Morrill</title>
      <description><![CDATA[<span id="ctl00_MainPlaceHolder_Starter_BodyLabel"><span id="ctl00_MainPlaceHolder_Starter_BodyLabel">In this episode of the
<a shape="rect" href="http://channel9.msdn.com/shows/Coding4FunTV/">Coding4Fun Show</a>,
<a shape="rect" href="http://www.brianpeek.com/">Brian Peek</a> interviews <a shape="rect" target="_blank" href="http://jmorrill.hjtcentral.com/">
Jeremiah Morrill</a> who has </span></span>written <a shape="rect" target="_blank" href="http://wpfmediakit.codeplex.com/">
WPF MediaKit</a>, an amazing library to quickly build DirectShow and MediaFoundation media player controls in WPF.&nbsp; It's amazingly powerful and, as a developer, can be used with just a few lines of XAML.&nbsp; In fact, you can create a full-blown DVD player or webcam
 capture control in your application each with a single XAML tag!&nbsp; Learn all about this great project, how it was written, and how to use it in your own creations.<br /><br />And note that the output of the WPF MediaKit player is perfectly smooth in realtime.&nbsp; The capture application &#43; encoding made for a &quot;stuttery&quot; output that's definitely not seen when running these demos in realtime.<br /> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:621726aa50d84286b7d49deb00235f8b">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/tv/The-Coding4Fun-Show-WPF-MediaKit-with-Jeremiah-Morrill</comments>
      <itunes:summary>In this episode of the
Coding4Fun Show,
Brian Peek interviews 
Jeremiah Morrill who has written 
WPF MediaKit, an amazing library to quickly build DirectShow and MediaFoundation media player controls in WPF.&amp;nbsp; It&#39;s amazingly powerful and, as a developer, can be used with just a few lines of XAML.&amp;nbsp; In fact, you can create a full-blown DVD player or webcam
 capture control in your application each with a single XAML tag!&amp;nbsp; Learn all about this great project, how it was written, and how to use it in your own creations.And note that the output of the WPF MediaKit player is perfectly smooth in realtime.&amp;nbsp; The capture application &amp;#43; encoding made for a &amp;quot;stuttery&amp;quot; output that&#39;s definitely not seen when running these demos in realtime.</itunes:summary>
      <itunes:duration>877</itunes:duration>
      <link>http://channel9.msdn.com/coding4fun/tv/The-Coding4Fun-Show-WPF-MediaKit-with-Jeremiah-Morrill</link>
      <pubDate>Mon, 19 Oct 2009 12:49:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/tv/The-Coding4Fun-Show-WPF-MediaKit-with-Jeremiah-Morrill</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/100/499888_100x75.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/220/499888_220x165.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/8/8/8/9/9/4/C4FShowE4Morrill_320_ch9.png" height="240" width="320"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/8/8/8/9/9/4/C4FShowE4Morrill_512_ch9.png" height="384" width="512"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/8/8/8/9/9/4/C4FShowE4Morrill_85_ch9.png" height="64" width="85"></media:thumbnail>
      <media:group>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/8/8/8/9/9/4/C4FShowE4Morrill_2MB_ch9.wmv" expression="full" duration="877" fileSize="271418785" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/8/8/8/9/9/4/C4FShowE4Morrill_ch9.mp3" expression="full" duration="877" fileSize="7020198" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/8/8/8/9/9/4/C4FShowE4Morrill_ch9.mp4" expression="full" duration="877" fileSize="111776307" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/8/8/8/9/9/4/C4FShowE4Morrill_ch9.wma" expression="full" duration="877" fileSize="7109431" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/8/8/8/9/9/4/C4FShowE4Morrill_ch9.wmv" expression="full" duration="877" fileSize="165649805" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/8/8/8/9/9/4/C4FShowE4Morrill_Zune_ch9.wmv" expression="full" duration="877" fileSize="83983874" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://ecn.channel9.msdn.com/o9/ch9/8/8/8/9/9/4/C4FShowE4Morrill_ch9.wmv" length="165649805" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Brian Peek</dc:creator>
      <itunes:author>Brian Peek</itunes:author>
      <slash:comments>2</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/tv/The-Coding4Fun-Show-WPF-MediaKit-with-Jeremiah-Morrill/RSS</wfw:commentRss>
      <category>Coding4Fun</category>
      <category>Media</category>
      <category>Open Source</category>
      <category>WPF 3.5 SP1</category>
    </item>
  <item>
      <title>Tesco and Silverlight delivering the full disc experience without a disc</title>
      <description><![CDATA[I'm <span><a href="http://on10.net/blogs/benwagg/Ben-at-IBC-come-on-by/">here in Amsterdam</a></span> with furious jetlag, but happy to finally be able to discuss one of big things I've been working on for a while. We've been working on using Silverlight to deliver full interactive movie experiences ala Blu-ray and DVD, liberated from the shiny disc. I've been frustrated for years that, despite the PC being a much deeper interactive platform than disc players, digital downloads so far have included much less interactivity than even basic DVDs. They've just been a rectangle of video and a single track of audio: no alternate language audio or subtitles, no menus, no extras, no director's commentary. With Silverlight, we're pushing hard to change that. We've now announced our first major customer: UK retail giant Tesco. Here's the <span><a href="http://www.microsoft.com/presspass/press/2009/sep09/09-09tescopr.mspx">press release</a></span>, and the money quote: <blockquote class="webkit-indent-blockquote"><span>Tesco, one of the world’s leading retailers, and Microsoft Corp., worldwide leader in software, today announced a collaboration to launch the next generation of home video viewing. The new service, built on Microsoft Silverlight technology, will deliver a similar level of quality as consumers have come to expect from DVD and Blu-ray, but with advanced Web-based interactivity and a viewing experience that goes beyond other digital playback products in the marketplace.</span></blockquote><blockquote class="webkit-indent-blockquote"><span>Starting in the autumn, Tesco will allow customers in the U.K. who purchase certain home video titles from Tesco to download “digital copy” versions of movies to their Windows-based or Apple Macintosh computers in a “virtual DVD” experience. The digital copy versions will include a similar level of video quality, interactivity and bonus content available on the physical products. In addition, the digital copy versions will provide consumers with extra network-connected features such as auto-updated trailers, exclusive bonus content, movie viewing parties with online chat, related music offerings such as MP3s and ring tones, and networked games.</span></blockquote>Yep, the goal is to provide everything that DVD and Blu-ray can do, and beyond. And it'll be launched by Tesco this fall. There's <span><a href="http://team.silverlight.net/announcements/silverlight-delivers-next-gen-home-video-experience-without-the-disk/">more details and a screenshot</a></span> on the Silverlight Team Blog. This is going to be a very big deal, and I'll be talking about it plenty going forward.  <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:2038941146a8433fab339e1000b22bad">]]></description>
      <comments>http://channel9.msdn.com/Blogs/benwagg/Tesco-and-Silverlight-delivering-the-full-disc-experience-without-a-disc</comments>
      <itunes:summary>I&#39;m here in Amsterdam with furious jetlag, but happy to finally be able to discuss one of big things I&#39;ve been working on for a while. We&#39;ve been working on using Silverlight to deliver full interactive movie experiences ala Blu-ray and DVD, liberated from the shiny disc. I&#39;ve been frustrated for years that, despite the PC being a much deeper interactive platform than disc players, digital downloads so far have included much less interactivity than even basic DVDs. They&#39;ve just been a rectangle of video and a single track of audio: no alternate language audio or subtitles, no menus, no extras, no director&#39;s commentary. With Silverlight, we&#39;re pushing hard to change that. We&#39;ve now announced our first major customer: UK retail giant Tesco. Here&#39;s the press release, and the money quote: Tesco, one of the world’s leading retailers, and Microsoft Corp., worldwide leader in software, today announced a collaboration to launch the next generation of home video viewing. The new service, built on Microsoft Silverlight technology, will deliver a similar level of quality as consumers have come to expect from DVD and Blu-ray, but with advanced Web-based interactivity and a viewing experience that goes beyond other digital playback products in the marketplace.Starting in the autumn, Tesco will allow customers in the U.K. who purchase certain home video titles from Tesco to download “digital copy” versions of movies to their Windows-based or Apple Macintosh computers in a “virtual DVD” experience. The digital copy versions will include a similar level of video quality, interactivity and bonus content available on the physical products. In addition, the digital copy versions will provide consumers with extra network-connected features such as auto-updated trailers, exclusive bonus content, movie viewing parties with online chat, related music offerings such as MP3s and ring tones, and networked games.Yep, the goal is to provide everything that DVD and Blu-ray can do, and beyond. A</itunes:summary>
      <link>http://channel9.msdn.com/Blogs/benwagg/Tesco-and-Silverlight-delivering-the-full-disc-experience-without-a-disc</link>
      <pubDate>Thu, 10 Sep 2009 12:25:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/benwagg/Tesco-and-Silverlight-delivering-the-full-disc-experience-without-a-disc</guid>      
      <dc:creator>Ben Waggoner</dc:creator>
      <itunes:author>Ben Waggoner</itunes:author>
      <slash:comments>1</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/benwagg/Tesco-and-Silverlight-delivering-the-full-disc-experience-without-a-disc/RSS</wfw:commentRss>
      <category>Media</category>
      <category>Silverlight</category>
      <category>Tesco</category>
      <category>Movies</category>
      <category>IBC</category>
    </item>
  <item>
      <title>NetFlix API</title>
      <description><![CDATA[
<p><a href="http://www.netdave.com"><img title="netflix" border="0" alt="netflix" align="right" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9893401/netflix.png" width="184" height="240"> Dave Cook</a> has created an interesting
 write up on the Netflix API.&nbsp; Netflix has a web service API model so you do need an internet connection to leverage this.</p>
<p>He currently has 4 articles from the simple to the complex.</p>
<ul>
<li><a href="http://www.codeproject.com/KB/IP/NetflixAPIBasics.aspx">API Basics</a>
</li><li><a href="http://www.codeproject.com/KB/IP/NetflixAPI_II.aspx">Accessing the Title Catalog</a>
</li><li><a href="http://www.codeproject.com/KB/IP/NetflixAccountExplorer.aspx">Accessing Subscriber Account Information</a>
</li><li><a href="http://www.codeproject.com/KB/IP/NetflixQueueManager.aspx">Managing Account Information</a>
</li></ul>
<p>If you are interested in doing a netflix project, you have to sign up for a developer account at the
<a title="Netflix Developer Network home page" href="http://developer.netflix.com/">
Netflix Developer Network home page</a>.</p>
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:b21050e7fc2740ff97749e7600cb6852">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/blog/NetFlix-API</comments>
      <itunes:summary>
 Dave Cook has created an interesting
 write up on the Netflix API.&amp;nbsp; Netflix has a web service API model so you do need an internet connection to leverage this. 
He currently has 4 articles from the simple to the complex. 

API Basics
Accessing the Title Catalog
Accessing Subscriber Account Information
Managing Account Information

If you are interested in doing a netflix project, you have to sign up for a developer account at the

Netflix Developer Network home page. 
</itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/blog/NetFlix-API</link>
      <pubDate>Wed, 09 Sep 2009 21:00:46 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/blog/NetFlix-API</guid>      
      <dc:creator>Clint Rutkas</dc:creator>
      <itunes:author>Clint Rutkas</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/blog/NetFlix-API/RSS</wfw:commentRss>
      <category>Media</category>
      <category>Web Services</category>
      <category>C4FNews</category>
    </item>
  <item>
      <title>Ben at IBC; come on by</title>
      <description><![CDATA[ <p>For those mourning my relative blog interactivity and going to <a shape="rect" href="http://www.ibc.org/" shape="rect">IBC</a>, you can get your fill of the live Ben Waggoner 3D experience at the Microsoft both.&nbsp; I'll be at the booth at least several hours every day. I'll get final details up here before the show opens.<br><br>Microsoft is in the lovely-but-elusive Topaz Lounge again this year. Compared to the screetching din of a show like NAB, it's quite civilized, down to coffee in china cups.<br><br>The Topaz Lounge is situated on the First Floor of the RAI, nearby the Elicium and can be accessed from the Auditorium and the escalators from exhibition halls 2 and 3.<br><br>IBC will be putting together an interactive map and upload onto the IBC website. </p><p></p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:486d3f88dfc342f0a84f9e1000b227de">]]></description>
      <comments>http://channel9.msdn.com/Blogs/benwagg/Ben-at-IBC-come-on-by</comments>
      <itunes:summary> For those mourning my relative blog interactivity and going to IBC, you can get your fill of the live Ben Waggoner 3D experience at the Microsoft both.&amp;nbsp; I&#39;ll be at the booth at least several hours every day. I&#39;ll get final details up here before the show opens.Microsoft is in the lovely-but-elusive Topaz Lounge again this year. Compared to the screetching din of a show like NAB, it&#39;s quite civilized, down to coffee in china cups.The Topaz Lounge is situated on the First Floor of the RAI, nearby the Elicium and can be accessed from the Auditorium and the escalators from exhibition halls 2 and 3.IBC will be putting together an interactive map and upload onto the IBC website.   </itunes:summary>
      <link>http://channel9.msdn.com/Blogs/benwagg/Ben-at-IBC-come-on-by</link>
      <pubDate>Tue, 08 Sep 2009 05:50:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/benwagg/Ben-at-IBC-come-on-by</guid>      
      <dc:creator>Ben Waggoner</dc:creator>
      <itunes:author>Ben Waggoner</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/benwagg/Ben-at-IBC-come-on-by/RSS</wfw:commentRss>
      <category>Media</category>
      <category>Silverlight</category>
      <category>trade show</category>
      <category>IBC</category>
      <category>Amsterdam</category>
    </item>
  <item>
      <title>Project Tuva: highly cool Silverlight player of Richard Feynman lectures</title>
      <description><![CDATA[ <p>Sorry it's been so long without any blogging. Between my class at Stanford, finishing the <a shape="rect" href="http://focalpress.com/Book.aspx?id=10404&amp;terms=ben&#43;waggoner" shape="rect">second edition of my compression book</a>, and a profoundly cool project that'll hopefully be announced soon, things have been beyond busy.</p><p>But I've got a lot of topics in the queue I hope to get posted before <a shape="rect" href="http://www.ibc.org/" shape="rect">IBC </a>(and yes, I'll be in Amsterdam for the whole show).</p><p>First up, the very cool <a shape="rect" href="http://research.microsoft.com/apps/tools/tuva/" shape="rect">Project Tuva</a>, a Silverlight presentation of the seven classic <a shape="rect" href="http://theuniversityfaculty.cornell.edu/lectures/lectures_main.html" target="_blank" shape="rect">Messenger Lectures</a> by famed physicist <a shape="rect" href="http://en.wikipedia.org/wiki/Richard_Feynmann" shape="rect">Richard Feynman </a><a shape="rect" href="http://research.microsoft.com/en-us/collaboration/focus/education/tuva.aspx" shape="rect">Microsoft Research </a>and <a shape="rect" href="http://stimulant.io/wp/index.php/2009/07/project-tuva-for-microsoft-research/" shape="rect">Stimulant</a>. It’s named after the <a shape="rect" href="http://en.wikipedia.org/wiki/Tuva" target="_blank" shape="rect">small Central Asian republic</a> of the <a shape="rect" href="http://en.wikipedia.org/wiki/Federal_subjects_of_Russia" target="_blank" shape="rect">Russian Federation</a> to which <a shape="rect" href="http://www.bbc.co.uk/worldservice/documentaries/2009/08/090811_world_stories_bombs_stamps_throat_singers.shtml" target="_blank" shape="rect">Feynman had a long yearning to travel</a>. Project Tuva was sponsored by Microsoft’s <a shape="rect" href="http://www.microsoft.com/presspass/exec/tonyhey/default.aspx" target="_blank" shape="rect">Tony Hey</a>, <a shape="rect" href="http://www.microsoft.com/presspass/exec/rick/default.aspx" target="_blank" shape="rect">Rick Rashid</a>, and <a shape="rect" href="http://www.microsoft.com/presspass/exec/billg/?tab=biography" target="_blank" shape="rect">Bill Gates</a>.</p><p>As I've mentioned before, I've been in this digital media game for quite a while now. And since long before we had visions of HD web video, or even DVD, multimedia education has been one of the big goals for the technology.</p><p>My school years spanned the <a shape="rect" href="http://en.wikipedia.org/wiki/Filmstrip" shape="rect">filmstrip</a>/<a shape="rect" href="http://en.wikipedia.org/wiki/16_mm_film" shape="rect">16mm</a> projector and early VHS eras. And while an in-class movie was always a treat, the linear nature of the experience could be frustrating. The really interesting parts didn't last longer than the dull parts, and there wasn't any good way to ask a question or dive deeper. And with a dull part, I could easily tune out thinking about <a shape="rect" href="http://en.wikipedia.org/wiki/Space_1999" shape="rect">Space: 1999 </a>and never come back. The classic lecture format has the same problem, although the teacher could at least read body language of the class to get a sense of where to focus.</p><p>So even back in the protean CD-ROM and even laserdisc eras of multimedia, there were many efforts to add interactivity to linear video educational content. The goal was greater engagement, with students able to skim, review, and dive deep when and where something grabs them.</p><p>But while we've had a lot of great examples of the genre, the cost of creating all that rich interactive content was a real barrier to making it part of everyday education.</p><p>But the combination of the web (lots of existing content ready to be accessed) <a shape="rect" href="http://silverlight.net" target="_blank" shape="rect">Silverlight</a> (nice portable runtime to deliver rich experiences), and <a shape="rect" href="http://www.microsoft.com/expression" target="_blank" shape="rect">Expression Studio</a> (highly efficient authoring), we're able to do bigger, deeper projects with a lower authoring cost than ever before.</p><p>So, check out the <a shape="rect" href="http://research.microsoft.com/apps/tools/tuva/index.html" target="_blank" shape="rect">Project Tuva player</a>. The content itself was quite compelling even on celluloid, but they've really done some great things leveraging Silverlight and the web. And it was a delightful surprise; I hadn’t even heard it was in progress before launched. </p><p>Let me take a tour through some of my favorite features (going roughly counterclockwise from the top):</p><h2>&nbsp;</h2><table width="756" border="2" cellspacing="3" cellpadding="5"><tbody><tr><td width="286" valign="top"><h1>Context sensitive extras</h1><p>The right-hand side shows available extras, supplementary information about what's currently being discussed. Clicking on one pauses the video (important!) and takes the user to a graphic, web page, or embedded Silverlight app like <a shape="rect" href="http://www.worldwidetelescope.org/Home.aspx" target="_blank" shape="rect">World Wide Telescope</a> Silverlight-based <a shape="rect" href="http://www.worldwidetelescope.org/webclient/" target="_blank" shape="rect">web client preview</a>. When they're done, video playback starts right where it left off.</p></td><td width="457" valign="top"><a shape="rect" href="http://on10.net/Link/d294b215-54af-4d14-afd2-6bdb184c4c6e/" shape="rect"><img width="155" height="484" width="155" height="484" title="Extras" alt="Extras" src="http://on10.net/Link/563c78f0-5605-46b4-be31-485fecea692c/" border="0"></a></td></tr><tr><td width="284" valign="top"><h1>Search</h1><p>Typing into the search box yields a list of the matches in any of the seven videos.</p><p>Clicking on any particular video shows all matches and their context in the video.</p></td><td width="459" valign="top">&nbsp;<a shape="rect" href="http://on10.net/Link/fe8a22fc-b8d0-4cb9-8f54-b334d3094e03/" shape="rect"><img width="224" height="262" width="224" height="262" title="Visual-Search" align="left" alt="Visual-Search" src="http://on10.net/Link/353a821c-02b0-4b78-9347-cde8ac082265/" border="0"></a><a shape="rect" href="http://on10.net/Link/fb0ea372-dc0c-426b-bac4-016011e8f53c/" shape="rect"><img width="224" height="262" width="224" height="262" title="Text-Search" align="right" alt="Text-Search" src="http://on10.net/Link/3c9000eb-f6a3-49cb-8f22-cf126e8d1f22/" border="0"></a><br></td></tr><tr><td width="282" valign="top"><h1>Smooth Streaming</h1><br>And it uses Smooth Streaming for delivery, of course, up to 2.4 Mbps. At the top rates it does a good job of retaining that crazy old-school-movie-on-16mm texture. <br><br>I haven’t got my hands on the source yet, but I’d be curious to see if HD could be extracted with some high-quality preprocessing.</td><td width="461" valign="top"><a shape="rect" href="http://on10.net/Link/4f5ac4a8-f01f-44e2-a8f6-658206ef427a/" shape="rect"><br><img width="170" height="123" width="170" height="123" title="Smooth-Streaming" alt="Smooth-Streaming" src="http://on10.net/Link/773f6c56-dc16-4bf5-bd9f-d1d80a4783b6/" border="0"></a></td></tr><tr><td width="280" valign="top"><h1>Transcript</h1><p>All lectures have full transcripts, and automatically show the current line as a caption below the video window.</p><p>A full transcript mode is also available, and can be used for navigation; just click on a line to immediately switch to playing back the video there.</p></td><td width="463" valign="top"><a shape="rect" href="http://on10.net/Link/8a0126bc-f923-4b1b-bb15-43f32de0d185/" shape="rect"><img width="452" height="485" width="452" height="485" title="Transcript" alt="Transcript" src="http://on10.net/Link/5bf96494-c68a-40ff-b2ec-9a0c5ed24d5f/" border="0"></a></td></tr><tr><td width="279" valign="top"><h1>Timeline</h1><br>The timeline has some great user interface felicities. A quick click started playback at the start of the chapter. But holding down the mouse button a moment or grabbing-and-dragging the playhead allows scrubbing within a chapter. <br>If the timeline view is expanded, the location and type of all the extras are shown, as are the location of user created notes (described below).</td><td width="464" valign="top"><a shape="rect" href="http://on10.net/Link/7484be98-995d-4585-9222-dea344c412ad/" shape="rect"><br><img width="452" height="36" width="452" height="36" title="Timeline" alt="Timeline" src="http://on10.net/Link/2ea294c2-6992-49e6-b0d7-1c324444c6e7/" border="0"></a></td></tr><tr><td width="278" valign="top"><h1>Notes</h1><p>The user can add time synched notes that are saved on the local machine.</p><p>This allows students to bookmark places for followup, or educators to set up a queue of particular topics for classrom use.</p></td><td width="465" valign="top"><a shape="rect" href="http://on10.net/Link/6c94251c-4fb4-4a16-8cbf-783924bafeac/" shape="rect"><img width="232" height="484" width="232" height="484" title="Notes" alt="Notes" src="http://on10.net/Link/546f595d-6007-45d9-8bde-3f7e3c0d525c/" border="0"></a></td></tr><tr><td width="277" valign="top"><h1>Simple Player</h1><p>Or someone who wants to just watch the video can leave everything minimized to cut back on visual distraction. The full-screen mode is cleaner yet.</p><p>Compare the interface with all the interactive elements minimized and maximized.</p></td><td width="466" valign="top"><a shape="rect" href="http://on10.net/Link/c84dd46b-74a5-464e-b2af-b6fb323d3420/" shape="rect"><img width="452" height="334" width="452" height="334" title="Simple-Player" alt="Simple-Player" src="http://on10.net/Link/7a5a92c7-0544-4482-806f-0d4f044f86ab/" border="0"></a><br><a shape="rect" href="http://on10.net/Link/819a2a0e-350f-4f74-8583-dd8226de3d39/" shape="rect"><img width="452" height="340" width="452" height="340" title="Full-Player" alt="Full-Player" src="http://on10.net/Link/bb85891c-72b0-4822-ac10-aca5685d551a/" border="0"></a></td></tr></tbody></table> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:e7555472d37f4713ad7b9e1000b22207">]]></description>
      <comments>http://channel9.msdn.com/Blogs/benwagg/Project-Tuva-highly-cool-Silverlight-player-of-Richard-Feynman-lectures</comments>
      <itunes:summary> Sorry it&#39;s been so long without any blogging. Between my class at Stanford, finishing the second edition of my compression book, and a profoundly cool project that&#39;ll hopefully be announced soon, things have been beyond busy. But I&#39;ve got a lot of topics in the queue I hope to get posted before IBC (and yes, I&#39;ll be in Amsterdam for the whole show). First up, the very cool Project Tuva, a Silverlight presentation of the seven classic Messenger Lectures by famed physicist Richard Feynman Microsoft Research and Stimulant. It’s named after the small Central Asian republic of the Russian Federation to which Feynman had a long yearning to travel. Project Tuva was sponsored by Microsoft’s Tony Hey, Rick Rashid, and Bill Gates. As I&#39;ve mentioned before, I&#39;ve been in this digital media game for quite a while now. And since long before we had visions of HD web video, or even DVD, multimedia education has been one of the big goals for the technology. My school years spanned the filmstrip/16mm projector and early VHS eras. And while an in-class movie was always a treat, the linear nature of the experience could be frustrating. The really interesting parts didn&#39;t last longer than the dull parts, and there wasn&#39;t any good way to ask a question or dive deeper. And with a dull part, I could easily tune out thinking about Space: 1999 and never come back. The classic lecture format has the same problem, although the teacher could at least read body language of the class to get a sense of where to focus. So even back in the protean CD-ROM and even laserdisc eras of multimedia, there were many efforts to add interactivity to linear video educational content. The goal was greater engagement, with students able to skim, review, and dive deep when and where something grabs them. But while we&#39;ve had a lot of great examples of the genre, the cost of creating all that rich interactive content was a real barrier to making it part of everyday education. But the combination of the web (lots o</itunes:summary>
      <link>http://channel9.msdn.com/Blogs/benwagg/Project-Tuva-highly-cool-Silverlight-player-of-Richard-Feynman-lectures</link>
      <pubDate>Sat, 29 Aug 2009 00:21:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/benwagg/Project-Tuva-highly-cool-Silverlight-player-of-Richard-Feynman-lectures</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/320/on10_25d9a70b-9f21-470e-b061-7f1133a114a8.jpg" height="0" width="0"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/85/on10_9a87c308-0e6c-4f45-b76e-25f1d537ca07.jpg" height="64" width="85"></media:thumbnail>      
      <dc:creator>Ben Waggoner</dc:creator>
      <itunes:author>Ben Waggoner</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/benwagg/Project-Tuva-highly-cool-Silverlight-player-of-Richard-Feynman-lectures/RSS</wfw:commentRss>
      <category>Education</category>
      <category>Media</category>
      <category>Silverlight</category>
      <category>Silverlight 3</category>
      <category>Silverlight Streaming</category>
      <category>Smooth Streaming</category>
      <category>Expression Studio</category>
      <category>World Wide Telescope</category>
      <category>Richard Feynmann</category>
    </item>
  <item>
      <title>TIm Harader and John Bishop in Live HD web event Thur the 16th</title>
      <description><![CDATA[ <p dir="ltr">So, Millimeter is hosting a live web event about Live Smooth Streaming, featuring the always-awesome John Bishop of Inlet and our own (also excellent) Tim Harader.<br><br>With those two together, expect an hour of real-world experience and context with&nbsp;awesome technical details&nbsp;and delivered with&nbsp;a charming Carolina lilt.<br><br>It's Thursday, July 16th, at 2pm Eastern Daylight Time (GMT -5)<br><br>You can register here:<br><a shape="rect" href="https://event.on24.com/eventRegistration/EventLobbyServlet?target=registration.jsp&amp;eventid=153230&amp;sessionid=1&amp;key=00ED2EDFCB275415AFB7059389F8B18B&amp;partnerref=mminlethdv4&amp;sourcepage=register" shape="rect">https://event.on24.com/eventRegistration/EventLobbyServlet?target=registration.jsp&amp;eventid=153230&amp;sessionid=1&amp;key=00ED2EDFCB275415AFB7059389F8B18B&amp;partnerref=mminlethdv4&amp;sourcepage=register<br></a><br><br>Full description:</p><blockquote>Learn how to deliver web video with the quality and reliability of HDTV.&nbsp; Dramatically increase viewing times and repeat visits using this scalable online video delivery technology. <p>&nbsp;</p>Standard video on the Web is plagued by 2 major issues: the quality of the video (either too small or too blurry) and the reliability of the playback (constant rebuffering or stuttering). These two variables are interrelated: increasing the quality requires higher bandwidth, and using less bandwidth to minimize rebuffering sacrifices video quality. <p>&nbsp;</p><p class="style13">Smooth Streaming solves these issues by dynamically modifying the bandwidth of the video stream based on available bandwidth and individual PC performance. This process is invisible to viewers; they just connect to the live event. If bandwidth drops, the video seamlessly transitions to the next lower stream. When the bandwidth recovers, the stream will automatically use the higher bandwidth. This enables the viewer to watch the live event in the best possible quality at all times, without pauses or interruptions in the video stream.</p><p class="style13">During this webcast, you will learn about Smooth Streaming from two industry experts, who will teach you:</p><ul><li><div class="style13">What Smooth Streaming is and why it is the future of online video delivery </div></li><li><div class="style13">How Smooth Streaming delivers HDTV-quality experiences </div></li><li><div class="style13">How it has been successfully implemented for major live events </div></li><li><div class="style13">How to start delivering your content with Smooth Streaming </div></li></ul></blockquote> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:3dbb4fe0dd544ef0a6cb9e1000b21c1c">]]></description>
      <comments>http://channel9.msdn.com/Blogs/benwagg/TIm-Harader-and-John-Bishop-in-Live-HD-web-event-Thur-the-16th</comments>
      <itunes:summary> So, Millimeter is hosting a live web event about Live Smooth Streaming, featuring the always-awesome John Bishop of Inlet and our own (also excellent) Tim Harader.With those two together, expect an hour of real-world experience and context with&amp;nbsp;awesome technical details&amp;nbsp;and delivered with&amp;nbsp;a charming Carolina lilt.It&#39;s Thursday, July 16th, at 2pm Eastern Daylight Time (GMT -5)You can register here:https://event.on24.com/eventRegistration/EventLobbyServlet?target=registration.jsp&amp;amp;eventid=153230&amp;amp;sessionid=1&amp;amp;key=00ED2EDFCB275415AFB7059389F8B18B&amp;amp;partnerref=mminlethdv4&amp;amp;sourcepage=registerFull description: Learn how to deliver web video with the quality and reliability of HDTV.&amp;nbsp; Dramatically increase viewing times and repeat visits using this scalable online video delivery technology. &amp;nbsp; Standard video on the Web is plagued by 2 major issues: the quality of the video (either too small or too blurry) and the reliability of the playback (constant rebuffering or stuttering). These two variables are interrelated: increasing the quality requires higher bandwidth, and using less bandwidth to minimize rebuffering sacrifices video quality. &amp;nbsp; Smooth Streaming solves these issues by dynamically modifying the bandwidth of the video stream based on available bandwidth and individual PC performance. This process is invisible to viewers; they just connect to the live event. If bandwidth drops, the video seamlessly transitions to the next lower stream. When the bandwidth recovers, the stream will automatically use the higher bandwidth. This enables the viewer to watch the live event in the best possible quality at all times, without pauses or interruptions in the video stream. During this webcast, you will learn about Smooth Streaming from two industry experts, who will teach you: What Smooth Streaming is and why it is the future of online video delivery How Smooth Streaming delivers HDTV-quality experiences How it has been successfully i</itunes:summary>
      <link>http://channel9.msdn.com/Blogs/benwagg/TIm-Harader-and-John-Bishop-in-Live-HD-web-event-Thur-the-16th</link>
      <pubDate>Tue, 14 Jul 2009 18:02:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/benwagg/TIm-Harader-and-John-Bishop-in-Live-HD-web-event-Thur-the-16th</guid>      
      <dc:creator>Ben Waggoner</dc:creator>
      <itunes:author>Ben Waggoner</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/benwagg/TIm-Harader-and-John-Bishop-in-Live-HD-web-event-Thur-the-16th/RSS</wfw:commentRss>
      <category>IIS</category>
      <category>Media</category>
      <category>Smooth Streaming</category>
      <category>events</category>
      <category>Inlet</category>
      <category>Live Smooth Streaming</category>
      <category>Tim Harader</category>
      <category>John Bishop</category>
    </item>
  <item>
      <title>Silverlight 3 and Expression 3 announcement roundup</title>
      <description><![CDATA[So, Silverlight 3 was released today, and the Expression Studio is available in a public release candidate, including the awesome Expression Encoder 2.<br><br>I'll have a bunch more to say about it, of course, but first off let me just provide links to the important stuff relating to the media side of things.<br><br>Scott Guthrie's always-excellent blog post roundup:<br><a shape="rect" href="http://weblogs.asp.net/scottgu/archive/2009/07/10/silverlight-3-released.aspx" shape="rect">http://weblogs.asp.net/scottgu/archive/2009/07/10/silverlight-3-released.aspx</a><br><br>Technical overview of media features:<br><a shape="rect" href="http://www.microsoft.com/silverlight/overview/media/media-details.aspx#smooth" shape="rect">http://www.microsoft.com/silverlight/overview/media/media-details.aspx#smooth</a><br><br>Expression Encoder 3 overview:<br><a shape="rect" href="http://www.microsoft.com/expression/products/Encoder_Overview.aspx" shape="rect">http://www.microsoft.com/expression/products/Encoder_Overview.aspx</a><br><br>Extensive blog post about Expression Encoder 3 new features (it is awesome):<br><a shape="rect" href="http://blogs.msdn.com/expressionencoder/archive/2009/07/10/9828866.aspx" shape="rect">http://blogs.msdn.com/expressionencoder/archive/2009/07/10/9828866.aspx</a><br><br>Alas, the RC of that isn't available for download quite yet. Soon, I'm told.<br><br>And I had this interview on Streaming Media about the new media features:<br><a shape="rect" href="http://streamingmedia.com/article.asp?id=11268" shape="rect">http://streamingmedia.com/article.asp?id=11268</a> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:ff0e8855fc504d62a45e9e1000b2164e">]]></description>
      <comments>http://channel9.msdn.com/Blogs/benwagg/Silverlight-3-and-Expression-3-announcement-roundup</comments>
      <itunes:summary>So, Silverlight 3 was released today, and the Expression Studio is available in a public release candidate, including the awesome Expression Encoder 2.I&#39;ll have a bunch more to say about it, of course, but first off let me just provide links to the important stuff relating to the media side of things.Scott Guthrie&#39;s always-excellent blog post roundup:http://weblogs.asp.net/scottgu/archive/2009/07/10/silverlight-3-released.aspxTechnical overview of media features:http://www.microsoft.com/silverlight/overview/media/media-details.aspx#smoothExpression Encoder 3 overview:http://www.microsoft.com/expression/products/Encoder_Overview.aspxExtensive blog post about Expression Encoder 3 new features (it is awesome):http://blogs.msdn.com/expressionencoder/archive/2009/07/10/9828866.aspxAlas, the RC of that isn&#39;t available for download quite yet. Soon, I&#39;m told.And I had this interview on Streaming Media about the new media features:http://streamingmedia.com/article.asp?id=11268</itunes:summary>
      <link>http://channel9.msdn.com/Blogs/benwagg/Silverlight-3-and-Expression-3-announcement-roundup</link>
      <pubDate>Sat, 11 Jul 2009 03:35:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/benwagg/Silverlight-3-and-Expression-3-announcement-roundup</guid>      
      <dc:creator>Ben Waggoner</dc:creator>
      <itunes:author>Ben Waggoner</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/benwagg/Silverlight-3-and-Expression-3-announcement-roundup/RSS</wfw:commentRss>
      <category>Expression Encoder</category>
      <category>h.264</category>
      <category>IIS</category>
      <category>Media</category>
      <category>Silverlight</category>
      <category>Silverlight 3</category>
      <category>VC-1</category>
      <category>NBC Universal</category>
    </item>
  <item>
      <title>My Silverlight 3 preview up at StreamingMedia.com</title>
      <description><![CDATA[The newest in my &quot;Silverlight Guru&quot; interviews with Troy Dreier is up now. It offers a concise overview of some of the big features we have coming for Silverlight 3 and with our encoding infrastructure.<br><br><a shape="rect" href="http://www.streamingmedia.com/article.asp?id=11268" shape="rect">http://www.streamingmedia.com/article.asp?id=11268</a><br><br>And the previous installments are here:<br><a shape="rect" href="http://www.streamingmedia.com/article.asp?id=11188" shape="rect">http://www.streamingmedia.com/article.asp?id=11188</a><br><a shape="rect" href="http://www.streamingmedia.com/article.asp?id=11140" shape="rect">http://www.streamingmedia.com/article.asp?id=11140</a><br><br>We're doing these roughly once a month, mainly driven by questions from the Streaming Media forums or send directly to Troy.<br><br>As Troy alwasy ends the interviews:<br><br><i>Submit your Silverlight questions to Streaming Media’s </i><a shape="rect" href="http://forums.streamingmedia.com/forum-6.html" target="new" shape="rect"><i>Formats, Codecs, and Players forum</i></a><i>, or send them directly to the author at </i><a shape="rect" href="mailto:tdreier@streamingmedia.com" shape="rect"><i>tdreier@streamingmedia.com</i></a><i>.</i><br> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:a6a87a9259264659b45e9e1000b211a9">]]></description>
      <comments>http://channel9.msdn.com/Blogs/benwagg/My-Silverlight-3-preview-up-at-StreamingMediacom</comments>
      <itunes:summary>The newest in my &amp;quot;Silverlight Guru&amp;quot; interviews with Troy Dreier is up now. It offers a concise overview of some of the big features we have coming for Silverlight 3 and with our encoding infrastructure.http://www.streamingmedia.com/article.asp?id=11268And the previous installments are here:http://www.streamingmedia.com/article.asp?id=11188http://www.streamingmedia.com/article.asp?id=11140We&#39;re doing these roughly once a month, mainly driven by questions from the Streaming Media forums or send directly to Troy.As Troy alwasy ends the interviews:Submit your Silverlight questions to Streaming Media’s Formats, Codecs, and Players forum, or send them directly to the author at tdreier@streamingmedia.com.</itunes:summary>
      <link>http://channel9.msdn.com/Blogs/benwagg/My-Silverlight-3-preview-up-at-StreamingMediacom</link>
      <pubDate>Thu, 09 Jul 2009 19:11:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/benwagg/My-Silverlight-3-preview-up-at-StreamingMediacom</guid>      
      <dc:creator>Ben Waggoner</dc:creator>
      <itunes:author>Ben Waggoner</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/benwagg/My-Silverlight-3-preview-up-at-StreamingMediacom/RSS</wfw:commentRss>
      <category>Expression Encoder</category>
      <category>h.264</category>
      <category>IIS</category>
      <category>Media</category>
      <category>Silverlight</category>
      <category>Silverlight 3</category>
      <category>Smooth Streaming</category>
      <category>VC-1</category>
      <category>Compression</category>
      <category>Streaming</category>
      <category>Streaming Media</category>
    </item>
  <item>
      <title>My Michael Jackson Player</title>
      <description><![CDATA[The default player is only embedding at 848x wide. So I'll see if I've go the HTML-fu to embed big enough to get the full 1280x720.<br><br> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:22020b9e68d449e18a8a9e1000b20dc4">]]></description>
      <comments>http://channel9.msdn.com/Blogs/benwagg/My-Michael-Jackson-Player</comments>
      <itunes:summary>The default player is only embedding at 848x wide. So I&#39;ll see if I&#39;ve go the HTML-fu to embed big enough to get the full 1280x720.</itunes:summary>
      <link>http://channel9.msdn.com/Blogs/benwagg/My-Michael-Jackson-Player</link>
      <pubDate>Tue, 07 Jul 2009 13:46:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/benwagg/My-Michael-Jackson-Player</guid>      
      <dc:creator>Ben Waggoner</dc:creator>
      <itunes:author>Ben Waggoner</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/benwagg/My-Michael-Jackson-Player/RSS</wfw:commentRss>
      <category>Demo</category>
      <category>HTML</category>
      <category>IIS</category>
      <category>Live</category>
      <category>Media</category>
      <category>Smooth Streaming</category>
      <category>Michael Jackson</category>
    </item>
  <item>
      <title>Michael Jackson Memorial in live HD Smooth Streaming July 7th 10am PDT</title>
      <description><![CDATA[Just got some news: tomorrow's <a shape="rect" href="http://inmusic.ca/news_and_features/Michael_Jackson" shape="rect">Michael Jackson memorial </a>is going to be broadcast live in 720p Smooth Streaming by <a shape="rect" href="http://inmusic.ca/home/index" shape="rect">Sympatico / MSN inMusic</a>. The feed is originating from Canada, but is not georestricted! I think this is the first globally available Live HD Smooth Streaming event.<br><br>The event kicks off at 10am Pacific Daylight Time (GMT -8). It will hopefully be up as on-demand for 24 hours after, but we're still confirming the rights for that.<br><br>Check back tomorrow AM for any updates. <br><br><br>P.S. The <a shape="rect" href="http://tour-de-france.france2.fr/?page=exclusif_HD" shape="rect">Tour de France </a>is also doing Live HD Smooth Streaming, following the success of the French Open. It's georestricted to France, alas. <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:5ff90b4f22754dfd9bb99e1000b20a6f">]]></description>
      <comments>http://channel9.msdn.com/Blogs/benwagg/Michael-Jackson-Memorial-in-live-HD-Smooth-Streaming-July-7th-10am-PDT</comments>
      <itunes:summary>Just got some news: tomorrow&#39;s Michael Jackson memorial is going to be broadcast live in 720p Smooth Streaming by Sympatico / MSN inMusic. The feed is originating from Canada, but is not georestricted! I think this is the first globally available Live HD Smooth Streaming event.The event kicks off at 10am Pacific Daylight Time (GMT -8). It will hopefully be up as on-demand for 24 hours after, but we&#39;re still confirming the rights for that.Check back tomorrow AM for any updates. P.S. The Tour de France is also doing Live HD Smooth Streaming, following the success of the French Open. It&#39;s georestricted to France, alas.</itunes:summary>
      <link>http://channel9.msdn.com/Blogs/benwagg/Michael-Jackson-Memorial-in-live-HD-Smooth-Streaming-July-7th-10am-PDT</link>
      <pubDate>Tue, 07 Jul 2009 02:39:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/benwagg/Michael-Jackson-Memorial-in-live-HD-Smooth-Streaming-July-7th-10am-PDT</guid>      
      <dc:creator>Ben Waggoner</dc:creator>
      <itunes:author>Ben Waggoner</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/benwagg/Michael-Jackson-Memorial-in-live-HD-Smooth-Streaming-July-7th-10am-PDT/RSS</wfw:commentRss>
      <category>IIS</category>
      <category>Media</category>
      <category>Silverlight</category>
      <category>Smooth Streaming</category>
      <category>Michael Jackson</category>
    </item>
  <item>
      <title>Silverlight on Xbox 360 demo at Cannes</title>
      <description><![CDATA[ <p>Some of you have asked me about Scott Guthrie's <a shape="rect" href="http://twitter.com/ScottGu" shape="rect">twitter </a>mention of the Xbox 360 Silverlight advertising demo at Cannes. So, yes, Silverlight 3 is coming to the Xbox 360 and Xbox Live. We're mainly discussing this in the context of advertising at this point.<br><br>We've got some <a shape="rect" href="http://team.silverlight.net/announcements/silverlight-ads-on-xbox-live-announced-at-cannes/" shape="rect">more info up </a>about it at the (reliably interesting and informative) <a shape="rect" href="http://team.silverlight.net/" shape="rect">Silverlight Team Blog</a>.<br><br>There's plenty to read there, but here's the overview:</p><blockquote dir="ltr"><p dir="ltr">On Tuesday, June 22nd at the Cannes Lions International Advertising Festival 2009, Microsoft announced it will bring Interactive Advertising Bureau (IAB) recognized rich media technologies including Silverlight to Xbox LIVE within the next year.&nbsp; By extending support to technologies like Silverlight, Xbox LIVE will offer advertisers and creative designers scale and reach with their campaign creative assets, enabling them to build and deliver interactive, interconnected experiences that are unlike anything else on television, and extend these experiences across multiple screens – the TV, the PC, and Mobile.</p></blockquote> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:22dfc8b99f404286b6059e1000b20136">]]></description>
      <comments>http://channel9.msdn.com/Blogs/benwagg/Silverlight-on-Xbox-360-demo-at-Cannes</comments>
      <itunes:summary> Some of you have asked me about Scott Guthrie&#39;s twitter mention of the Xbox 360 Silverlight advertising demo at Cannes. So, yes, Silverlight 3 is coming to the Xbox 360 and Xbox Live. We&#39;re mainly discussing this in the context of advertising at this point.We&#39;ve got some more info up about it at the (reliably interesting and informative) Silverlight Team Blog.There&#39;s plenty to read there, but here&#39;s the overview: On Tuesday, June 22nd at the Cannes Lions International Advertising Festival 2009, Microsoft announced it will bring Interactive Advertising Bureau (IAB) recognized rich media technologies including Silverlight to Xbox LIVE within the next year.&amp;nbsp; By extending support to technologies like Silverlight, Xbox LIVE will offer advertisers and creative designers scale and reach with their campaign creative assets, enabling them to build and deliver interactive, interconnected experiences that are unlike anything else on television, and extend these experiences across multiple screens – the TV, the PC, and Mobile. </itunes:summary>
      <link>http://channel9.msdn.com/Blogs/benwagg/Silverlight-on-Xbox-360-demo-at-Cannes</link>
      <pubDate>Thu, 25 Jun 2009 17:33:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/benwagg/Silverlight-on-Xbox-360-demo-at-Cannes</guid>      
      <dc:creator>Ben Waggoner</dc:creator>
      <itunes:author>Ben Waggoner</itunes:author>
      <slash:comments>2</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/benwagg/Silverlight-on-Xbox-360-demo-at-Cannes/RSS</wfw:commentRss>
      <category>IIS</category>
      <category>Media</category>
      <category>Scott Guthrie</category>
      <category>Silverlight</category>
      <category>Xbox 360</category>
      <category>Advertising</category>
    </item>
  <item>
      <title>Playing media on your home network in Windows 7</title>
      <description><![CDATA[A new post on the e7 blog goes into detail about the new <a shape="rect" href="http://blogs.msdn.com/e7/archive/2009/05/12/media-streaming-with-windows-7.aspx" shape="rect">
Media Streaming features in Windows 7</a>.&nbsp; Features include easily sharing media with other PCs and DLNA devices on your home network, remote control mode, transcoding media types and more.&nbsp; The best part is a lot of this functionality is available in the
<a shape="rect" href="http://www.microsoft.com/windows/windows-7/default.aspx" shape="rect">
Windows 7 RC</a>, so you can try it&nbsp;yourself today.  <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:cb9819397b444d9a83469deb00224c63">]]></description>
      <comments>http://channel9.msdn.com/Blogs/ContinuumNews/Playing-media-on-your-home-network-in-Windows-7</comments>
      <itunes:summary>A new post on the e7 blog goes into detail about the new 
Media Streaming features in Windows 7.&amp;nbsp; Features include easily sharing media with other PCs and DLNA devices on your home network, remote control mode, transcoding media types and more.&amp;nbsp; The best part is a lot of this functionality is available in the

Windows 7 RC, so you can try it&amp;nbsp;yourself today. </itunes:summary>
      <link>http://channel9.msdn.com/Blogs/ContinuumNews/Playing-media-on-your-home-network-in-Windows-7</link>
      <pubDate>Thu, 14 May 2009 06:12:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/ContinuumNews/Playing-media-on-your-home-network-in-Windows-7</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/100/469191_100x75.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/220/469191_220x165.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/320/7b082203-a1d2-4808-9836-fe7ca5349fd2.jpg" height="210" width="280"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/85/88d3ee63-3bd4-41d1-8b81-60c38cd7f2c9.jpg" height="64" width="85"></media:thumbnail>      
      <dc:creator>Adam Kinney</dc:creator>
      <itunes:author>Adam Kinney</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/ContinuumNews/Playing-media-on-your-home-network-in-Windows-7/RSS</wfw:commentRss>
      <category>Media</category>
      <category>Windows</category>
      <category>Windows 7</category>
    </item>
  <item>
      <title>Blu-ray/DVD Comparison Utility</title>
      <description><![CDATA[
<table border="0" cellpadding="1" cellspacing="0" width="100%">
<tbody>
<tr class="entry_overview">
<td><span class="entry_description">In this article, Giovanni Montrone will provide an overview on how to create an image comparison application for DVD and Blu-ray screen captures.</span></td>
</tr>
<tr>
<td colspan="2">
<div class="entry_author"><a href="http://www.gmontrone.com/" target="_blank">Giovanni Montrone</a></div>
<div class="entry_company"><a href="http://www.aspsoft.com/">ASPSOFT, Inc.</a></div>
<br>
<div class="entry_details"><b>Difficulty: </b><span class="entry_details_input">Beginner</span></div>
<div class="entry_details"><b>Time Required:</b> 2<span class="entry_details_input">-3 hours</span></div>
<div class="entry_details"><b>Cost: </b><span class="entry_details_input">Free</span></div>
<div class="entry_details"><b>Software: </b><span class="entry_details_input"><a href="http://msdn.com/express/">Visual Web Developer Express SP1</a> (or Visual Studio 2008 SP1),
<a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=c22d6a7b-546f-4407-8ef6-d60c8ee221ed&amp;displaylang=en">
Silverlight 2 Tools</a></span></div>
<div class="entry_details"><b>Hardware: </b>None</div>
<div class="entry_details"><b>Application: </b><a href="http://gmontrone.com/bdcompare/BlurayDVDCompare.html" target="_blank">Run the application</a></div>
<div class="entry_details"><b>Source Download: </b><a href="http://channel9.msdn.com/playground/Sandbox/462814-Blu-rayDVD-Comparison-Utility/" target="_blank">Download the source</a></div>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<h3>Introduction</h3>
<p>As a fan of High Definition movies and television, I often find it difficult to explain the benefits of upgrading from DVD to blu-ray to family and friends.&nbsp; Many people believe that DVDs look good enough and/or that you need a really big television to notice
 the difference, and, even then, feel the improvement is not good enough to justify the upgrade.&nbsp; The best way to convince someone is to show him/her the same movie playing side by side on blu-ray and dvd using the same sized screens.&nbsp; Since it's difficult
 to do, the next best thing is to look at still images from both the DVD and the blu-ray and compare them.&nbsp; The images should be from the exact same scene.&nbsp; Fortunately there are places on the web such as
<a href="http://www.avsforum.com/">AVSForum</a> where members take the time to do this.&nbsp; They usually do this to help people determine what kind of an upgrade they can expect when viewing the blu-ray compared to the DVD.&nbsp; Sometimes the differences are easy
 to see, and other times they are not as clear.&nbsp; I built this comparison tool as a way to see what differences exist, and provided a few ways to make those differences easier to see.&nbsp;
</p>
<p>This utility will allow the user to compare two different images using 3 different modes: dual view, swap view, and Rectangle View. Dual view will allow a side by side comparison where you see part of the first image, and the remaining part of the second
 image. Moving the mouse left or right will show more of one image, and less of the other. The swap mode will allow the user to see one image in its entirety, and then, when placing the mouse over the image, the application will swap the first image with the
 second one. The last mode will allow the user to specify a region that he or she wishes to compare. They can draw a rectangle using the mouse, and the application will show the first image with a chunk cut out, replacing the rectangle area with the equivalent
 area on the second image. The image below shows an example of the rectangle view.
</p>
<p>&nbsp; </p>
<p><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/bddvdcompare1_2.jpg"><img src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/bddvdcompare1_thumb.jpg" alt="bddvdcompare1" border="0" height="484" width="543"></a>
</p>
<h3>Notes</h3>
<p>The application is set to handle images that are 1920x1080 in resolution (the standard resolution of blu-ray movies).&nbsp; DVDs have a resolution of 720x480, but are typically up-converted to 1920x1080 in order to do a direct comparison.&nbsp; This upconversion is
 similar to what happens when you play a DVD on a 1080p high definition television.&nbsp; While it wouldn't be too difficult to handle other image sizes, to keep things simple, the application assumes the user will be providing images at the proper resolution.&nbsp;
 Using different images with different resolutions will result in incorrect behavior.
</p>
<p>At the time of this writing, Silverlight 3 beta has just recently been released, but has not been tested with this application.
</p>
<h3>Setup</h3>
<p>Before beginning, you must have Visual Studio 2008 SP1 or Visual Web Developer Express SP1.&nbsp; Be sure to install
<a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=c22d6a7b-546f-4407-8ef6-d60c8ee221ed&amp;displaylang=en">
Silverlight 2 Tools</a> in order to create and run the project.&nbsp; Once you have that, start a new Silverlight Application and call it BlurayDVDCompare, or whatever you desire.&nbsp; As shown in figure 1, choose the option to host Silverlight with an ASP.NET web application.
 This will create a web project and a separate Silverlight project.&nbsp;&nbsp;&nbsp;&nbsp; </p>
<p>&nbsp; </p>
<p><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/figure1_2.png"><img src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/figure1_thumb.png" alt="figure1" border="0" height="311" width="349"></a>
</p>
<p>&nbsp; </p>
<h3>Creating the UI </h3>
<p>Since we will be displaying HD images (1920x1080), our next step is to ensure that the browser adds scrollbars so that the entire Silverlight control can be seen.&nbsp; To do this, we need to open and edit the hosting web page (BlurayDVDCompareTestPage.aspx)
 and set the Width and Height properties of the Silverlight control to 1920 x 1200 as shown below.&nbsp; The 1200 is extra room for other controls that we will add.
</p>
<div id="codeSnippetWrapper">
<pre id="codeSnippet"><span>&lt;</span><span>asp:Silverlight</span> <span>ID</span><span>=&quot;Xaml1&quot;</span> <span>runat</span><span>=&quot;server&quot;</span><br><span>Source</span><span>=&quot;~/ClientBin/BlurayDVDCompare.xap&quot;</span><br><span>MinimumVersion</span><span>=&quot;2.0.31005.0&quot;</span> <span>Width</span><span>=&quot;1920&quot;</span> <span>Height</span><span>=&quot;1200&quot;</span> <span>/&gt;</span></pre>
<br>
</div>
<div>Our UI will be pretty simple.&nbsp; We will have a couple of textboxes which will be used so that a user can specify a URLs to images they wish to compare.&nbsp; We will also add a couple of progress indicators so that we can show progress when the images are being
 loaded.&nbsp;&nbsp; We will also have three radio buttons to allow the user to select which comparison mode they wish to use.&nbsp;
</div>
<p>The main part of our UI, will be the canvas that holds the two images that we are comparing.&nbsp; Each image has a clip region which will be used to display parts of each image or to hide/show an image.&nbsp; For example, in DualView mode, we want to display part
 of one image, and the remaining part of the second image.&nbsp; If no clip regions were set, the default behavior would force the second image to cover the first.&nbsp; The final thing we add is a border which we will be used to draw a line as a separator between the
 two images in DualView.&nbsp; In Rectangle view, the border is used to draw the rectangle.</p>
<div id="codeSnippetWrapper">
<pre id="codeSnippet"><span>&lt;</span><span>StackPanel</span><span>&gt;</span><br>    <span>&lt;</span><span>Canvas</span> <span>x:Name</span><span>=&quot;canvas&quot;</span> <span>Background</span><span>=&quot;White&quot;</span> <span>Width</span><span>=&quot;1920&quot;</span> <span>Height</span><span>=&quot;1080&quot;</span> <span>Margin</span><span>=&quot;0,5,0,0&quot;</span><span>&gt;</span>    <br>        <span>&lt;</span><span>Image</span> <span>x:Name</span><span>=&quot;img1&quot;</span> <span>Stretch</span><span>=&quot;None&quot;</span> <span>&gt;</span>        <br>            <span>&lt;</span><span>Image.Clip</span><span>&gt;</span><br>                <span>&lt;</span><span>RectangleGeometry</span>  <span>Rect</span><span>=&quot;0,0,960,1080&quot;</span> <span>x:Name</span><span>=&quot;rcImg1&quot;</span> <span>/&gt;</span><br>            <span>&lt;/</span><span>Image.Clip</span><span>&gt;</span><br>        <span>&lt;/</span><span>Image</span><span>&gt;</span><br><br>        <span>&lt;</span><span>Image</span> <span>x:Name</span><span>=&quot;img2&quot;</span> <span>Stretch</span><span>=&quot;None&quot;</span> <span>&gt;</span><br>            <span>&lt;</span><span>Image.Clip</span> <span>&gt;</span><br>                <span>&lt;</span><span>RectangleGeometry</span> <span>Rect</span><span>=&quot;960,0,1920,1080&quot;</span> <span>x:Name</span><span>=&quot;rcImg2&quot;</span>  <span>/&gt;</span><br>            <span>&lt;/</span><span>Image.Clip</span><span>&gt;</span><br>        <span>&lt;/</span><span>Image</span><span>&gt;</span>    <br>            <br>        <span>&lt;</span><span>Border</span> <span>x:Name</span><span>=&quot;border&quot;</span> <span>Width</span><span>=&quot;2&quot;</span> <span>Height</span><span>=&quot;1920&quot;</span> <span>Margin</span><span>=&quot;0,0,0,0&quot;</span> <span>BorderBrush</span><span>=&quot;Bisque&quot;</span> <span>BorderThickness</span><span>=&quot;0&quot;</span> <span>/&gt;</span><br>    <span>&lt;/</span><span>Canvas</span><span>&gt;</span><br><span>&lt;/</span><span>StackPanel</span><span>&gt;</span></pre>
<br>
</div>
<div>&nbsp;</div>
<h3>Implementation</h3>
<div>Since we want to allow the application to load images from the web, we define the LoadImages() method which accepts two URLs.&nbsp; In order to do this, we create new BitmapImage objects with the given URLs.&nbsp; This will load the images asynchronously and we
 will assign them as the image Source property for the two UIElements.&nbsp; Once loading has finished, they will automatically appear in the canvas.&nbsp;
</div>
<div>&nbsp;</div>
<div><b>C#</b></div>
<div id="codeSnippetWrapper">
<pre id="codeSnippet"><span>private</span> <span>void</span> LoadImages(<span>string</span> s1, <span>string</span> s2)<br>{<br>    brLoading.Visibility = Visibility.Visible;<br>    spLoadingError.Visibility = Visibility.Collapsed;<br><br>    <span>if</span> (<span>string</span>.IsNullOrEmpty(s1) || <span>string</span>.IsNullOrEmpty(s2))<br>    {<br>        txtLoadingError.Text = <span>&quot;Invalid image location given&quot;</span>;<br>        brLoading.Visibility = Visibility.Collapsed;<br>        spLoadingError.Visibility = Visibility.Visible;<br>        <span>return</span>;<br>    }<br><br>    prgLoading1.Value = 0;<br>    prgLoading2.Value = 0;<br>    <br>    _bmi1 = <span>new</span> BitmapImage();<br>    _bmi2 = <span>new</span> BitmapImage();<br>    _bmi1.DownloadProgress &#43;= <span>new</span> EventHandler&lt;DownloadProgressEventArgs&gt;(bmi1_DownloadProgress);<br>    _bmi2.DownloadProgress &#43;= <span>new</span> EventHandler&lt;DownloadProgressEventArgs&gt;(bmi2_DownloadProgress);<br><br>    _bmi1.UriSource = <span>new</span> Uri(s1, UriKind.Absolute);<br>    _bmi2.UriSource = <span>new</span> Uri(s2, UriKind.Absolute);<br><br>    img1.Source = _bmi1;<br>    img2.Source = _bmi2;           <br>}</pre>
<br>
</div>
<div>&nbsp;</div>
<div><b>VB</b></div>
<div id="codeSnippetWrapper">
<pre id="codeSnippet"><span>Private</span> <span>Sub</span> LoadImages(<span>ByVal</span> s1 <span>As</span> <span>String</span>, <span>ByVal</span> s2 <span>As</span> <span>String</span>)<br>    brLoading.Visibility = Visibility.Visible<br>    spLoadingError.Visibility = Visibility.Collapsed<br><br>    <span>If</span> <span>String</span>.IsNullOrEmpty(s1) <span>OrElse</span> <span>String</span>.IsNullOrEmpty(s2) <span>Then</span><br>        txtLoadingError.Text = <span>&quot;Invalid image location given&quot;</span><br>        brLoading.Visibility = Visibility.Collapsed<br>        spLoadingError.Visibility = Visibility.Visible<br>        <span>Return</span><br>    <span>End</span> <span>If</span><br><br>    prgLoading1.Value = 0<br>    prgLoading2.Value = 0<br><br>    _bmi1 = <span>New</span> BitmapImage()<br>    _bmi2 = <span>New</span> BitmapImage()<br>    <span>AddHandler</span> _bmi1.DownloadProgress, <span>AddressOf</span> bmi1_DownloadProgress<br>    <span>AddHandler</span> _bmi2.DownloadProgress, <span>AddressOf</span> bmi2_DownloadProgress<br><br>    _bmi1.UriSource = <span>New</span> Uri(s1, UriKind.Absolute)<br>    _bmi2.UriSource = <span>New</span> Uri(s2, UriKind.Absolute)<br><br>    img1.Source = _bmi1<br>    img2.Source = _bmi2<br><span>End</span> Sub</pre>
<br>
</div>
<div>Now that we have a way to load images, the next step is to handle the different type of comparison modes.&nbsp;&nbsp; We will start with the dual view since that will be our default mode.&nbsp; As mentioned earlier, the dual view basically shows both images side by side
 in such a way where both images are presented as one. The first image is partially shown, and the second is shown as a continuation of the first.&nbsp; In order to do this, we track the mouse movement when it is inside of the canvas by setting up a MouseMove event
 handler.&nbsp; Every time the mouse moves, we grab the new x,y coordinates.&nbsp; Since dual view is only concerned with left/right movement, we only pass in the x coordinate.&nbsp;&nbsp;&nbsp;
</div>
<div>&nbsp;</div>
<div><b>C#</b></div>
<div id="codeSnippetWrapper">
<pre id="codeSnippet"><span>void</span> canvas_MouseMove(<span>object</span> sender, MouseEventArgs e)<br>{<br>    <span>double</span> x = e.GetPosition(canvas).X;<br>    <span>double</span> y = e.GetPosition(canvas).Y;<br>    <br>    <span>if</span> (_comparisonMode == ComparisonMode.DualView)<br>        DisplayDualView(x);<br>    <span>else</span> <span>if</span> (_comparisonMode == ComparisonMode.Rectangle)<br>    {<br>        <span>// ...</span><br>    }<br>}</pre>
<br>
</div>
<div><b>VB</b></div>
<div id="codeSnippetWrapper">
<pre id="codeSnippet"><span>Private</span> <span>Sub</span> canvas_MouseMove(<span>ByVal</span> sender <span>As</span> <span>Object</span>, <span>ByVal</span> e <span>As</span> MouseEventArgs)<br>    <span>Dim</span> x <span>As</span> <span>Double</span> = e.GetPosition(canvas).X<br>    <span>Dim</span> y <span>As</span> <span>Double</span> = e.GetPosition(canvas).Y<br><br>    <span>If</span> _comparisonMode = ComparisonMode.DualView <span>Then</span><br>        DisplayDualView(x)<br>    <span>ElseIf</span> _comparisonMode = ComparisonMode.Rectangle <span>Then</span>            <span>' .....</span><br>    <span>End</span> <span>If</span><br><span>End</span> Sub</pre>
<br>
</div>
<div><b>C#</b></div>
<div id="codeSnippetWrapper">
<pre id="codeSnippet"><span>private</span> <span>void</span> DisplayDualView(<span>double</span> x)<br>{<br>    rcImg1.Rect = <span>new</span> Rect(0, 0, x, IMGHEIGHT);         <span>// Show the first half (left side), up to xCoord</span><br>    rcImg2.Rect = <span>new</span> Rect(x, 0, IMGWIDTH, IMGHEIGHT);  <span>// Show the second-half (right side), starting from xCoord</span><br><br>    Canvas.SetLeft(border, x);                          <span>// make the separator start at x</span><br>    Canvas.SetTop(border, 0);                           <span>// set the separator to the top</span><br>}</pre>
<br>
</div>
<div><b>VB</b></div>
<div id="codeSnippetWrapper">
<pre id="codeSnippet"><span>Private</span> <span>Sub</span> DisplayDualView(<span>ByVal</span> x <span>As</span> <span>Double</span>)<br>    rcImg1.Rect = <span>New</span> Rect(0, 0, x, IMGHEIGHT)         <span>' Show the first half (left side), up to xCoord</span><br>    rcImg2.Rect = <span>New</span> Rect(x, 0, IMGWIDTH, IMGHEIGHT)  <span>' Show the second-half (right side), starting from xCoord</span><br><br>    Canvas.SetLeft(border, x) <span>' make the separator start at x</span><br>    Canvas.SetTop(border, 0)  <span>' set the separator to the top</span><br><span>End</span> <span>Sub</span><br></pre>
<br>
</div>
<div><b></b>&nbsp;</div>
<div>The DisplayDualView() method sets the image clip region of the first image to be a rectangle starting from pixel 0 to pixel x, then sets the clip region of the second image to be the remaining pixels.&nbsp; It uses our border to represent a break in the two
 images so that it is clear where our mouse is. Note that the border is defined as having a width of 2 and a height of 1080 in order to display as a single line separating the two images.&nbsp; The border size is defined when the comparison mode is selected.</div>
<div>&nbsp;</div>
<div>For the next comparison, we will focus on is the swap view mode.&nbsp; This is the easiest one to implement.&nbsp; In this, we show the first image in its entirety until the user places the mouse inside the canvas.&nbsp; When that happens, the second image is displayed
 until the user moves the mouse outside of the canvas. </div>
<div>&nbsp;</div>
<div><b>C#</b></div>
<div id="codeSnippetWrapper">
<pre id="codeSnippet"><span>private</span> <span>void</span> DisplaySwapView(<span>bool</span> mouseOver)<br>{<br>    <span>if</span> (!mouseOver)<br>    {<br>        rcImg1.Rect = <span>new</span> Rect(0, 0, IMGWIDTH, IMGHEIGHT);<br>        rcImg2.Rect = <span>new</span> Rect(0, 0, 0, 0);<br>    }<br>    <span>else</span><br>    {<br>        rcImg1.Rect = <span>new</span> Rect(0, 0, 0, 0);<br>        rcImg2.Rect = <span>new</span> Rect(0, 0, IMGWIDTH, IMGHEIGHT);<br>    }<br>}</pre>
<br>
</div>
<div><b>VB</b></div>
<div id="codeSnippetWrapper">
<pre id="codeSnippet"><span>Private</span> <span>Sub</span> DisplaySwapView(<span>ByVal</span> mouseOver <span>As</span> <span>Boolean</span>)<br>    <span>If</span> (<span>Not</span> mouseOver) <span>Then</span><br>        rcImg1.Rect = <span>New</span> Rect(0, 0, IMGWIDTH, IMGHEIGHT)<br>        rcImg2.Rect = <span>New</span> Rect(0, 0, 0, 0)<br>    <span>Else</span><br>        rcImg1.Rect = <span>New</span> Rect(0, 0, 0, 0)<br>        rcImg2.Rect = <span>New</span> Rect(0, 0, IMGWIDTH, IMGHEIGHT)<br>    <span>End</span> <span>If</span><br><span>End</span> <span>Sub</span><br></pre>
<br>
</div>
<div><b></b></div>
<div>Our DisplaySwapView() method is very basic in that it basically uses the clip region to show an entire image, or to show none of the image depending on the value of the passed in bool, mouseOver.&nbsp; When mouseOver is false, we show the first image, when
 true we show the second image.&nbsp; While we could have used the Visibility property to show/hide the images, we use clipping in order to be consistent with our other modes.</div>
<p>The rectangle view is the last and most involved.&nbsp; Since the user will be drawing a rectangle with the mouse, we must keep track of mouse movement, the state of the mouse button, and the coordinates for the rectangle.&nbsp; We also need to display the rectangle
 as the user is drawing it and update clipped area of the image in real time in.&nbsp; In order to make this easier, we create a class called MouseRectangle will contain the important information about the mouse state and rectangle size and location.&nbsp;
</p>
<div><b>C#</b></div>
<div id="codeSnippetWrapper">
<pre id="codeSnippet"><span>public</span> <span>class</span> MouseRectangle<br>{<br>    <span>public</span> <span>bool</span> MouseLeftButtonDown { get; set;}<br>    <span>private</span> Rect _rtg;<br><br>    <span>private</span> <span>double</span>? _startX;<br>    <span>private</span> <span>double</span>? _startY;<br><br>    <span>public</span> <span>bool</span> RectangleIsDrawn { get; set; }<br>    <span>public</span> Rect Rectangle { get { <span>return</span> _rtg;} }<br><br>    <span>public</span> MouseRectangle()<br>    {<br>        RectangleIsDrawn = <span>false</span>;<br>    }<br><br>    <span>public</span> <span>void</span> Reset()<br>    {<br>        _startX = <span>null</span>;<br>        _startY = <span>null</span>;<br>        RectangleIsDrawn = <span>false</span>;<br>    }<br><br>    <span>public</span> <span>void</span> CalculateRectangle(<span>double</span> x, <span>double</span> y)<br>    {<br>        <span>if</span> (_startX == <span>null</span>)<br>            _startX = x;<br>        <span>if</span> (_startY == <span>null</span>)<br>            _startY = y;<br><br>        <span>// pick the smaller of the two</span><br>        <span>double</span> left = Math.Min(_startX.Value, x);<br>        <span>double</span> top = Math.Min(_startY.Value, y);<br><br>        _rtg = <span>new</span> Rect(left, top, Math.Abs(_startX.Value - x), Math.Abs(_startY.Value - y));             <br>    }<br><br>    <span>public</span> <span>bool</span> InBoundsOfRect(<span>double</span> x, <span>double</span> y)<br>    {<br>        <span>if</span> (x &gt; _rtg.Left &amp;&amp; x &lt; _rtg.Right &amp;&amp;<br>            y &gt; _rtg.Top &amp;&amp; y &lt; _rtg.Bottom)<br>            <span>return</span> <span>true</span>;<br>        <span>return</span> <span>false</span>;<br>    }<br><br>}</pre>
<br>
</div>
<div><b>VB</b></div>
<div id="codeSnippetWrapper">
<pre id="codeSnippet"><span>Public</span> <span>Class</span> MouseRectangle<br>    <span>Private</span> privateMouseLeftButtonDown <span>As</span> <span>Boolean</span><br>    <span>Public</span> <span>Property</span> MouseLeftButtonDown() <span>As</span> <span>Boolean</span><br>        <span>Get</span><br>            <span>Return</span> privateMouseLeftButtonDown<br>        <span>End</span> <span>Get</span><br>        <span>Set</span>(<span>ByVal</span> value <span>As</span> <span>Boolean</span>)<br>            privateMouseLeftButtonDown = value<br>        <span>End</span> <span>Set</span><br>    <span>End</span> <span>Property</span><br>    <span>Private</span> _rtg <span>As</span> Rect<br><br>    <span>Private</span> _startX? <span>As</span> <span>Double</span><br>    <span>Private</span> _startY? <span>As</span> <span>Double</span><br><br>    <span>Private</span> privateRectangleIsDrawn <span>As</span> <span>Boolean</span><br>    <span>Public</span> <span>Property</span> RectangleIsDrawn() <span>As</span> <span>Boolean</span><br>        <span>Get</span><br>            <span>Return</span> privateRectangleIsDrawn<br>        <span>End</span> <span>Get</span><br>        <span>Set</span>(<span>ByVal</span> value <span>As</span> <span>Boolean</span>)<br>            privateRectangleIsDrawn = value<br>        <span>End</span> <span>Set</span><br>    <span>End</span> <span>Property</span><br>    <span>Public</span> <span>ReadOnly</span> <span>Property</span> Rectangle() <span>As</span> Rect<br>        <span>Get</span><br>            <span>Return</span> _rtg<br>        <span>End</span> <span>Get</span><br>    <span>End</span> <span>Property</span><br><br>    <span>Public</span> <span>Sub</span> <span>New</span>()<br>        RectangleIsDrawn = <span>False</span><br>    <span>End</span> <span>Sub</span><br><br>    <span>Public</span> <span>Sub</span> Reset()<br>        _startX = <span>Nothing</span><br>        _startY = <span>Nothing</span><br>        RectangleIsDrawn = <span>False</span><br>    <span>End</span> <span>Sub</span><br><br>    <span>Public</span> <span>Sub</span> CalculateRectangle(<span>ByVal</span> x <span>As</span> <span>Double</span>, <span>ByVal</span> y <span>As</span> <span>Double</span>)<br>        <span>If</span> <span>Not</span> _startX.HasValue <span>Then</span><br>            _startX = x<br>        <span>End</span> <span>If</span><br>        <span>If</span> <span>Not</span> _startY.HasValue <span>Then</span><br>            _startY = y<br>        <span>End</span> <span>If</span><br><br>        <span>' pick the smaller of the two</span><br>        <span>Dim</span> left <span>As</span> <span>Double</span> = Math.Min(_startX.Value, x)<br>        <span>Dim</span> top <span>As</span> <span>Double</span> = Math.Min(_startY.Value, y)<br><br>        _rtg = <span>New</span> Rect(left, top, Math.Abs(_startX.Value - x), Math.Abs(_startY.Value - y))<br>    <span>End</span> <span>Sub</span><br><br>    <span>Public</span> <span>Function</span> InBoundsOfRect(<span>ByVal</span> x <span>As</span> <span>Double</span>, <span>ByVal</span> y <span>As</span> <span>Double</span>) <span>As</span> <span>Boolean</span><br>        <span>If</span> x &gt; _rtg.Left <span>AndAlso</span> x &lt; _rtg.Right <span>AndAlso</span> y &gt; _rtg.Top <span>AndAlso</span> y &lt; _rtg.Bottom <span>Then</span><br>            <span>Return</span> <span>True</span><br>        <span>End</span> <span>If</span><br>        <span>Return</span> <span>False</span><br>    <span>End</span> <span>Function</span><br><br><span>End</span> Class</pre>
<br>
</div>
<div>The MouseLeftButtonDown property keeps track of whether the left button is currently being held down.&nbsp; There is also a Rect (_rtg) object which contains the location and dimension of the rectangle that has been drawn.&nbsp; The _startX and _startY member variables
 are nullable doubles used to keep track of the initial location where the mouse button was pressed.&nbsp;
</div>
<div>&nbsp;</div>
<div>Our CalculateRectangle() method is what we use to create the dimensions and location of the rectangle.&nbsp; We start by looking at the inital x,y coordinates, and if they are not set, it means the rectangle hasn't been drawn.&nbsp; In that case, a 0 pixel rectangle
 will be created.&nbsp; If those values are already set, we create the rectangle based on the x and y values passed in.</div>
<div>&nbsp;</div>
<div>The InBoundsOfRect() method is a simple helper function that will tell us whether or not an x,y coordinate is within the bounds of the rectangle.
</div>
<div>&nbsp;</div>
<div>When in rectangle mode, the rectangle drawing begins when the mouse's left button is pressed down, and when the mouse is de-pressed, the drawing ends, and we consider the rectangle complete.</div>
<div>&nbsp;</div>
<div><b>C#</b></div>
<div id="codeSnippetWrapper">
<pre id="codeSnippet"><span>void</span> canvas_MouseLeftButtonDown(<span>object</span> sender, MouseButtonEventArgs e)<br>{<br>    _mouseRectangle.Reset();<br>    _mouseRectangle.MouseLeftButtonDown = <span>true</span>;<br>}<br><br><span>void</span> canvas_MouseLeftButtonUp(<span>object</span> sender, MouseButtonEventArgs e)<br>{<br>    _mouseRectangle.MouseLeftButtonDown = <span>false</span>;<br>    _mouseRectangle.RectangleIsDrawn = <span>true</span>;<br>}</pre>
<br>
</div>
<div><b>VB</b></div>
<div id="codeSnippetWrapper">
<pre id="codeSnippet"><span>Private</span> <span>Sub</span> canvas_MouseLeftButtonDown(<span>ByVal</span> sender <span>As</span> <span>Object</span>, <span>ByVal</span> e <span>As</span> MouseButtonEventArgs)<br>    _mouseRectangle.Reset()<br>    _mouseRectangle.MouseLeftButtonDown = <span>True</span><br><span>End</span> <span>Sub</span><br><br><span>Private</span> <span>Sub</span> canvas_MouseLeftButtonUp(<span>ByVal</span> sender <span>As</span> <span>Object</span>, <span>ByVal</span> e <span>As</span> MouseButtonEventArgs)<br>    _mouseRectangle.MouseLeftButtonDown = <span>False</span><br>    _mouseRectangle.RectangleIsDrawn = <span>True</span><br><span>End</span> Sub</pre>
<br>
</div>
<div>While in rectangle mode, when the mouse moves over the canvas, there are two different states.&nbsp; If the mouse button is pressed, it means the user is drawing, and our goal is to update the rectangle to match the location where the user's mouse is in relation
 to the canvas.</div>
<div>&nbsp;</div>
<div><b>C#</b></div>
<div id="codeSnippetWrapper">
<pre id="codeSnippet">...<br><span>else</span> <span>if</span> (_comparisonMode == ComparisonMode.Rectangle)<br>{<br>    <span>if</span> (_mouseRectangle.MouseLeftButtonDown)<br>        DrawRectangle(x,y);<br>    <span>else</span> <span>if</span> (_mouseRectangle.RectangleIsDrawn)<br>        DisplayRectangleView(x,y);<br>}<br>...</pre>
<br>
</div>
<div><b>VB</b></div>
<div id="codeSnippetWrapper">
<pre id="codeSnippet">...<br><span>ElseIf</span> _comparisonMode = ComparisonMode.Rectangle <span>Then</span><br>    <span>If</span> _mouseRectangle.MouseLeftButtonDown <span>Then</span><br>        DrawRectangle(x,y)<br>    <span>ElseIf</span> _mouseRectangle.RectangleIsDrawn <span>Then</span><br>        DisplayRectangleView(x,y)<br>    <span>End</span> <span>If</span><br><span>End</span> <span>If</span><br>...</pre>
<br>
</div>
<div>The DrawRectangle() method starts out by calculating the rectangle based on the current x,y coordinates.&nbsp; We then set the border to represent our rectangle outline by sitting its location based on the _mouseRectangle's Rectangle property.&nbsp; Finally we draw
 the first image in its entirety, and the second image will only display the portion of the image based on the rectangle's location and width/height information.&nbsp; This will result in seeing the the first image with the rectangular portion showing the corresponding
 2nd image.</div>
<p><b>C#</b></p>
<div id="codeSnippetWrapper">
<pre id="codeSnippet"><span>private</span> <span>void</span> DrawRectangle(<span>double</span> x, <span>double</span> y)<br>{<br>    _mouseRectangle.CalculateRectangle(x,y);<br><br>    Canvas.SetLeft(border, _mouseRectangle.Rectangle.Left);<br>    Canvas.SetTop(border, _mouseRectangle.Rectangle.Top);<br>    border.Width = _mouseRectangle.Rectangle.Width;<br>    border.Height = _mouseRectangle.Rectangle.Height;<br><br>    rcImg1.Rect = <span>new</span> Rect(0, 0, IMGWIDTH, IMGHEIGHT);<br>    rcImg2.Rect = _mouseRectangle.Rectangle;<br>}</pre>
<br>
</div>
<div><b>VB</b></div>
<div id="codeSnippetWrapper">
<pre id="codeSnippet"><span>Private</span> <span>Sub</span> DrawRectangle(<span>ByVal</span> x <span>As</span> <span>Double</span>, <span>ByVal</span> y <span>As</span> <span>Double</span>)<br>    _mouseRectangle.CalculateRectangle(x, y)<br><br>    Canvas.SetLeft(border, _mouseRectangle.Rectangle.Left)<br>    Canvas.SetTop(border, _mouseRectangle.Rectangle.Top)<br>    border.Width = _mouseRectangle.Rectangle.Width<br>    border.Height = _mouseRectangle.Rectangle.Height<br><br>    rcImg1.Rect = <span>New</span> Rect(0, 0, IMGWIDTH, IMGHEIGHT)<br>    rcImg2.Rect = _mouseRectangle.Rectangle<br><span>End</span> Sub</pre>
<br>
</div>
<div>When the mouse button has been de-pressed, and the rectangle has been completed, we add the ability to do a mouse over effect for the rectangular region.&nbsp; While the mouse is located outside of the drawn rectangle, we leave it as is.&nbsp; If the user moves
 the mouse within the rectangle, we want them to see what the original looked like, so we display only the first image.&nbsp;
</div>
<p><b>C#</b></p>
<div id="codeSnippetWrapper">
<pre id="codeSnippet"><span>private</span> <span>void</span> DisplayRectangleView(<span>double</span> x, <span>double</span> y)<br>{<br>    rcImg1.Rect = <span>new</span> Rect(0, 0, IMGWIDTH, IMGHEIGHT);<br><br>    <span>if</span> (_mouseRectangle.InBoundsOfRect(x,y))<br>        rcImg2.Rect = <span>new</span> Rect(0, 0, 0, 0);<br>    <span>else</span><br>        rcImg2.Rect = _mouseRectangle.Rectangle;<br><br>}</pre>
<br>
</div>
<div><b>VB</b></div>
<div id="codeSnippetWrapper">
<pre id="codeSnippet"><span>Private</span> <span>Sub</span> DisplayRectangleView(<span>ByVal</span> x <span>As</span> <span>Double</span>, <span>ByVal</span> y <span>As</span> <span>Double</span>)<br>    rcImg1.Rect = <span>New</span> Rect(0, 0, IMGWIDTH, IMGHEIGHT)<br><br>    <span>If</span> _mouseRectangle.InBoundsOfRect(x, y) <span>Then</span><br>        rcImg2.Rect = <span>New</span> Rect(0, 0, 0, 0)<br>    <span>Else</span><br>        rcImg2.Rect = _mouseRectangle.Rectangle<br>    <span>End</span> <span>If</span><br><br><span>End</span> Sub</pre>
<br>
</div>
<div>&nbsp;</div>
<h3>Conclusion &amp; Future Work</h3>
<p>Overall, the blu-ray DVD comparison utility is a pretty straight-forward Silverlight application that you can use to see the differences between two images.&nbsp; These images don't even need to be from blu-ray or DVD sources, but as long as they are the right
 dimension, a user can use it to see subtle differences between the two by allowing three different comparison modes.&nbsp; For blu-ray purchases when you already own the DVD, I think it helps to see what kind of benefit you will get by moving to blu-ray.&nbsp; It has
 been my experience that almost every blu-ray offers some type of picture upgrade over its DVD counterpart (and sound upgrade as well).&nbsp; Sometimes the differences are subtle, sometimes they are incredibly better.&nbsp; There are a lot of factors involved, but&nbsp;
</p>
<p>Some future work that can be done to this is adding the ability to zoom in and out on the images in order to be able to see differences in a closer view.&nbsp;&nbsp; Soon there will be more movies which will be re-released on blu-ray and you can use the tool to compare
 the old release to the new one.&nbsp; This will require zooming to see some of the more finer differences.&nbsp; Other work can be done by creating a database to hold links, and have a control that allows a user to navigate to different movies and view different comparisons.&nbsp;
 I have started doing both of these, but they were not ready for this article. </p>
<p>One definite area that needs work is the UI.&nbsp; I am not good at laying out user interfaces or creating new xaml styles, so I left them default.&nbsp;
</p>
<p>What would be really useful is a full motion comparison where you can use similar modes to see how two movies compare while in motion, but the biggest problem would be finding or creating the comparison material.&nbsp; Playback would be limiting as well since
 it requires higher end CPUs/video cards.&nbsp;&nbsp; </p>
<h3>Comparisons</h3>
<p>Here are a few URLs you can use to play with the comparison utility:</p>
<table border="0" cellpadding="2" cellspacing="0" width="459">
<tbody>
<tr>
<td valign="top" width="109">&nbsp;</td>
<td valign="top" width="348">URL of Standard Def image (DVD) / HD (Blu-ray)</td>
</tr>
<tr>
<td valign="top" width="109">Prince Caspian</td>
<td valign="top" width="348"><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/pc_1_sd.png" title="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/pc_1_sd.png">http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/pc_1_sd.png</a>
<br>
<a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/pc_1_hd.png" title="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/pc_1_hd.png">http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/pc_1_hd.png</a></td>
</tr>
<tr>
<td valign="top" width="109">Prince Caspian</td>
<td valign="top" width="348"><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/pc_2_sd.png" title="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/pc_1_sd.png">http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/pc_2_sd.png</a>
<br>
<a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/pc_2_hd.png" title="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/pc_1_hd.png">http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/pc_2_hd.png</a></td>
</tr>
<tr>
<td valign="top" width="109">Iron Man</td>
<td valign="top" width="348"><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/im_1_sd.png" title="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/im_1_sd.png">http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/im_1_sd.png</a>
<br>
<a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/im_1_hd.png" title="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/im_1_hd.png">http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/im_1_hd.png</a></td>
</tr>
<tr>
<td valign="top" width="109">Iron Man</td>
<td valign="top" width="348"><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/im_2_sd.png" title="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/im_2_sd.png">http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/im_2_sd.png</a>
<br>
<a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/im_2_hd.png" title="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/im_2_hd.png">http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/im_2_hd.png</a></td>
</tr>
<tr>
<td valign="top" width="109">Entrapment</td>
<td valign="top" width="348"><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/Ent_4_SD.png" title="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/Ent_4_SD.png">http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/Ent_4_SD.png</a>
<br>
<a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/Ent_4_HD.png" title="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/Ent_4_HD.png">http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9515699/Ent_4_HD.png</a></td>
</tr>
</tbody>
</table>
<p>Note: Images were copied from the blu-ray threads of A/V Science Forum: <a href="http://www.avsforum.com/">
www.avsforum.com</a> .</p>
<h3>Thanks</h3>
<p>I would like to thank <a href="http://www.brianpeek.com/" target="_blank">Brian Peek</a> for introducing me to Coding4Fun, and taking the time to review my article and test the code.</p>
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:e3d3615b2a654770a9729e7600ccf464">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/articles/Blu-rayDVD-Comparison-Utility</comments>
      <itunes:summary>



In this article, Giovanni Montrone will provide an overview on how to create an image comparison application for DVD and Blu-ray screen captures.



Giovanni Montrone
ASPSOFT, Inc.

Difficulty: Beginner
Time Required: 2-3 hours
Cost: Free
Software: Visual Web Developer Express SP1 (or Visual Studio 2008 SP1),

Silverlight 2 Tools
Hardware: None
Application: Run the application
Source Download: Download the source




&amp;nbsp; 
Introduction
As a fan of High Definition movies and television, I often find it difficult to explain the benefits of upgrading from DVD to blu-ray to family and friends.&amp;nbsp; Many people believe that DVDs look good enough and/or that you need a really big television to notice
 the difference, and, even then, feel the improvement is not good enough to justify the upgrade.&amp;nbsp; The best way to convince someone is to show him/her the same movie playing side by side on blu-ray and dvd using the same sized screens.&amp;nbsp; Since it&#39;s difficult
 to do, the next best thing is to look at still images from both the DVD and the blu-ray and compare them.&amp;nbsp; The images should be from the exact same scene.&amp;nbsp; Fortunately there are places on the web such as
AVSForum where members take the time to do this.&amp;nbsp; They usually do this to help people determine what kind of an upgrade they can expect when viewing the blu-ray compared to the DVD.&amp;nbsp; Sometimes the differences are easy
 to see, and other times they are not as clear.&amp;nbsp; I built this comparison tool as a way to see what differences exist, and provided a few ways to make those differences easier to see.&amp;nbsp;
 
This utility will allow the user to compare two different images using 3 different modes: dual view, swap view, and Rectangle View. Dual view will allow a side by side comparison where you see part of the first image, and the remaining part of the second
 image. Moving the mouse left or right will show more of one image, and less of the other. The swap mode will allow the user to </itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/articles/Blu-rayDVD-Comparison-Utility</link>
      <pubDate>Sat, 28 Mar 2009 04:30:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/articles/Blu-rayDVD-Comparison-Utility</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/c4f/images/9515699_100.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/c4f/images/9515699_220.jpg" height="165" width="220"></media:thumbnail>      
      <dc:creator>Giovanni Montrone </dc:creator>
      <itunes:author>Giovanni Montrone </itunes:author>
      <slash:comments>2</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/articles/Blu-rayDVD-Comparison-Utility/RSS</wfw:commentRss>
      <category>Media</category>
      <category>Silverlight</category>
      <category>Web</category>
    </item>
  <item>
      <title>HP&amp;rsquo;s New TouchSmart PCs</title>
      <description><![CDATA[On the <a href="http://windowsvistablog.com/blogs/windowsexperience/archive/2008/10/06/hp-announces-new-hp-touchsmart-pcs.aspx">Windows Experience blog</a>, Brandon has the scoop on the next generation of HP TouchSmart PCs: the <a href="http://www.hp.com/hpinfo/newsroom/press/2008/080916a.html">IQ804 and IQ816</a>. These new PCs are bigger than the previous models (25.5” vs. 22”) and, like the older ones, they let you shine ambient lighting on your keyboard. However, now, you can change the color of that light. As someone who wanted to purchase the HP MediaSmart WHS just for the <a href="http://on10.net/blogs/sarahintampa/20354/Default.aspx">Easter egg where you can customize the lighting scheme</a>, I have to admit this makes the new TouchSmart PCs look pretty sexy to me. But those pretty lights aren’t all the new PCs have to offer: they also come with a pocket media drive for portable media, built-in TV tuners, giant hard drives (804 = 500GB, 816=750GB), a wall-mounting kit, a Blu-ray drive, screens with an image resolution of 1920x1200 pixels, and, of course, a natural user interface that works via touch.  <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:41ac67eaf0ef485f8dab9e0e00c1af1a">]]></description>
      <comments>http://channel9.msdn.com/Blogs/coolstuff/HPrsquos-New-TouchSmart-PCs</comments>
      <itunes:summary>On the Windows Experience blog, Brandon has the scoop on the next generation of HP TouchSmart PCs: the IQ804 and IQ816. These new PCs are bigger than the previous models (25.5” vs. 22”) and, like the older ones, they let you shine ambient lighting on your keyboard. However, now, you can change the color of that light. As someone who wanted to purchase the HP MediaSmart WHS just for the Easter egg where you can customize the lighting scheme, I have to admit this makes the new TouchSmart PCs look pretty sexy to me. But those pretty lights aren’t all the new PCs have to offer: they also come with a pocket media drive for portable media, built-in TV tuners, giant hard drives (804 = 500GB, 816=750GB), a wall-mounting kit, a Blu-ray drive, screens with an image resolution of 1920x1200 pixels, and, of course, a natural user interface that works via touch. </itunes:summary>
      <link>http://channel9.msdn.com/Blogs/coolstuff/HPrsquos-New-TouchSmart-PCs</link>
      <pubDate>Wed, 08 Oct 2008 13:02:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/coolstuff/HPrsquos-New-TouchSmart-PCs</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/320/on10_962a6da6-fdbf-4fc8-98f7-0f0fb21cb4b3.jpg" height="0" width="0"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/85/on10_8165024d-a465-452f-b337-9d6bd3509c79.jpg" height="64" width="85"></media:thumbnail>      
      <dc:creator>Sarah Perez</dc:creator>
      <itunes:author>Sarah Perez</itunes:author>
      <slash:comments>2</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/coolstuff/HPrsquos-New-TouchSmart-PCs/RSS</wfw:commentRss>
      <category>HP</category>
      <category>Media</category>
      <category>touchscreen</category>
    </item>
  <item>
      <title>My Movies Plugin, Now For Home Server</title>
      <description><![CDATA[ <p>The upcoming My Movies plugin for Windows Home Server has a lot of people excited. Already available for <a href="http://on10.net/blogs/sarahintampa/My-Movies-Media-Center-Plugin/">Windows Media Center users</a>, the plugin will soon allow Home Server users to organize their extensive movie collections and use their Home Server as more of a media server. According to a new post on the <a href="http://www.wegotserved.co.uk/2008/10/07/add-in-my-movies-for-windows-home-server-v1003/">We Got Served blog</a>, the plugin will function as a standard server for My Movies clients, will include an automated “Disc Copier,” will automatically monitor movie folders added to or located on a WHS share, and will function as a metadata provider without the need for a My Movies client for Microsoft DVD library, Niveus Movie Library, Open Media Library, Media Portal, and hopefully soon XBMC. The plugin isn’t available in its final form just yet, but if you just can’t wait to try it out, a pre-release version is now available for download from <a href="http://www.mymovies.dk/forum.aspx?g=topics&amp;f=13">here</a>. </p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/media/RSS&WT.dl=0&WT.entryid=Entry:RSSView:00008af5421c4bed99b59e0e00ea86a9">]]></description>
      <comments>http://channel9.msdn.com/Blogs/coolstuff/My-Movies-Plugin-Now-For-Home-Server</comments>
      <itunes:summary> The upcoming My Movies plugin for Windows Home Server has a lot of people excited. Already available for Windows Media Center users, the plugin will soon allow Home Server users to organize their extensive movie collections and use their Home Server as more of a media server. According to a new post on the We Got Served blog, the plugin will function as a standard server for My Movies clients, will include an automated “Disc Copier,” will automatically monitor movie folders added to or located on a WHS share, and will function as a metadata provider without the need for a My Movies client for Microsoft DVD library, Niveus Movie Library, Open Media Library, Media Portal, and hopefully soon XBMC. The plugin isn’t available in its final form just yet, but if you just can’t wait to try it out, a pre-release version is now available for download from here.  </itunes:summary>
      <link>http://channel9.msdn.com/Blogs/coolstuff/My-Movies-Plugin-Now-For-Home-Server</link>
      <pubDate>Wed, 08 Oct 2008 12:57:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/coolstuff/My-Movies-Plugin-Now-For-Home-Server</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/320/on10_9ae57a6b-3c7d-4747-9e6d-cfd98c1abb74.jpg" height="0" width="0"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/100/on10_23698_100x75.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/220/on10_23698_220x165.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/85/on10_04e90869-8d9c-4f76-908a-30200b000519.jpg" height="64" width="85"></media:thumbnail>      
      <dc:creator>Sarah Perez</dc:creator>
      <itunes:author>Sarah Perez</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/coolstuff/My-Movies-Plugin-Now-For-Home-Server/RSS</wfw:commentRss>
      <category>Media</category>
      <category>Windows Home Server</category>
      <category>Movies</category>
      <category>plugin</category>
      <category>add-in&#39;s</category>
      <category>WHS</category>
      <category>Plugins</category>
      <category>Plug-in</category>
      <category>add-in</category>
    </item>    
</channel>
</rss>