Tuesday, November 3, 2009

Random Color

I have just finished another practice problem  - a window that changes its color when clicked. What is worth noting about this task, is when I tried one way of doing it and it didn't quite work, I simply did it in a slightly different way and it all worked very nicely. It shows the flexibility with which Windows GDI works and the amount of solutions I have to/can choose from.

UPDATE:

I have combined this with another practice problem to create functions that would display regular penta- and hexagons. The "regularity" is debatable, but I am not sure how to make it better - I've run through my math again and again and it is right. They seem to be regular but stretched - anyway, here are the results. they are put at a random point and with random color.



I have also clipped the window to a circle shape - although it doesn't really look like a regular window (no title bar, frame, x-button, weird shape) it's still in fact a window in its full meaning. Quite an interesting thing, which is possible and correct to do, yet it is not used much, if not at all by programmer - we don't see windows of shapes other than rectangles.
Tomorrow i will start the design of checkers. I will use M$ OneNote. This is quite unprobable, however if I feel like it will be useful I will download a trial of M$ Visio.

No comments:

Post a Comment