This should probably go into Graphics but I thought I'd start here:


Small Drawing Challenge

I'm looking a for compact and fast-running way of creating something like an Identicon. What I had in mind was to "paint" such an image onto a 24x24 pixel PictureBox.

The image would have 9 cells, a center C, four corners K, and four faces F:
Code:
+---+---+---+
| K | F | K |
+---+---+---+
| F | C | F |
+---+---+---+
| K | F | K |
+---+---+---+
I'm happy to make it simple: pass in four parameters to the routine, each being an Integer in the range 0 to 7. I'll worry about hashing my actual input to create these four values, right now my problem is drawing the desired "snowflake."

The background color would be white.

The first parameter would select among 8 possible contrasting colors: constrasting well against white. The 8 colors should be fairly distinctive among each other, avoiding things line fine shades of yellow or cyan (i.e. not cyan and slightly lighter cyan). For example:

Black
Medium Blue
Teal
Medium Green
Yellow
Orange
Red
Medium Grey

The specific colors aren't important though, just distinct colors.

The second parameter would pick one of 8 "shapes" to draw in the center square.

The third parameter would pick one of another 8 shapes to draw mirrored in the corner squares.

The fourth parameter would pick one of another 8 shapes to draw rotated in the face squares.

The actual "shapes" could be defined as a sequence of Picture.Line and Picture.Circle relative drawing methods to create filled rectangles and/or circles. Something on that order would be preferable to blitting in predefined images, but that's just a thought too. Better idea? Show me!


If someone knows where I could find existing code to do this it'd be great too.