Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to change polygon colors

Status
Not open for further replies.

clowns119

Programmer
Feb 20, 2005
15
US
Hi all
i drew a polygon to a form. It it possible to change the color of the polygon using the mouse down event, if so how?
heres my polygon code, their will be 50 diffrent polygons I want to change the colors of each one individually on mouse down event

Code:
Private Sub MainFormLoad(sender As System.Object, e As System.EventArgs)
		
		'Defines new bitmap
   		Dim states As bitmap= new Bitmap(mapdraw.Width,mapdraw.Height)
   		
		'Draws image to Picturebox
		Me.mapdraw.Image=states
   		
   		'Defines your graphics holder
   		Dim g As Graphics = Graphics.FromImage(states)
		Dim greenb as solidbrush=new solidbrush(color.green)
		'creates polygons in the shape of states
		Dim WASHINGTON() As Point = { _
		New Point(95,35), _
		New Point(82,72), _
		New Point(93,78), _
		New Point(92,88), _
		New Point(158,110), _
		New Point(177,63), _
		New Point(113,35), _
		New Point(112,46) _
		}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top