Fill

c2483

New member
Joined
Apr 20, 2003
Messages
4
Is there any way I can get the shape from a point clicked.
How do those apps work where you just click fill tool then click inside the border of any shape
 
Im not sure what you are asking. Do you want to know if you clicked a shape on your form?

If thats what you need I can give you an example:

Code:
Dim rectangles as ArrayList()

Private Sub form_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown


       Dim rectangle as Rectangle
       for each rectangle in rectangles You have to add rectangles
to the array list every time you draw one.
             if rectangle.contains(e.Y,e.X) Then
                    MessageBox.show("You clicked on a rectangle")
             end if
       next

End Sub


This should work :)
 
If youre writing the code to flood fill an arbitrary chunk of bits (such as allowing the user to draw an enclosed area and then fill it or fill an area on a pre-loaded bitmap), youll have to code the FloodFill yourself. If you know the exact dimensions of the area (such as on an object that youre creating through code - such as a pentagon, rectangle, or any arbitrary closed path), then the Graphics object can draw a solid object filled as well as an outline.

-Nerseus
 
Back
Top