WinFX Rocks




Assembly Hierarchy Explorer

Compare the namespace and inheritance hierarchies in any assembly




In the object-oriented world of .NET have you ever wanted to see how object inheritance and namespace hierarchy relate?  Well, now you can!  Fire up this WinForms application, and on the Assembly menu choose one of the standard .DLLs in the list.  The program parses the assembly and shows you two hierarchies, at the left the namespaces, or how you would normally refer to the classes in code, and at the right the inheritance so you can see more of what's happening behind the scenes.  Use the up and down arrows to scan as quickly as you'd like through the structure and the other side should keep up with you, showing how both sides are related.

Techniques demonstrated in this code include: Here's the code sample, written for .NET Framework 1.1, but it will easily convert to a 2.0 project.




Bar Code Blitz

Standard bar codes created from scratch!



Lorin and Lawrence are on a mission to make bar codes appear on web pages.  Techniques demonstrated during their quest include use of the new Generic Handler template in Visual Studio 2005, and the use of GDI+ to render a GIF image.  The source code for the bar code solution shown in the video is available here.  It can be used royalty-free to create both 3 of 9 and 2 of 5 codes.  Take it for a test drive if you like:



Download here!
(52 megs, 10:24 duration.  Requires at least a 1 GHz Pentium 3 machine with an average AGP video adapter.)

The intro sequence was rendered entirely with C# code using GDI+. The bar code that flies past was made with the same code demonstrated in the video.

Credits:

Written, directed, produced, and starring Lorin Thwaits as the developer in the plaid shirt
Lawrence Grant as the developer in the maroon shirt.
E. W. Lloyd as the boss
Music composed and performed by Jonathan Thwaits
Filmed by Andrew Holliday and Audra Grant one fine Thursday afternoon.



GIF Transparency

Using pointers to directly manipulate bitmap data is fun!


Have you ever tried to create a transparent GIF with GDI+?  Seems like it should be easy since there's such a thing as Color.Transparent, but interestingly enough the GIF encoder that's included with the .NET framework doesn't correctly identify Color.Transparent!  But there is a way to get the job done by using unsafe code blocks to directly access the memory where the bitmap is held.  Here is a fun WinForms sample that allows you to read in any GIF file and set any color in the palette to be transparent:



It will load in any GIF image, and as you mouse over the image you can click on the color you want to be transparent.  You'll know what color you're selecting because the whole background of the form will turn that color.  Once you click, a Save Dialog box opens and your new GIF with transparency is saved.

You can download the source code to the solution here.  It was made in .NET 1.1, but will convert easily to 2.0.




Awash in the myKB.com Ajax Code

See how easy it can be to create a highly interactive experience in your web applications


Scott Cate, a Microsoft MVP, has recently upgraded his popular myKB.com site to use Ajax.  In this video, he takes us both on a tour of his new code, and at the same time also a little tour of the Pacific ocean!  This video was originally made for the PDC ShowOff event.

Download here!
(31 meg download, 4:17 duration.  Requres 1.7 GHz Pentium for playback and pretty much any run-of-the-mill AGP video adapter.)

Of the various AJAX libraries out there, Scott chose to use Michael Schwartz's Ajax.NET for this project.

Credits:

Scott Cate - entrepeneur, writer, presenter
Richard Hundhausen - innocent bystander
Lorin Thwaits - director, producer, set coordination




Check back, there are more code samples and videos coming!