RSS

Refilling Your Cup…

22 Sep

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. 

image

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".

image

Next … you’re going to need to be able to close your application somehow, so add a Minimize, FullScreen and imageimageClose 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
Close()
End Sub

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
End Sub

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
End Sub

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.)

Advertisements
 
Leave a comment

Posted by on September 22, 2008 in Uncategorized

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: