Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Guest mutant
Posted

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:

 

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 :)

  • *Experts*
Posted

If you're 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), you'll have to code the FloodFill yourself. If you know the exact dimensions of the area (such as on an object that you're 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

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...