am designing a project in which i have to allow users to allow drag various shapes that are made according to the request of user on layout can ne1 plz suggest me some algo for this......
this is what I thought

1.compare the pixel of point where left click occurs with d colour of any valid shape colour that is previously defined.
2.if found to any object go through all index of all shapes of that type
3.Now i have to compare this point with all boundries of all objects of this shape


PLZZ SUGGEST ANY THING FOR STEP-3