c2483 Posted April 20, 2003 Posted April 20, 2003 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 Quote
Guest mutant Posted April 21, 2003 Posted April 21, 2003 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 :) Quote
*Experts* Nerseus Posted April 21, 2003 *Experts* Posted April 21, 2003 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 Quote "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
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.