The joys of video editing (WPF Intro)

February 29, 2008

One of my favorite past times that I enjoy the most is video editing. It’s been a long time hobby of mine. There are many different software packages out there that have tons of functionality that can make even an amateur appear like a pro. Recently, I’ve discovered windows media encoder. It’s a nice package that Microsoft gives away for free. For free, it does a decent job of editing, although many of the paid for packages are by far much better. One task that I found it can do that the other packages don’t is that is can do real-time screen video and audio captures. I’ve never played around with this stuff too much before, so I figured I’d research it a bit. I found that there is again other packages out there that do real-time screen capture, but the free ones had poor quality and generated large files. The paid for packages have great quality and decent file sizes, but they are also quite costly.

Any way, I figured I’d give the Microsoft media encoder a try. I’ve always wanted to try to create an online tutorial for some of the new and cool technologies out there, so I spent a bit of time creating a “Beginning WPF” tutorial. It’s only about 8 minutes long, but I think it gives a nice simple introduction to WPF and shows some of its power. So, if you’re up to learning a bit about WPF you can start the video by clicking the link below.

Beginning WPF” – by Greg Corbin (best viewed at 1024×768)

Enjoy. J


MMC 3.0 - Build Snap-ins with C# and.Net

September 23, 2007

Microsoft Management Console no longer belongs in the realm of C++ developers only. Microsoft has released a new version of the popular MMC framework. This version fully supports managed and unmanaged code. The new MMC 3.0 SDK finally gives .NET developers the ability to create snap-ins. In prior versions of MMC, we were able to use some of the .NET framework, but all that code needed to be embedded into a C++ framework that provided a sort of communication bridge between MMC and .NET. With that architecture there was plenty of cases where .NET coding was limited in what could be done. The way it worked was the C++ snap-in hosted the .NET program in an ActiveX container. This is would cause all the .NET code to be in a sort of island that could not easily communicate with the outside MMC framework. All that is now behind us. Now that we have an MMC framework that is fully .NET compliant, we can ditch all the old C++ hacks in favor for the simplicity and power of C#.

To get started with writing snap-ins using C#, you will need 2 items. First you will need the MMC 3.0 console. Next you will need the .NET 3.0 framework. If you are working on windows Vista, you will already have these. The operating systems supported by this are Windows XP, Windows 2003, and Windows Vista. If you want your snap-in to work on anything older than that, then you’re out of luck. Once you get these pieces installed, I would recommend visiting the MSDN. There are several good samples that show how to write snap-ins using C#. There are samples that are as simple as a “Hello World” and there are some that are as complex as some of the Microsoft snap-ins.

Regardless to how you choose to use this, it is a great new technology that I would recommend you add to you portfolio. One last side note that I discovered is that this framework is even flexible enough to allow us to scrap winforms and use all the cool animation that WPF gives us. This is a great framework for creating any desktop administrative tool.


Let’s Start Simple

January 11, 2007

Before we talk about asp.net and all its cool features, we need to understand a little bit about the programming languages that can be used. The two languages that Microsoft provides are C# and VB.net. Either language will work just fine, but my preference is C#. So, all the sample code that I provide will be written with C#.

Ok, let’s get started. In this posting I wanted to start simple by just discussing the C# language and some of its uses. The best way to do this is with an example. The example below shows deals with creating some objects and defining them. I decided to use racecars as my example objects. Take a look at the code below for further details.

 This sample was created using VS2003, but will work in VS2005. For the purpose of creating a simple sample I choose to make it a console application, but the code will work very much the same if it were called from an asp.net page.

Listing 1

blog2a.JPG

The source code for this can be downloaded here. This sample shows a simple Class called FordRaceCar. This Class has many properties and methods that can be called and set. A FordRaceCar Object is created and set in Main( ) method of the RaceTrack Class.

This Main( ) method is the entry point for the application. Its equivlant to PageLoad( ) in asp.net

The main problem with this code is what if we wanted to create a ChevyRaceCar? We could take all the code for the FordRaceCar Class copy it, and call it ChevyRaceCar Class. The problem here is we would now have a lot of duplicated code. This would lead to poorly maintainable code.

A better solution is to use Inheritance. We would create one base class that has all the methods and properties that would apply to RaceCars in general, and then we could inherit this base class into our specific FordRaceCar and ChevyRaceCar Class. This would avoid the duplicate code. We are also going to have an interface to define our base RaceCar class. The Interface is nothing more than a contract that says what a base RaceCar must have. In this case, the only property being enforced here is “Tires”. This means that a base RaceCar must have code to define the car tires. The interface does not contain any implemented code, only the contract. All the source code below can be downloaded here.

 blog1b.JPG

 blog1c.JPG

Listing 6

 Listing 5