Silverlight 3 – New features and more

image

 

 

 

So first off where do you get it? https://silverlight.net/getstarted/silverlight3/default.aspx

Secondly what’s new?

Video/Audio. As mentioned in the keynote, Silverlight 3 supports the H.264 video format in addition to VC-1; this is an emerging industry standard that is used by YouTube, and has hardware decoders available on many devices. It also supports the AAC audio format; both this and H.264 are implemented within the MP4 container format (i.e. .MP4 and .M4A files).

GPU Acceleration. This is an opt-in feature that is available within the Silverlight 3 runtime, both in-browser and out-of-browser. Within the Silverlight object tag in HTML, you simply add a parameter EnableGPUAcceleration, set to true, to enable final surface draw GPU acceleration. You then add the CacheMode property on the element itself.

3D Support. Silverlight 3 includes perspective 3D, which gives you much of the benefit of 3D without the “productivity penalty” of having to write it from scratch. Within a parent element, you use a Projection attached property. For example:

<Border.Projection>
   <PlaneProjection x:Name=”p3” RotationY=”-30” />
</Border.Projection>

Animation Easing. There’s now a series of easing functions.

Custom Dialogs. We now have SaveFileDialog support in Silverlight 3. For security reasons (because Silverlight runs in the sandbox), we don’t return a path to the developer. Instead, you can open a file from the result. For example:

mySaveFileDialog.Show();
if (mySaveFileDialog == true)
   return mySaveFileDialog.OpenFile();

Effects. Effects (introduced in Silverlight 3) provide a low-level way to impact visual behavior (rather than functional behavior). We provide drop shadow and blur effects out of the box, but you can also create your own. Custom effects are implemented as HLSL shaders – these can be compiled into byte code using a DirectX SDK utility, which Silverlight 3 then consumes. Shaders allow developers to modify each pixel on a UI element before the pixel is rendered.

Pixel and Media APIs. You can now read/write pixels from a bitmap. There are two ways this functionality is exposed: either as an in-memory bitmap or by saving a visual to a bitmap. Also supported are raw audio/video APIs that enable dynamic sound generation, custom video codecs or indeed alpha video channels.

Local Messaging. One common challenge is messaging across multiple Silverlight plug-ins. In Silverlight 3, we now support “named pipes”-style messaging across not just objects on the same page, but even multiple Silverlight instances across multiple browsers. Joe demonstrated Silverlight chess playing between an instance running on Chrome and an instance running in Firefox.

Out of Browser. This is enabled on a per-application basis, using a manifest (the standard Silverlight 3 template includes the appropriate section: you just need to uncomment it). A user can start a Silverlight out-of-browser “application” either by right-clicking on the Silverlight content, or by clicking on a custom button within the application itself.

Tooling. The Silverlight 3 tools will introduce a new compression algorithm that will reduce the size of XAP files by 10-30%.

Enjoy! More comments to follow.