Hey… here’s the quickie demo promised using Silverlight and some After Effects. Consider this as Drop One of several – the key purpose is to see what can be done with different types of video and ways of displaying them in WPF and Silverlight.
The code here is meant for beginners – since it’s a Father/Son project. So don’t expect anything fancier than transparent forms. But the idea is – if you’ve never done any coding, here are some different ways to get hi-tech results with very little coding.
Here’s the trick to the Minimize, FullScreen and Close buttons on the form – that you DO have to code yourself. The code for this is pretty simple – but the first trick is to make the form itself transparent. How?
First click on the Window – then go over to Properties in Blender. Scroll down until you find the Appearance settings. Check the box for "AllowTransparency" – you’ll notice the form suddenly has changed, and the Window Style dropdown box has now gone to "None".
Next … you’re going to need to be able to close your application somehow, so add a Minimize, FullScreen and Close image. You can create these anywhere, I used Expression Design – and then exported them as XAML files. But a standard Image file will work just fine. Once you’ve loaded them on to the form, select each image and then click On Tools… and then "Make Button".
Once you’ve made them into buttons… you can add code to them. How easy is this to do? Simple. Open the XAML code in the editor of your choice… if you have a copy of Visual Studio (Express or 2008) you can then double click on the button you created in Blend in the GUI. This will open the code for you and populate the button_click information.
Here’s some quickie code to do this…
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click
'Closes the Application
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button2.Click
' Maximize the form window
Me.WindowState = WindowState.Maximized
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button3.Click
' Minimize the form window
Me.WindowState = WindowState.Normal
Next we’ll cover more advanced buttons… and more advanced video tricks.
Things like smoke on the water… and (I have to say this) … and Fire in the Sky.
As always you can download the code from:
(I’ll encode the video file to a smaller size in the next go round when we cover some encoding techniques that make it more practical for distribution. This is raw .AVI footage.)