<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Dean Rowe's WebLog</title><subtitle type="html">Expression Encoder with little bits of MovieMaker and DVD Maker.</subtitle><id>http://blogs.msdn.com/deanro/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/deanro/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/deanro/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2008-03-07T20:27:01Z</updated><entry><title>What’s New in the Expression Encoder 3 SDK?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/deanro/archive/2009/07/29/what-s-new-in-the-expression-encoder-3-sdk.aspx" /><id>http://blogs.msdn.com/deanro/archive/2009/07/29/what-s-new-in-the-expression-encoder-3-sdk.aspx</id><published>2009-07-30T09:55:46Z</published><updated>2009-07-30T09:55:46Z</updated><content type="html">&lt;p&gt;Just posted a little article talking about the Expression Encoder 3 SDK over on the Expression Encoder team blog.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/expressionencoder/archive/2009/07/29/9853000.aspx"&gt;Link&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9853004" width="1" height="1"&gt;</content><author><name>deanro</name><uri>http://blogs.msdn.com/members/deanro.aspx</uri></author></entry><entry><title>Microsoft Expression Encoder 3 is now available for download</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/deanro/archive/2009/07/22/microsoft-expression-encoder-3-is-now-available-for-download.aspx" /><id>http://blogs.msdn.com/deanro/archive/2009/07/22/microsoft-expression-encoder-3-is-now-available-for-download.aspx</id><published>2009-07-22T20:57:20Z</published><updated>2009-07-22T20:57:20Z</updated><content type="html">&lt;p&gt;Check out the details on the Expression Encoder blog. Download it and tell us what you think.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/expressionencoder/archive/2009/07/22/9845044.aspx"&gt;Link&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9845063" width="1" height="1"&gt;</content><author><name>deanro</name><uri>http://blogs.msdn.com/members/deanro.aspx</uri></author><category term="Expression Encoder" scheme="http://blogs.msdn.com/deanro/archive/tags/Expression+Encoder/default.aspx" /></entry><entry><title>Coming Soon: Expression Encoder 3</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/deanro/archive/2009/07/10/coming-soon-expression-encoder-3.aspx" /><id>http://blogs.msdn.com/deanro/archive/2009/07/10/coming-soon-expression-encoder-3.aspx</id><published>2009-07-10T21:38:28Z</published><updated>2009-07-10T21:38:28Z</updated><content type="html">&lt;p&gt;James has just updated the Expression Encoder blog with details of Expression Encoder 3. The product that has been keeping us busy for a while now. Once it’s out I’ll try to post a little bit more than I have in the past :-)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/expressionencoder/archive/2009/07/10/9828866.aspx"&gt;Link&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9828977" width="1" height="1"&gt;</content><author><name>deanro</name><uri>http://blogs.msdn.com/members/deanro.aspx</uri></author><category term="Expression Encoder" scheme="http://blogs.msdn.com/deanro/archive/tags/Expression+Encoder/default.aspx" /></entry><entry><title>Editing files with Encoder</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/deanro/archive/2009/03/16/editing-files-with-encoder.aspx" /><id>http://blogs.msdn.com/deanro/archive/2009/03/16/editing-files-with-encoder.aspx</id><published>2009-03-16T10:03:57Z</published><updated>2009-03-16T10:03:57Z</updated><content type="html">&lt;p&gt;In Encoder V2 we added the ability to edit multiple sections out of a video/audio file and this can also be accomplished with the Expression Encoder SDK. MediaItem has a property called SourceClips which contains the list of clips for that media item. When you create a MediaItem it starts with one clip that encompasses the entire duration of the source. Each clip is represented by the SourceClip class and that contains two properties StartTime and EndTime. These properties indicate the times within the source file that the clip represents. For example, if I wanted to change it so that I only encoded the first 15 seconds of the file I could do something like the following. &lt;/p&gt;  &lt;blockquote&gt;   &lt;pre class="code"&gt;&lt;span style="color: #2b91af"&gt;MediaItem &lt;/span&gt;item = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MediaItem&lt;/span&gt;(&lt;span style="color: #a31515"&gt;@&amp;quot;C:\myvideo.wmv&amp;quot;&lt;/span&gt;);
item.SourceClips[0].EndTime = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;TimeSpan&lt;/span&gt;(0, 0, 15);&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;If I wanted to include the time from 0-15 seconds and from 30-45 seconds of the file I could add the following lines.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;pre class="code"&gt;&lt;span style="color: #2b91af"&gt;TimeSpan &lt;/span&gt;timeStart = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;TimeSpan&lt;/span&gt;(0, 0, 30);
&lt;span style="color: #2b91af"&gt;TimeSpan &lt;/span&gt;timeEnd = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;TimeSpan&lt;/span&gt;(0, 0, 45);
item.SourceClips.Add(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;SourceClip&lt;/span&gt;(timeStart, timeEnd));&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can keep added SourceClip’s for as many sections of the source that you wish to add before calling the Encode method.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9480815" width="1" height="1"&gt;</content><author><name>deanro</name><uri>http://blogs.msdn.com/members/deanro.aspx</uri></author><category term="Expression Encoder" scheme="http://blogs.msdn.com/deanro/archive/tags/Expression+Encoder/default.aspx" /></entry><entry><title>Metadata</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/deanro/archive/2008/12/12/metadata.aspx" /><id>http://blogs.msdn.com/deanro/archive/2008/12/12/metadata.aspx</id><published>2008-12-13T09:56:57Z</published><updated>2008-12-13T09:56:57Z</updated><content type="html">&lt;p&gt;When encoding files using the Expression Encoder SDK, you may find there are times when you want to examine the current metadata and/or change the metadata on the file you’re creating. Let’s say you want to go through all the metadata items on an item, you can do something like this.&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: #2b91af"&gt;MediaItem &lt;/span&gt;mediaItem = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MediaItem&lt;/span&gt;(&lt;span style="color: #a31515"&gt;@&amp;quot;C:\myvideo.wmv&amp;quot;&lt;/span&gt;);
&lt;span style="color: blue"&gt;int &lt;/span&gt;metadataCount = 0;
&lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;KeyValuePair&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;, &lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt; pair &lt;span style="color: blue"&gt;in &lt;/span&gt;mediaItem.Metadata)
{
    &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(pair.Key + &lt;span style="color: #a31515"&gt;&amp;quot;-&amp;quot; &lt;/span&gt;+ pair.Value);
}&lt;/pre&gt;

&lt;p&gt;More frequently you’ll probably want to specify certain metadata before encoding the file. You can do this by doing something like the following before calling the Job’s Encode method&lt;/p&gt;

&lt;pre class="code"&gt;mediaItem.Metadata[&lt;span style="color: #2b91af"&gt;MetadataNames&lt;/span&gt;.Title] = &lt;span style="color: #a31515"&gt;&amp;quot;My Home Movies&amp;quot;&lt;/span&gt;;
mediaItem.Metadata[&lt;span style="color: #2b91af"&gt;MetadataNames&lt;/span&gt;.Author] = &lt;span style="color: #a31515"&gt;&amp;quot;Dean Rowe&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

&lt;p&gt;These are using the predefined metadata names that we’ve specified. If you want to specify your own custom metadata you can simply do something like&lt;/p&gt;

&lt;pre class="code"&gt;mediaItem.Metadata[&lt;span style="color: #a31515"&gt;&amp;quot;Fred&amp;quot;&lt;/span&gt;] = &lt;span style="color: #a31515"&gt;&amp;quot;Foo&amp;quot;&lt;/span&gt;;&lt;/pre&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9207042" width="1" height="1"&gt;</content><author><name>deanro</name><uri>http://blogs.msdn.com/members/deanro.aspx</uri></author><category term="Expression Encoder" scheme="http://blogs.msdn.com/deanro/archive/tags/Expression+Encoder/default.aspx" /></entry><entry><title>Expression Encoder 2 SDK Updated for Service Pack 1</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/deanro/archive/2008/11/13/expression-encoder-2-sdk-updated-for-service-pack-1.aspx" /><id>http://blogs.msdn.com/deanro/archive/2008/11/13/expression-encoder-2-sdk-updated-for-service-pack-1.aspx</id><published>2008-11-14T03:29:14Z</published><updated>2008-11-14T03:29:14Z</updated><content type="html">&lt;p&gt;I’ve just uploaded a post to the Expression Encoder team blog that talks about the new updates to the Expression Encoder 2 SDK that we’ve just released for Service Pack 1. Go ahead and try it out and let us know if you have any questions or comments.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/expressionencoder/archive/2008/11/13/9067983.aspx"&gt;Link&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9067992" width="1" height="1"&gt;</content><author><name>deanro</name><uri>http://blogs.msdn.com/members/deanro.aspx</uri></author></entry><entry><title>Bingo</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/deanro/archive/2008/11/11/bingo.aspx" /><id>http://blogs.msdn.com/deanro/archive/2008/11/11/bingo.aspx</id><published>2008-11-12T08:48:00Z</published><updated>2008-11-12T08:48:00Z</updated><content type="html">&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/deanro/WindowsLiveWriter/Bingo_132C6/image_4.png" mce_href="http://blogs.msdn.com/blogfiles/deanro/WindowsLiveWriter/Bingo_132C6/image_4.png"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; MARGIN-LEFT: 0px; BORDER-TOP: 0px; MARGIN-RIGHT: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image align=right src="http://blogs.msdn.com/blogfiles/deanro/WindowsLiveWriter/Bingo_132C6/image_thumb_1.png" width=231 height=244 mce_src="http://blogs.msdn.com/blogfiles/deanro/WindowsLiveWriter/Bingo_132C6/image_thumb_1.png"&gt;&lt;/A&gt; The other day my wife had volunteered to help out with the Halloween festivities at my son’s school. As part of this, she wanted to organize a game of bingo for the kids. I promised to help and went online to search for some halloween bingo cards that could be generated or printed out. Unfortunately my searches weren’t fruitful. I found ones with numbers or words, but nothing that allowed me to uses images – which I thought would make it more fun for the young kids. &lt;/P&gt;
&lt;P&gt;I thought about using Excel to generate the cards or maybe Word but that didn’t look to be as straightforward as I ‘d hope it might be. Then I thought “What about writing a quick WFP app?”. I hadn’t tried printing from WPF first, so I knocked up a quick app to try that out. Once that proved straightforward I just had to write some simple XAML to layout the card, get some halloween clipart from &lt;A href="http://office.microsoft.com/en-us/clipart/default.aspx" mce_href="http://office.microsoft.com/en-us/clipart/default.aspx"&gt;office online&lt;/A&gt; and write a little code to load and randomize the images. &lt;/P&gt;
&lt;P&gt;So here’s what I ended up with. Each time you run it the app you get a “random” card and every time you click “Print” a new card is generated so you can just keep printing until you have enough cards.&lt;/P&gt;
&lt;P&gt;The kids loved it. We gave a few prizes for the kids that got a line first and then we let the kids keeping playing until everybody had filled their card. Note that I deliberately chose to include every image on every card, so everybody filled out their card and shouted “house” at the same time. Of course it would be quite easy to change this behaviour.&lt;/P&gt;
&lt;P&gt;If you ever want to do something like this yourself, just launch Visual Studio and create a new WPF application. Here’s what my window1.xaml looked like.&lt;/P&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Window
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;x&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="http://schemas.microsoft.com/winfx/2006/xaml"
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;x&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Class&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="UntitledProject4.Window1"
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;x&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="Window"
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Title&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="Bingo"
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Width&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="850" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Height&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="900"&amp;gt;

    &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;StackPanel &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;x&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="LayoutRoot"&amp;gt;
        &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Border &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;x&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="BingoCard" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Margin&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="50,50,0,0" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;HorizontalAlignment&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="Left" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;VerticalAlignment&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="Top" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;BorderBrush&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="#FF000000" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;BorderThickness&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="5,5,5,5"&amp;gt;
            &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ItemsControl &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;ItemsSource&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Binding &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;ElementName&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=Window, &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Path&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=Images}" &amp;gt;
                &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ItemsControl.ItemsPanel&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
                    &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ItemsPanelTemplate&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
                        &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;WrapPanel &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;
                    &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ItemsPanelTemplate&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
                &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ItemsControl.ItemsPanel&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
                &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ItemsControl.ItemTemplate&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
                    &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;DataTemplate&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
                        &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Border &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Width&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="142" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Height&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="142" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;BorderBrush&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="#FF000000" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;BorderThickness&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="5,5,5,5"&amp;gt;
                            &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Image &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Width&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="Auto" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Height&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="Auto" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Source&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Binding &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Path&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=FileName}" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Margin&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="10,10,10,10"/&amp;gt;
                        &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Border&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
                    &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;DataTemplate&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
                &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ItemsControl.ItemTemplate&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
            &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ItemsControl&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
        &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Border&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
        &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Button &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;HorizontalAlignment&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="Left" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Margin&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="20,20,0,44" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Width&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="97" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Height&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="30" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Content&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="Print" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Click&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="OnPrint" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;IsDefault&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="True"/&amp;gt;
    &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;StackPanel&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Window&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;
&lt;P&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;and here’s the corresponding C# file.&lt;/P&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;using &lt;/SPAN&gt;System;
&lt;SPAN style="COLOR: blue"&gt;using &lt;/SPAN&gt;System.Collections.ObjectModel;
&lt;SPAN style="COLOR: blue"&gt;using &lt;/SPAN&gt;System.Windows;
&lt;SPAN style="COLOR: blue"&gt;using &lt;/SPAN&gt;System.Windows.Controls;

&lt;SPAN style="COLOR: blue"&gt;namespace &lt;/SPAN&gt;UntitledProject4
{
    &lt;SPAN style="COLOR: blue"&gt;public class &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ImageData
    &lt;/SPAN&gt;{
        &lt;SPAN style="COLOR: blue"&gt;public &lt;/SPAN&gt;ImageData(&lt;SPAN style="COLOR: blue"&gt;string &lt;/SPAN&gt;fileName)
        {
            &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.FileName = fileName;
        }

        &lt;SPAN style="COLOR: blue"&gt;public string &lt;/SPAN&gt;FileName { &lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: blue"&gt;set&lt;/SPAN&gt;; }    
    }

    &lt;SPAN style="COLOR: blue"&gt;public partial class &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Window1
    &lt;/SPAN&gt;{
        &lt;SPAN style="COLOR: gray"&gt;/// &amp;lt;summary&amp;gt;
        /// &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;The list of images that are databound to.
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;/// &amp;lt;/summary&amp;gt;
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;private &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ObservableCollection&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: #2b91af"&gt;ImageData&lt;/SPAN&gt;&amp;gt; m_images = &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ObservableCollection&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: #2b91af"&gt;ImageData&lt;/SPAN&gt;&amp;gt;();
        
        &lt;SPAN style="COLOR: gray"&gt;/// &amp;lt;summary&amp;gt;
        /// &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;The print dialog. We store it as a member variable so any printer settings are preserved
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;/// &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;across multiple prints.
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;/// &amp;lt;/summary&amp;gt;
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;private &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;PrintDialog &lt;/SPAN&gt;m_prtDlg = &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;PrintDialog&lt;/SPAN&gt;();

        &lt;SPAN style="COLOR: gray"&gt;/// &amp;lt;summary&amp;gt;
        /// &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;Initialize a instance of the Window1 class, that holds a bingo card.
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;/// &amp;lt;/summary&amp;gt;
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public &lt;/SPAN&gt;Window1()
        {
            &lt;SPAN style="COLOR: green"&gt;// Load the images - in this case I'm just loading them from c:\temp\halloween
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;for &lt;/SPAN&gt;(&lt;SPAN style="COLOR: blue"&gt;int &lt;/SPAN&gt;i = 1; i &amp;lt;= 25; i++)
            {
                m_images.Add(&lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ImageData&lt;/SPAN&gt;(&lt;SPAN style="COLOR: #a31515"&gt;@"C:\temp\halloween\" &lt;/SPAN&gt;+ i.ToString() + &lt;SPAN style="COLOR: #a31515"&gt;".bmp"&lt;/SPAN&gt;));
            }

            &lt;SPAN style="COLOR: green"&gt;// Randomize them.
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.RandomizeImages();

            &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.InitializeComponent();
        }

        &lt;SPAN style="COLOR: gray"&gt;/// &amp;lt;summary&amp;gt;
        /// &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;Gets the collection of images to use for the bingo card.
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;/// &amp;lt;/summary&amp;gt;
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ObservableCollection&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: #2b91af"&gt;ImageData&lt;/SPAN&gt;&amp;gt; Images
        {
            &lt;SPAN style="COLOR: blue"&gt;get
            &lt;/SPAN&gt;{
                &lt;SPAN style="COLOR: blue"&gt;return &lt;/SPAN&gt;m_images;
            }
        }

        &lt;SPAN style="COLOR: gray"&gt;/// &amp;lt;summary&amp;gt;
        /// &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;Called to print the bingo card. The images are randomized after every print.
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;/// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name="sender"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;The sender of the event.&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&amp;lt;/param&amp;gt;
        /// &amp;lt;param name="e"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;The event arguments&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&amp;lt;/param&amp;gt;
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;private void &lt;/SPAN&gt;OnPrint(&lt;SPAN style="COLOR: blue"&gt;object &lt;/SPAN&gt;sender, &lt;SPAN style="COLOR: #2b91af"&gt;RoutedEventArgs &lt;/SPAN&gt;e)
        {
            &lt;SPAN style="COLOR: blue"&gt;if &lt;/SPAN&gt;(m_prtDlg.ShowDialog() == &lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;)
            {
                m_prtDlg.PrintVisual(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.BingoCard, &lt;SPAN style="COLOR: #a31515"&gt;"Bingo"&lt;/SPAN&gt;);
            }

            RandomizeImages();
        }

        &lt;SPAN style="COLOR: gray"&gt;/// &amp;lt;summary&amp;gt;
        /// &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;Randomly shuffle the images
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;/// &amp;lt;/summary&amp;gt;
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;private void &lt;/SPAN&gt;RandomizeImages()
        {
            &lt;SPAN style="COLOR: #2b91af"&gt;Random &lt;/SPAN&gt;random = &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Random&lt;/SPAN&gt;();
            &lt;SPAN style="COLOR: blue"&gt;int &lt;/SPAN&gt;imagesCount = m_images.Count;
            &lt;SPAN style="COLOR: blue"&gt;for &lt;/SPAN&gt;(&lt;SPAN style="COLOR: blue"&gt;int &lt;/SPAN&gt;i = 0; i &amp;lt; imagesCount; i++)
            {
                &lt;SPAN style="COLOR: blue"&gt;int &lt;/SPAN&gt;randomIndex = random.Next(0, imagesCount);
                &lt;SPAN style="COLOR: #2b91af"&gt;ImageData &lt;/SPAN&gt;imageData = m_images[randomIndex];
                m_images[randomIndex] = m_images[i];
                m_images[i] = imageData;
            }
        }
    }
}&lt;/PRE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hopefully the code should be self explanatory.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9061396" width="1" height="1"&gt;</content><author><name>deanro</name><uri>http://blogs.msdn.com/members/deanro.aspx</uri></author><category term="WPF" scheme="http://blogs.msdn.com/deanro/archive/tags/WPF/default.aspx" /></entry><entry><title>Expression Encoder 2 SP1 SDK</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/deanro/archive/2008/11/10/expression-encoder-2-sp1-sdk.aspx" /><id>http://blogs.msdn.com/deanro/archive/2008/11/10/expression-encoder-2-sp1-sdk.aspx</id><published>2008-11-10T23:06:15Z</published><updated>2008-11-10T23:06:15Z</updated><content type="html">&lt;p&gt;As you may have heard &lt;a href="http://blogs.msdn.com/expressionencoder/archive/2008/09/23/8962401.aspx"&gt;Expression Encoder 2 SP1&lt;/a&gt; is now available to &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=A29BE9F9-29E1-4E70-BF67-02D87D3E556E&amp;amp;displaylang=en"&gt;download&lt;/a&gt;. We've been putting the final touches to the updated SDK which will included an updated help file, intellisense files and some samples in C# and now also in Visual Basic. The SDK should be released soon.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9058603" width="1" height="1"&gt;</content><author><name>deanro</name><uri>http://blogs.msdn.com/members/deanro.aspx</uri></author><category term="Expression Encoder" scheme="http://blogs.msdn.com/deanro/archive/tags/Expression+Encoder/default.aspx" /></entry><entry><title>Expression Encoder 2 SP1</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/deanro/archive/2008/09/23/expression-encoder-2-sp1.aspx" /><id>http://blogs.msdn.com/deanro/archive/2008/09/23/expression-encoder-2-sp1.aspx</id><published>2008-09-24T09:46:37Z</published><updated>2008-09-24T09:46:37Z</updated><content type="html">&lt;p&gt;If you’ve been wondering what we’ve been doing for last few months we’ve now announced Expression Encoder SP1 over on the &lt;a href="http://blogs.msdn.com/expressionencoder/archive/2008/09/23/8962401.aspx"&gt;Expression Encoder team blog&lt;/a&gt;. You’ll find quite a few new features and some nice bug fixes and this will be a free upgrade to to Expression Encoder 2.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8963262" width="1" height="1"&gt;</content><author><name>deanro</name><uri>http://blogs.msdn.com/members/deanro.aspx</uri></author><category term="Expression Encoder" scheme="http://blogs.msdn.com/deanro/archive/tags/Expression+Encoder/default.aspx" /></entry><entry><title>Expression Encoder and VB.NET</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/deanro/archive/2008/07/29/expression-encoder-and-vb-net.aspx" /><id>http://blogs.msdn.com/deanro/archive/2008/07/29/expression-encoder-and-vb-net.aspx</id><published>2008-07-29T10:49:31Z</published><updated>2008-07-29T10:49:31Z</updated><content type="html">&lt;p&gt;As James recently posted on the Expression Encoder team &lt;a href="http://blogs.msdn.com/expressionencoder/archive/2008/07/26/8773569.aspx"&gt;blog&lt;/a&gt;, we’ve just released an update to Expression Encoder 2 so that if you wish to use our object model from Visual Basic.NET you can now do that.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=8727DD51-61B3-4692-ABDE-4FDD2779B0D0&amp;amp;displaylang=en"&gt;Download link&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8787647" width="1" height="1"&gt;</content><author><name>deanro</name><uri>http://blogs.msdn.com/members/deanro.aspx</uri></author><category term="Expression Encoder" scheme="http://blogs.msdn.com/deanro/archive/tags/Expression+Encoder/default.aspx" /></entry><entry><title>Expression Encoder 2 SDK released</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/deanro/archive/2008/06/02/expression-encoder-2-sdk-released.aspx" /><id>http://blogs.msdn.com/deanro/archive/2008/06/02/expression-encoder-2-sdk-released.aspx</id><published>2008-06-03T09:24:04Z</published><updated>2008-06-03T09:24:04Z</updated><content type="html">&lt;p&gt;We released the Encoder SDK today. You can download it from the following location.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=9A077A3D-58CE-454C-B486-153F0578BE4A&amp;amp;displaylang=en"&gt;Microsoft&amp;#174; Expression&amp;#174; Encoder 2 SDK&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Once installed, it will create a Start Menu shortcut under Microsoft Expression which opens an explorer window to the SDK directory.&lt;/p&gt;  &lt;p&gt;The SDK installs a couple of XML files which enable intellisense comments within Visual Studio.&lt;/p&gt;  &lt;p&gt;There is a Docs folder which contains the help file along with a PNG of the object hierarchy which can be printed if desired.&lt;/p&gt;  &lt;p&gt;You'll also see a Samples directory which contain the actual samples. If you're running Vista and you want to build the samples directly from this location, remember that you'll probably need to run Visual Studio elevated.&lt;/p&gt;  &lt;p&gt;The help file contains an introduction, details on the samples, the API reference and a few other bits and pieces.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/deanro/WindowsLiveWriter/ExpressionEncoder2SDKReleased_144C7/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="279" alt="image" src="http://blogs.msdn.com/blogfiles/deanro/WindowsLiveWriter/ExpressionEncoder2SDKReleased_144C7/image_thumb.png" width="378" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;We hope you find this useful, and please send us your feedback.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8571049" width="1" height="1"&gt;</content><author><name>deanro</name><uri>http://blogs.msdn.com/members/deanro.aspx</uri></author><category term="Expression Encoder" scheme="http://blogs.msdn.com/deanro/archive/tags/Expression+Encoder/default.aspx" /></entry><entry><title>Intellisense and Help file for Expression Encoder 2 Object Model</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/deanro/archive/2008/05/02/intellisense-and-help-file-for-expression-encoder-2-object-model.aspx" /><id>http://blogs.msdn.com/deanro/archive/2008/05/02/intellisense-and-help-file-for-expression-encoder-2-object-model.aspx</id><published>2008-05-03T01:59:18Z</published><updated>2008-05-03T01:59:18Z</updated><content type="html">&lt;p&gt;Just posted a link to the Intellisense and Help files for the object model to the Expression Encoder Team blog.&lt;/p&gt;  &lt;p&gt;Head over, try them out and let us know what you think.&lt;/p&gt;  &lt;p&gt;Thanks&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/expressionencoder/archive/2008/05/02/8452435.aspx"&gt;Link&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8452462" width="1" height="1"&gt;</content><author><name>deanro</name><uri>http://blogs.msdn.com/members/deanro.aspx</uri></author><category term="Expression Encoder" scheme="http://blogs.msdn.com/deanro/archive/tags/Expression+Encoder/default.aspx" /></entry><entry><title>Expression Encoder 2 is released</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/deanro/archive/2008/05/02/expression-encoder-2-is-released.aspx" /><id>http://blogs.msdn.com/deanro/archive/2008/05/02/expression-encoder-2-is-released.aspx</id><published>2008-05-02T10:38:15Z</published><updated>2008-05-02T10:38:15Z</updated><content type="html">&lt;p&gt;Expression Encoder 2 is now available. Click on the image to go to the Expression Encoder page where you will find a &amp;quot;Try Now&amp;quot; link to download the trial. We're planning to have more details of the new features up on the &lt;a href="http://blogs.msdn.com/expressionencoder"&gt;Expression Encoder Team&lt;/a&gt; blog soon. I'm also working on getting together a prelimary help file for the SDK object model and some XML files that will enable Intellisense comments within Visual Studio. Expect those soon...&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/expression/products/Overview.aspx?key=encoder"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="214" alt="image" src="http://blogs.msdn.com/blogfiles/deanro/WindowsLiveWriter/ExpressionEncoder2isreleased_8F5/image_3.png" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8449617" width="1" height="1"&gt;</content><author><name>deanro</name><uri>http://blogs.msdn.com/members/deanro.aspx</uri></author><category term="Expression Encoder" scheme="http://blogs.msdn.com/deanro/archive/tags/Expression+Encoder/default.aspx" /></entry><entry><title>Changing the output profile</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/deanro/archive/2008/03/13/changing-the-output-profile.aspx" /><id>http://blogs.msdn.com/deanro/archive/2008/03/13/changing-the-output-profile.aspx</id><published>2008-03-13T10:11:33Z</published><updated>2008-03-13T10:11:33Z</updated><content type="html">&lt;p&gt;Once you've created a &lt;a href="http://blogs.msdn.com/deanro/archive/2008/03/07/basic-code-to-encode-a-file.aspx"&gt;MediaItem&lt;/a&gt;, you're probably going to want to specify which video and/or audio profile you want to encode it with. There are a number of ways to obtain a video and audio profile. If you have your own PRX file that you wish to use, you can load it with code something like this&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: #2b91af"&gt;VideoProfile &lt;/span&gt;videoProfile;
&lt;span style="color: #2b91af"&gt;AudioProfile &lt;/span&gt;audioProfile;
&lt;span style="color: #2b91af"&gt;LocalProfiles&lt;/span&gt;.LoadProfileFromFile(&lt;span style="color: #a31515"&gt;@&amp;quot;C:\MyProfile.prx&amp;quot;&lt;/span&gt;, &lt;span style="color: blue"&gt;out &lt;/span&gt;videoProfile, &lt;span style="color: blue"&gt;out &lt;/span&gt;audioProfile);&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Once you have the profile loaded you can then set it on the MediaItem like so&lt;/p&gt;

&lt;pre class="code"&gt;mediaItem.VideoProfile = videoProfile;
mediaItem.AudioProfile = audioProfile;&lt;/pre&gt;

&lt;p&gt;If you want to use one of the built-in profiles you can obtain it with code something like this by just searching for the name of the profile.&lt;/p&gt;

&lt;p&gt;&lt;span style="color: #2b91af"&gt;VideoProfile &lt;/span&gt;videoProfile = &lt;span style="color: #2b91af"&gt;VideoProfile&lt;/span&gt;.FindProfile(&lt;span style="color: #a31515"&gt;&amp;quot;Hardware Device - zune&amp;quot;&lt;/span&gt;);&lt;/p&gt;

&lt;p&gt;This does have the disadvantage that the code isn't going to work on a non English version of Expression Encoder as the string will be localized into a different language. So in the RTM version of Expression Encoder we will include a static list of Video and Audio Profiles that match the built-in profiles we supply, so you'll be able to write the code a little easier like this&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: green"&gt;// Code from the future
&lt;/span&gt;mediaItem.VideoProfile = &lt;span style="color: #2b91af"&gt;VideoProfiles&lt;/span&gt;.HardwareDeviceZune;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Once you've set the profile you may want to tweak it further by changing some of the individual parameters. You can do this with code like the following&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: green"&gt;// Funky code alert
&lt;/span&gt;mediaItem.VideoProfile = (&lt;span style="color: #2b91af"&gt;VideoProfile&lt;/span&gt;)mediaItem.VideoProfile.Clone();

&lt;span style="color: green"&gt;// Set the video bitrate and change the dimensions of the output video
&lt;/span&gt;mediaItem.VideoProfile.Bitrate = 64000;
mediaItem.VideoProfile.Height = 80;
mediaItem.VideoProfile.Width = 120;&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;You may have noticed the ever so slightly funky code at the beginning :-). At the moment, when you get an instance of a VideoProfile or AudioProfile class back we're internally creating what is essentially a read only version. So if you try to change one of the parameters you'll get an exception. To fix this at the moment, you need to make a copy of the class before you can change it and this is what the Clone line does. When the RTM version of Expression Encoder comes out, this hopefully should no longer be necessary and you'll be able to change things directly as you'd expect.&lt;/p&gt;

&lt;p&gt;After you've done all this, you can go ahead and call Encode on the job and you should end up with a video file that matches the profiles that you've set.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8179467" width="1" height="1"&gt;</content><author><name>deanro</name><uri>http://blogs.msdn.com/members/deanro.aspx</uri></author><category term="Expression Encoder" scheme="http://blogs.msdn.com/deanro/archive/tags/Expression+Encoder/default.aspx" /></entry><entry><title>Overview of Expression Encoder 2</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/deanro/archive/2008/03/07/overview-of-expression-encoder-2.aspx" /><id>http://blogs.msdn.com/deanro/archive/2008/03/07/overview-of-expression-encoder-2.aspx</id><published>2008-03-08T07:27:01Z</published><updated>2008-03-08T07:27:01Z</updated><content type="html">&lt;p&gt;The session that our very own James and Charles did at &lt;a href="http://www.visitmix.com/"&gt;Mix&lt;/a&gt; this morning is already online.&amp;#160; I haven't had a chance to watch it myself yet, but I'm sure James and Charles did an excellent job.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://sessions.visitmix.com/?selectedSearch=T09"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="166" alt="image" src="http://blogs.msdn.com/blogfiles/deanro/WindowsLiveWriter/OverviewofExpressionEncoder2_11F93/image_5.png" width="215" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8109704" width="1" height="1"&gt;</content><author><name>deanro</name><uri>http://blogs.msdn.com/members/deanro.aspx</uri></author><category term="Expression Encoder" scheme="http://blogs.msdn.com/deanro/archive/tags/Expression+Encoder/default.aspx" /></entry></feed>