Changing the Color of a GDI shape

06-19-2006, 01:20 PM
Hey. My questions is this, is it possible, and if so how? to change the color of a region created using GDI+ with for instance a button click? to create the shape im using the following code :

Dim line As New Rectangle(500, 300, 245, 4)
Dim brushes As New System.Drawing.Drawing2D.LinearGradientBrush(line, Color.LightBlue, Color.Transparent, Drawing2D.LinearGradientMode.Horizontal, True)
Dim p As New Point(25, 312)
Dim p2 As New Point(245, 312)
Dim p3 As New Point(245, 314)
Dim p4 As New Point(25, 314)
Dim pt As Point() = {p, p2, p3, p4}
e.Graphics.FillPolygon(brushes, pt)

thanks in advance

06-21-2006, 12:27 PM
You simply change 'brushes' so that it is a different color, and then you call
e.Graphics.FillPolygon(brushes, pt)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum