<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Zen of Software Development : images</title><link>http://blogs.technet.com/robertev/archive/tags/images/default.aspx</link><description>Tags: images</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Shared Resources XAML Intellisense</title><link>http://blogs.technet.com/robertev/archive/2008/03/30/shared-resources-xaml-intellisense.aspx</link><pubDate>Sun, 30 Mar 2008 03:18:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3023513</guid><dc:creator>robertev</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.technet.com/robertev/comments/3023513.aspx</comments><wfw:commentRss>http://blogs.technet.com/robertev/commentrss.aspx?PostID=3023513</wfw:commentRss><description>&lt;P&gt;&lt;STRONG&gt;[ I'll provide a full solution download to anyone interested ]&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;Our &lt;/STRONG&gt;&lt;STRONG&gt;Goals were:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;1) Use images in XAML syntax like this:&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#a31515 size=2&gt;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Image&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt; Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;="imageSave"&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt; Height&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;="16"&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt; Width&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;="16"&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt; Source&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;="ui:Images.ico_save_16.png"/&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;2) Break on invalid image references at&amp;nbsp;&lt;U&gt;COMPILE&lt;/U&gt; - not at runtime.&lt;BR&gt;3) Automatically add new when new images are copied into project.&lt;BR&gt;4) Share resources within solution across projects.&lt;BR&gt;5) Get intellisense for images from different projects in the same solution where possible (currently only in the codebehind - but the xaml editor will eventually provide intellisense here too).&lt;BR&gt;6) VS 2008&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;_________________________________________________________&lt;/P&gt;
&lt;P&gt;We created a separate "Resources" class library. In that class library we created an Images folder and&amp;nbsp;under that an "ico" and "png" folders with all our images. Not added to "Resources" or "settings" as these generate only internal strongly typed - you need public.&lt;/P&gt;
&lt;P&gt;Step 2:&lt;/P&gt;
&lt;P&gt;Inside that class library create a text template&amp;nbsp;- I called it Generator.tt. This text template will scan your directory of files and&amp;nbsp;output something like this (below). We have two sub properties "ico" and "png" for the same resource... but you don't have to have that complexity.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000 size=2&gt;
&lt;P&gt;// &amp;lt;auto-generated&amp;gt;&lt;BR&gt;&lt;/FONT&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;static&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;class&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;Images&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;{&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;static&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;class&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;ico_user_16&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;{&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;static&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;BitmapFrame&lt;/FONT&gt;&lt;FONT size=2&gt; png&lt;BR&gt;{&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get&lt;/FONT&gt;&lt;FONT size=2&gt; { &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;return&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;ResourceLocator&lt;/FONT&gt;&lt;FONT size=2&gt;.GetImageSource(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"ico_user_16.png"&lt;/FONT&gt;&lt;FONT size=2&gt;); }&lt;BR&gt;}&lt;/P&gt;
&lt;P mce_keep="true"&gt;}&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;//end ico_user_16 &lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;#endregion&lt;/P&gt;
&lt;P&gt;------------------------------------------&lt;/P&gt;
&lt;P&gt;The only really tricky part in creating the tt file was figuring out how to find the current directory to scan the project files... &lt;/P&gt;&lt;FONT size=2&gt;
&lt;P&gt;string icoPath = this.Host.ResolvePath(@"Images\ico");&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;Now you can add references to that "Resources" class library from any project in your solution and get static resources in your xaml files... and share them across projects. As you add new images to your resource library simply save your Generator.tt file to&amp;nbsp;re-generate your static resources.&lt;/P&gt;
&lt;P&gt;Enjoy!!!&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3023513" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/robertev/archive/tags/images/default.aspx">images</category><category domain="http://blogs.technet.com/robertev/archive/tags/Resources/default.aspx">Resources</category><category domain="http://blogs.technet.com/robertev/archive/tags/XAML/default.aspx">XAML</category></item><item><title>Download Pictures from your Cell Phone via Bluetooth</title><link>http://blogs.technet.com/robertev/archive/2008/01/05/download-pictures-from-your-cell-phone-via-bluetooth.aspx</link><pubDate>Sun, 06 Jan 2008 01:54:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:2714113</guid><dc:creator>robertev</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.technet.com/robertev/comments/2714113.aspx</comments><wfw:commentRss>http://blogs.technet.com/robertev/commentrss.aspx?PostID=2714113</wfw:commentRss><description>&lt;P&gt;If you have a bluetooth enabled laptop and a bluetooth enabled cellphone you may be able to download the pictures from your phone to your laptop via bluetooth... EVEN if your cell phone provider says it isn't possible (as in my case).&lt;/P&gt;
&lt;P&gt;Perhaps they direct you to use their picture place service and to message your phone's images to that picture place. The down-side of this approach is that you loose resolution, it takes forever, and it costs a fortune!&lt;/P&gt;
&lt;P&gt;This weekend I discovered a nifty&amp;nbsp;free application that allows me to download my picutures from my camera phone faster, wireless via bluetooth, without loosing picture resolution - and for FREE!&lt;/P&gt;
&lt;P&gt;Here's what you need to do:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Pair your phone to your laptop via bluetooth. (instructions for &lt;A class="" title=instructions href="http://windowshelp.microsoft.com/Windows/en-US/Help/67cdb8d4-c3fe-43db-a00e-53159bf8695b1033.mspx" target=_blank mce_href="http://windowshelp.microsoft.com/Windows/en-US/Help/67cdb8d4-c3fe-43db-a00e-53159bf8695b1033.mspx"&gt;vista&lt;/A&gt;)&lt;/LI&gt;
&lt;LI&gt;Download and install the bitpim exe from &lt;A href="http://www.bitpim.org/"&gt;http://www.bitpim.org&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;Once Installed start it up.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You should now see a screen like:&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;IMG title="BitPim Setup" height=348 alt="BitPim Setup" src="http://www.ensosoft.com/images/myblog/bitpimsetup.jpg" width=381 mce_src="http://www.ensosoft.com/images/myblog/bitpimsetup.jpg"&gt;&lt;/P&gt;
&lt;P&gt;You can walk through the wizard to setup your phone. For my model phone - I found that the images were downloaded as part of the "wallpaper" download.&lt;/P&gt;
&lt;P&gt;In addition - you can find (or create)&amp;nbsp;ringtones and upload them to your phone via bluetooth, wireless and for FREE.&lt;/P&gt;
&lt;P&gt;This is a great little jem of a find. &lt;/P&gt;
&lt;P&gt;&lt;IMG title="Bitpim after" style="WIDTH: 444px; HEIGHT: 353px" height=353 alt="Bitpim after" src="http://www.ensosoft.com/images/myblog/bitpim_after.jpg" width=444 mce_src="http://www.ensosoft.com/images/myblog/bitpim_after.jpg"&gt;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=2714113" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/robertev/archive/tags/laptop/default.aspx">laptop</category><category domain="http://blogs.technet.com/robertev/archive/tags/camera/default.aspx">camera</category><category domain="http://blogs.technet.com/robertev/archive/tags/download/default.aspx">download</category><category domain="http://blogs.technet.com/robertev/archive/tags/bluetooth/default.aspx">bluetooth</category><category domain="http://blogs.technet.com/robertev/archive/tags/phone/default.aspx">phone</category><category domain="http://blogs.technet.com/robertev/archive/tags/images/default.aspx">images</category></item></channel></rss>