Welcome to irritatedVowel.com Sign in | Help

POKE 53280,0: Pete Brown's Blog

Silverlight, WPF, Woodworking, .NET Programming, CNC, Nature, and other topics.

Pete Brown writes on a number of topics including Silverlight, WPF, .NET, woodworking and working as a consultant in the DC area. On most forums, Pete goes by the name Psychlist1972. Pete has worked at Applied Information Sciences (AIS) since 1996 where he currently performs as a lead architect and project manager.

Subscribe to my feed

Add to Technorati Favorites
Applied Information Sciences - My Employer

Community Events



World Domination

who's online

Networks


View Pete Brown's profile on LinkedIn

AddThis Social Bookmark Button

Silverlight Balloons Version 3

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.

  Add to Technorati Favorites
Posted: Friday, July 27, 2007 10:20 PM by Pete.Brown
Filed under: ,

Comments

Pete.Brown said:

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
# July 29, 2007 12:37 PM

Mark Heath said:

very cool! my kids will love this and thanks for providing the source code
# August 2, 2007 4:22 AM

POKE 53280,0: Pete Brown's Blog said:

The Silverlight 1.1 SDK comes with a 1.0 version of the Silverlight.js file. I'm not sure if MSFT
# August 2, 2007 5:20 PM

Peter Marshall said:

Nice little game example. Does it ever stop playing? Thats a really neat bit of work.
# August 8, 2007 9:15 AM

Pete.Brown said:

Thanks Peter

If it stops, then there is a bug :)

The intent of it is to keep my son amused for as long as possible, so stopping was not a consideration. heh.

# August 8, 2007 9:43 AM

deebs said:

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?
# September 2, 2007 5:35 PM

Pete.Brown said:

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.

# September 2, 2007 7:19 PM

POKE 53280,0: Pete Brown's Blog said:

Here are some links from today's ReMIX 07 talk in Boston, and a couple extras that may be of interest
# October 9, 2007 7:46 AM

mike kidder said:

Why am I getting a parse error in Firefox 2.0.0.12? Is this the inline XAML, xhtml, firefox bug again?
# March 6, 2008 6:01 PM

xinqiu's blog for his Microsoft career said:

I’m using Visual Studio 2008 SP1 with Silverlight 2 Beta 2 SDK. 1. New Project, select C#/Silverlight/SilverilghtApplication,
# September 8, 2008 6:35 PM

xinqiu's blog for his Microsoft career said:

I’m using Visual Studio 2008 SP1 with Silverlight 2 Beta 2 SDK. 1. New Project, select C#/Silverlight/SilverilghtApplication,
# September 8, 2008 6:39 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Enter the text you see in the image:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS