For those of you who use a dynamic DNS service (DynDNS, no-ip, etc.), I wrote a C# based updater client. The project contains a class library, console app and service. It is designed to be extended to other mechanisms for fetching the IP and reporting it to the DNS server. Right now it uses the checkip service of dynDNS and updates RegisterFly.com. Full VS2005 project and source code available
here.
2dcd23ba-645b-4f05-b2c9-63a8c2a1184b|0|.0
I was asked again today how to draw "translucent" stuff in .NET (GDI+). My response was "Use the
Alpha channel." Noting that this was not the first time I had been asked about this, I thought a brief explanation here was appropriate. From Wikipedia:
The value of alpha in the color code ranges from 0.0 to 1.0, where 0.0 represents a fully transparent color, and 1.0 represents a fully opaque color.
In .NET the range of the value is in byte form (0-255), with 255 representing 1.0. Thus there are 256 alpha channel settings. When drawing, one can adjust the value of the alpha channel to allow other colors to show through.
private void pictureBox1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(255,Color.Yellow)), new Rectangle(50,50,100,100));
e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(150,Color.Blue)), new Rectangle(0,0,100,100));
}
This simple example draws two boxes in a picturebox. The point at which they intersect makes a kind of green. This is due to the alpha channel setting of 150 on the blue box. This is a simplistic overview since alpha channels can be used for dialogs, images and a few other things. Watch for more on alpha channels in the future.
b1243653-3a2c-41ac-b612-784da6c7c916|0|.0
I've been getting a lot of emails on the
TFTP server I wrote. Some people are having troubles understanding how to use it. So I wrote a quick app to demonstrate it. Get it
here.
762a5b70-2945-4345-8c70-3a1f7ca04f6d|0|.0
A few of my embedded devices around the office use TFTP as a means of upgrading their firmware. Since I wanted some control of what/how these firmware files got sent, I wrote a C# class to act as a TFTP server. It's pretty simple and still needs work, but here it is:
TFTPServer.cs You'll also want to get the zip file, as it has the ExTrace support.
TFTPServer.zip
851249c3-1bc9-4cf2-ac3e-31c20eb5656c|3|5.0