When a 'z' just doesn't cut it... (Oren Nachman's random notes from Microsoft)

October, 2010

  • Randomisation

    Silverlight for Windows Phone 7 Performance Session at PDC!



    It's that time of year again - PDC 2010 kicks of tomorrow! Join the Silverlight Performance Team as we take you through the high level analysis of common performance issues that apps commonly run into. I'll be giving a live session titled "Optimizing Performance for Silverlight WP7 Apps" at 3:15pm (PDT)  on day 1 (28 October 2010).

    Even if you couldn't make it here to heckle me in person, the rest of the team will be online and answering your questions (or heckling on your behalf) as you watch the live stream via the online player, which you'll be able to find at http://player.microsoftpdc.com 

    Make sure to check out the session before mine ("Things I Wish I Knew about Building WP7 Apps" by Jaime Rodriguez) and all of the rest of the Windows Phone 7 track. There's other great content at PDC that's worth checking out, but we all know that that's secondary!

    See you there!


  • Randomisation

    Silverlight: Why do I get 0x8000ffff when using WriteableBitmap on an Element


    I'm working on a WP7 library which helps analyze your VisualTree and to provide a visual aid, I take WriteableBitmap snaps of the elements. Unfortunately I (seemingly) randomly encounter the following exception:


    A first chance exception of type 'System.Exception' occurred in System.Windows.dll
    When digging into the exception you may find that the error is actually a HRESULT which is being bubbled up from the lower native layer:


    E_UNEXPECTED (0x8000ffff) 

    What's going on?

    You guessed it - this isn't random! In fact, this only happens on completely obscured (or off screen) elements which have never had a chance to render. In this case when you try to take a WriteableBitmap snap, instead of it forcing the control to render, it simply fails. This will hit you in the case of any element that has always been obscured. As soon as the element is unobscured it will be good to go (so you could do some VisualTree manipulation if you *really* needed to grab that shot).


  • Randomisation

    WP7 Marketplace Tip #1: Submit one app with multiple locales


    ... as opposed to multiple apps, each with a different locale.


    1. If these are free apps, then each language will count towards your free app quota (you get 5 free apps that you don't need to pay certification costs for)
    2. Regardless of price, each app will need to go through independent certification (which will then take longer for all apps to be released), instead of one app being certified and published with all languages

    Happy App Hubbing!

  • Randomisation

    Are the Windows Phone 7 Developer Tools Still Free?


    YES! Visit: http://create.msdn.com/en-us/home/getting_started and click "Install Now" to download the tools, directly, for free, without the need to sign up first.

    Ever since the release of the new developer portal (http://create.msdn.com) I've been hearing that you need to signup to get the tools, hence they must no longer be free. In reality, what happened is that the old developer website url redirects directly to a login screen, instead of to the new site, leading people to believe that the tools are no longer free. Let me assure you - they are :)

    Happy App Hubbing!

  • Randomisation

    WP7 Perf Tip #6: Be smart about graphics (use JPEG where possible)


    Take Away's:

    1. Wherever possible (i.e. no transparency) use JPEG images since these decode faster than PNG
    2. Make sure your images are correctly sized (you don't want to waste cycles with resizing on the fly)
    3. Always compile your images with a "Build Action" of "Content" instead of the default "Resource"

    Some Background:

    1. JPEG (JPG) decodes faster, simple as that. The difference will continue to shrink over time, but every cycle is important on the phone, especially on image intensive applications.

      Don't take this to mean "never use PNG", rather, PNG is slower so only use it when you need it (transparency) as opposed to for everything as a generic default. 
    2. Although resizing is quick (even if it looks ugly) there is no point wasting those cycles resizing images on the fly (Silverlight will do this for you) if you can already size the images correctly from the start
    3. The default when adding new images is to set "Build Action" to "Resource" (under the Properties window). Make sure to always change this to "Content" in order to reduce the size of your DLL, speeding up both app load and image load.

      The properties window, with the correct "Build Action" set


Page 1 of 1 (5 items)