How to implement Fill tool for a paint application in WPF.

Feb 18 2010 2:47 PM
Hi,

I am implementing Paint application in WPF. I am able to implement pencil tool and line tool. But I am unable to implement fill tool which will help me to color a shape (like on in ms paint)

See my main problem is not to color shapes like rectangle or ellipse but a custom shape which i draw using my pencil tool. To make it more clear following is logic of my pencil tool.

Here each line is a object and I have to fill a shape is is created by numerous of such object.

Pencil Tool Logic
get initial_coordinates coordinates

function mousemove
{
 if(mousemoves)
  {
   final_coordinates = get mouse coordinates
   draw line(inital_coordinates, final coordinates)

   initial_coordinates = final_coordinates;
   }
}



Thanks
-Sanchit

Answers (1)