Xcelled194 28 Junior Poster in Training

Its my first post, and its a complicated one... I need some help writing an image coloring algorithm for a personal project.

I have two programs, a restorer and a code generator. The restorer reads code generated by the code generator and manipulates the mouse accordingly. Every mouse event is one line. This means moving the mouse, holding the left button, moving it somewhere else, and letting it up would take up four lines!

The pictures are 200x200. They are all white, except for a red object in the middle. The shape of this object varies. A sample picture would be:

http://img19.imageshack.us/img19/6554/pumpkine.png

The program can switch between two brushes, one that is 28 pixels across, and one that is 8 pixels across.

The brush cannot touch any red!

I have all the coding in place and working. It checks for a red pixel in the vicinity of the brush. If it finds one, it simply moves on.

What I need help with is figuring out an algorithm that will eliminate all of the white in as few Mouse events as possible. There is a limit of approximately 600 Mouse events. So far I've tried the brute force linear with big brush, then finishing details with the small brush. But, needless to say, that took up wayyy to many lines.... Can anyone help?

P.S. My language of choice is VB

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.