First, let me accept that .NET is really cool. It certainly accelerates development time multifold. Also, it has very powerful features that can be used very easily. Microsoft has started to give 'Express Edition' of its development tool free of cost, which I believe is the best thing that can ever happen to .NET. I just happened to get my hands on the Visual C# 2005 Express Edition (Beta) and was amazed !!
Transparency and opacity are nothing new to all those who have used Windows Forms in .NET. I have done lot of experiments with them, but this one is awesome. This application is nothing more than an IE control hosted on a Windows Form and some code to get it to life. By setting opacity and transparency key of the form, one can actually make the content inside the window translucent or transparent. The results are mind-blowing, have a look:
Browsing with translucent background.
Directory browsing with transparency key 'White'.
How It Works
The application is a fairly simple one. As I said, all it has is an IE control. The border style of the from is set to 'sizeable tool window'. The application is operated using commandline parameters.
TransparentIE URL [opacity] [sizex] [sizey] [r] [g] [b]
TransparentIE URL [0.0-1.0] [0-1024] [0-1024] [0-255] [0-255][0-255]
The URL is the URL or file path we want the application to point to. Opacity should be between 0.0 and 1.0. Also, size of the window can be specified optionally. The last three parameters are R,G,B values of the color which we want transparent. For example:
TransparentIE C:\Temp 1.0 100 100 255 255 255
Will open ‘C:\Temp’ for directory browsing with opaque background, in a window of size 100x100 with white as transparent color. Only the first parameter is compulsory. You can move or resize the window using mouse, once it is displayed. I think this is a great technique.
Directory browsing with translucent background.
Browsing with translucent background.
Doing More Interesting Things
It is not just limited to web pages and directory browsing. Imagine what ActiveX and DHTML can do to it. For example, you can read a PDF just by pointing your browser to PDF. You can even have these effects on Java applets or basically any type of plug-in that works with IE. Isn’t that great?
Using this technique with carefully constructed DHTML content will make it look awesome. One interesting thing that I have noted is, when you have a transparency set, you can actually click icons or anything else in background through the transparent window. That again is cool!!
Viewing PDF document with translucent background.
However, at times when the content is bulky, it does slow down things a bit. Like if you have a big graphic inside the window. Also after some experimentation, I realized that transparency is best used with custom made web pages. Using transparency on photos or high color graphics, gives ugly looking white borders to opaque areas. Even then, there is absolutely no limit with what one can do with this. Try using DHTML filters, animated gifs, custom designed web pages, activex controls, plug-ins and Java applets with this. If you come up with something spectacular, do send me a screenshot.
There is nothing much in the code of this application. If you are a .NET programmer, you will be able to put up such an application in no time. If you still required code or the binaries, please leave a comment below.
Hope you found this post interesting and beautiful!
This article has no explicit license attached to it, but may contain usage terms in the article text or the download files themselves. If in doubt, please contact the author via the discussion board below.
A list of licenses authors might use can be found here.