Kevin Dente's Blog

The Blip in the Noise

September 2003 - Posts

Element behaviors

For a while now I've been coding away on a fairly hairy DHTML/JavaScript project. The project is basically a browser-based image viewing and annotation UI. So far I've mostly been working in straight-up JavaScript, with the server component wrapped into an ASP.NET Server Control.

Today I started taking a hard look at element behaviors in IE (aka viewlink behaviors). At first, it seemed like a very promising route. Basically I'm writing JavaScript that boils down to a client-side "control", and wrapping that up in a custom element would have been pretty nice. After a few hours of poking and prodding and experimenting, I ran across the catch. It seems that element behaviors can't participate in form postback - any form fields contained in the custom element don't show up in the form fields back at the server. People have hacked around this limitation by using a hidden form fields on the parent form, then copying the element's field values to the parent's hidden fields. That's workable for simple behaviors with just a couple of fields, but it would have been too complicated in my case.

So now I'm back to good ol' basic JavaScript. It's a shame when otherwise very cool and promising technology is rendered unusable because of a simple limitation like that. Incidentally, I didn't find this limitation anywhere in the documentation - only in a couple technical articles that I ran across during my research.

Posted Tuesday, September 30, 2003 5:00 PM by kevindente | 2 comment(s)

The Magic is gone

Well, it happened. The DotNetMagic UI library went commercial. Very sad, as the "free tool" community really needs something like this. Fortunately, the free last version will continue to be available, it just won't be enhanced.

Interestingly, from my quicky reading of the license there's nothing to prevent someone else from taking that snapshot of the source code and continuing it as a free open source library. But maybe I'm misinterpreting.

Posted Thursday, September 25, 2003 12:18 PM by kevindente | 4 comment(s)

Fanless PC

I just ran across this article about a new fanless PC. After several years running a mega-tower with 2 10K SCSI drives that sound roughly akin to an F-14 taking off from an aircraft carrier, this speaks to me. I'm seriously interested in my next home PC being quiet.


Posted Wednesday, September 24, 2003 9:48 AM by kevindente | with no comments

Transparent image generation

Sometimes you run into a task that should be easy but ends up being hard. Today I hit a big one. I was trying to dynamically generate an image with a transparent background that could be displayed in a web browser using GDI+ in the .NET framework. I was working with GIFs, since I had read previously that IE doesn't support transparent PNGs (unless you use the filter hack). 

At first look it didn't seem hard - create a Bitmap, draw my image, call Bitmap.MakeTransparent, and save the result. Easy...but it didn't work. The image rendered as a solid black rectangle. Hi ho, hi ho, it's off to Google I go.

Unfortunately, my Googling confirmed that lots of other people have encountered the same issue. Apparently when you save the bitmap, the transparency information is lost. The only solution I've found is a nasty chunk of code that does a bunch of low-level byte manipulations to build a new GIF with the correct palette information. Ick. Ugly, and requires creating a second copy of the image.

Since IE doesn't support transparent PNGs and .NET doesn't support transparent GIFs, I'm pretty well screwed. I guess I'll have to use the bitmap rebuilding hack. I hope Microsoft considers this a bug to be fixed in some future version of the framework. Or how about fixing IE to support transparent PNGs? Oh, right, I forgot, IE doesn't need improving anymore.




Posted Friday, September 12, 2003 5:36 PM by kevindente | 1 comment(s)

New version of Process Explorer

The Sysinternals folks have released version 7 of Process Explorer. It's wicked cool. The new thread view (with call stacks and debug symbols) is unbelievably awesome. I can't imagine my life as a developer without the tools those folks provide, and they've done it again.

Posted Wednesday, September 10, 2003 2:34 PM by kevindente | 1 comment(s)

More Posts