Welcome to Pete Brown's 10rem.net

First time here? If you are a developer or are interested in Microsoft tools and technology, please consider subscribing to the latest posts.

You may also be interested in my blog archives, the articles section, or some of my lab projects such as the C64 emulator written in Silverlight.

(hide this)

Silverlight Balloons Version 3

Pete Brown - 27 July 2007

The Silverlight 1.1 July Alpha Refresh is out, and with it, I can release this post.

This version of Silverlight Balloons has been updated to work with the Silverlight 1.1 Alpha Refresh. I've been wanting to release this for a bit, but had to sit on it until the refresh became public.

Some updates:

First of all, animation performance in the refresh appears to be about 15-20% better than the previous version for vector animation. What used to use 50-60%%, dropped down to about 40-50% CPU. This is all an unscientific test.

Second, I changed the Silverlight control to have an opaque background and the gradient to be drawn on the Silverlight canvas instead of a PNG on the web page. This had the largest performance impactm knocking CPU usage down to around 25%-35%. Keep in mind as you develop silverlight content that compositing over web page content can get expensive if you want to do any real animation. This makes tons of sense, but needs to be said :)

Third, I hooked into the BrowserHost resize event so the app takes up the whole browser window. I'm looking forward to SL getting some of the native WPF-style resize events. TBD if/when that happens. I had a bit of an Observer Effect going on with the whole resize issue. When debugging, everything worked well because my debugging caused enough of a delay before I started the animation for the browser to send the correct sizes over. While not the most elegent solution, I ended up setting a flag in the resize event once I got a non zero value (it fires initially with zero values - not very helpful) and starting the animation at that time.

You can run Silverlight Balloons here.

Silverlight Balloons Version 3

(old screen shot that includes the clouds)

The source code is here.

The previous revision is here. You can find the original write up and screen shots here.

   
posted by Pete Brown on Friday, July 27, 2007
filed under:    

7 comments for “Silverlight Balloons Version 3”

  1. Pete Brownsays:
    FYI. I had to replace the Silverlight.js on the server with one that will correctly download 1.1 instead of 1.0. The one in the zip file hasn't been updated yet. You can snag the copy from the server in the meantime. http://www.irritatedvowel.com/silverlight/Balloons3/Silverlight.js
  2. deebssays:
    Neat! Is there anyway to change balloon transparency?

    Say, for example, the largest ballons having 25% opacity, medium sized ones 50% and smallest balloons appearing at 100% opacity?
  3. Pete Brownsays:
    deebs:

    Yep, but you'd need to add a line or two of code. You can use the same ratios I use to adjust the size to affect the balloon's Opacity setting. 0 is completely transparent, 1 is completely opaque.

    I've found that there is a little bit of a performance penalty exacted for the transparency, but it's not a huge deal.

Comment on this Post

Remember me

4 trackbacks for “Silverlight Balloons Version 3”

  1. POKE 53280,0: Pete Brown's Blogsays:
    The Silverlight 1.1 SDK comes with a 1.0 version of the Silverlight.js file. I'm not sure if MSFT
  2. POKE 53280,0: Pete Brown's Blogsays:
    Here are some links from today's ReMIX 07 talk in Boston, and a couple extras that may be of interest
  3. xinqiu's blog for his Microsoft careersays:
    I’m using Visual Studio 2008 SP1 with Silverlight 2 Beta 2 SDK. 1. New Project, select C#/Silverlight/SilverilghtApplication,
  4. xinqiu's blog for his Microsoft careersays:
    I’m using Visual Studio 2008 SP1 with Silverlight 2 Beta 2 SDK. 1. New Project, select C#/Silverlight/SilverilghtApplication,