Dev-Picayune

picayune: of little value or importance

Archive for September, 2004

Google Labs Aptitude Test

It appears that plenty of people are blogging (and even scanning) in the GLAT (Google Labs Aptitude Test that is found in several current issues of magazines including Dr. Dobbs Journal. I admit I found myself pondering some of the questions. It certainly has to be the most unique method I have seen to solicit resumes. I hate to know how many people will actually fill these out and send them in. How would you sort through them all? They would need some filtering criteria to quickly cut through all the useless ones. But what would you pick for that? I think this troubles me more than the questions themselves.

No comments

Nevada Attempt 2 has Begun!

I have officially restarted the Nevada project now. After some experimenting with transparency some more, I have realized that even with my previously posted fix that dealt with .NET 1.1 and VS 2003, that there were still some problems. Problem number one was that no matter what you pick as your transparent color, black text would not show up. Also, after populating a picture or two and then hitting the ALT key while the window had focus, caused a copy of part of the image to be redrawn on another part of the window. So needless to say it wasn’t pretty. Stripping out the fix and simplifying, I decided that VS 2005 (even though still in beta) with .NET 2 (obviously also still in Beta) was the way to go. The following screen shot will show the effect I am now getting which is the background of the toolbar has an opacity level separate from the icons themselves. nevada screen shot

How did I do this? I created two separate windows. The first window is compromised of several panels which are loaded with images at runtime (because I want to make this thing skinnable even if nobody ever does any skins for it). This window has a opacity set (approximately 50% I think but it will be completely configurable). Then a second window is created that is synced to stay right on top of the main window. I snag all the activate events and bring to top the child window so that it is always visible and has focus. This window has a transparency key and background color both set to Magenta. The icons and the Nevada text are controls populated on this window. This window is currently set to be completely opaque but obviously could be set otherwise (and indepent of the bottom window). I’d be the first one to admit that this is a bit of a hack but it gives me absolute freedom. I could even have the icons appear to be drawn outside the main body of the toolbar if I wanted.
But now that I have restarted the whole process, I’m actually farther behind with this new version than I was to begin with. However, I feel like my design will be much better as experience has greatly improved my OOP skills.

No comments

.NET Shaped Windows mystery solved in 2 ways

Last night I had the pleasant surprise of finding that an issue from .net v1 and 1.1 with shaped windows has been resolved in the VS 2005 and .NET 2 Beta. If you do a search for “Shaped Windows C#.NET” or something like that, you’ll get tons of hits referencing the concept of setting the form’s transparency key to a color that you want to make transparent. If you fill a window (with no frame) with that color and then have few bits of graphics or objects that are not that color, it will draw an irregular shaped window with only the items you want on there. Unfortunately, if you had your color settings greater than 16-bits (which any self-respecting photographer would), it won’t work anymore. The color that should have been transparent shows up.

But in attempting to do something related for work today, I stumbled across these magical 4 lines of code that allow you to implement irregular shaped windows in 32-bit color mode.

System.Drawing.Bitmap Img = new System.Drawing.Bitmap(this.BackgroundImage);Img.MakeTransparent(Img.GetPixel(0,0));this.BackgroundImage = Img;this.TransparencyKey = Img.GetPixel(0,0);

The ‘this.BackgroundImage’ is my addition so that you can still statically compile the image resource into your project. One thing to watch out for though is that this assumes that position 0,0 holds a pixel with the color you want to make transparent. What this does, is opens up the posibility of completing my Nevada project the way I have always wanted to do it.

No comments

Alpha Plus lives on!

It was over 9 years ago that I was primary developer (but certainly had some significant help from Michael Ledet) for an alphanumeric paging program called Alpha Plus. I was curious to see whether someone even still had it or sold it. I found that Telepage Paging Services is still selling it for $19.95. Here is a product that is 16-bit and originally developed under Windows 3.1, and yet someone still sells it. Wow! It’s amazing how things can live on if you make enough copies. I can’t remember how many packages we had created, I think it was somewhere in the thousands of copies. I still have the package (seen on the linked web page) sitting on my desk. What’s funny is the back has the names of some of my friends from college (although some of them now have new names) appearing in the screen shot for the packaging. Too bad nobody has a shot of the back of the package.

Another interesting tid-bit if you happen to be reading this and you are an Alpha Plus user, there is an embedded easter egg. I believe it is like control right-click or Alt or Shift combination something with a right single or double click on the ‘?’ help button on the toolbar. It’s a pretty cool little animated screen with the letters for everybody’s names flying across from the paging tower into the pager and scrolling down. I know I spent a ton more time on that than I should have, but it was sure fun.

If you are an Alpha Plus paging software user be sure to contact me (unless you really hate it — in which case don’t bother).

1 comment