Thursday, October 25, 2007

My article published on CodeProject!

In order to boost the site-visit , I posted my old blog to CodeProject, haha. Thanks to the guys at CodeProject, to allow my article published, although it's a simple one. Hope can exchange valuable pointers with rest of the developers from all over the world.


p/s: My monitor have sent to repair, due to roof leaking. Got to post this blog using company's PC. Also not so free to develop new program or enhance existing article, sigh!

Wednesday, September 26, 2007

My first .Net app : C# Analog Clock

Finally, my first try on a simple .NET app is done. I created a analog clock widget using C#. I think it's quite challenging for a beginner because it will require simple background of Math, image processing, and 3D graphics programming.

With the mouse hit-test, anti-aliasing graphics and flicker-free double buffering, you couldn't even tell the difference between it and Sidebar gadget. Yet it is in C#, and it reduces the pain to deal with Win32 API directly.


To draw the hour-hand, minute-hand and second-hand needs a little trick.

1) Set the origin of form to center, from left-top (so that following rotation can be taken place)
2) Save the current state
3) Rotate the new graphics objects
4) Draw the second-hand (or any hands) at new origin, new orientation
5) Restore the saved state
6) Rotate the new graphics objects
7) Draw the minute-hand (or any hands left) at new origin, new orientation
8) Reload the identity / Reset the origin and orientation (Restore the saved state seems failed)
9) Rotate the new graphics objects
10) Draw the hour-hand (or any hands left) at new origin, new orientation

Voila!
You can get the source here or get the exe here!

#p/s: thanks for the Fasticon for its free icon provided.

Tuesday, September 18, 2007

How to compete with Microsoft

I just happend to come across to this the Inquirer (It is famous of MS-bashing), ironic but true.
Qoute:

Plan B: Start by developing a killer ap. If you can't think of one, don't worry - simply write a copy of an existing piece of software. It doesn't even have to do anything. When people point out that your product is rubbish, issue a press release blaming Microsoft for refusing to give you its proprietary code for free.
...
If you persevere for long enough, you may even convince the European Union that your product would be a world beater if only those bastards at Microsoft would give you the code to make it work properly.
...

Monday, September 17, 2007

Wow, write an OS!!

While surfing on OSNews, I come across to this site. Know what, you also can write your own OS.

With the QEMU processor emulator, anyone one can write & test OS written. Start from doc here and here, now. I wish i could do it now, but not yet master ASP.NET, NET Framework, NET CF, ... , to name a few. OMG.

Sunday, September 16, 2007

Bumblebee I am?

While reading the Mike Hall's Windows Embeded blog, I also take part in the Which Transformer are you? quiz.
Haha, I get this:

I AM
61%
BUMBLEBEE
Take the Transformers Quiz

But I still prefer the Bumblebee in the anime I watched during the time I was a kid.