M
mcm
Help! I need to gradient fill a Polygon on a Windows CE 5.0 system. How do I do it?
This works beautifully on a Windows Vista desktop as the target:
//*******************************
GraphicsPath pathPoints;
// fill the points path (for example a rounded rectangle)
Brush brushButton = new LinearGradientBrush(rectDraw, colorTop, colorBottom, LinearGradientMode.Vertical);
e.Graphics.FillPath(brushButton, pathPoints);
//*******************************
However I need to run my app on a CE 5.0 (.NET) system.
I've made the shape into a Polygon since the Compact Framework doesn't have a "GraphicsPath" - however, I really want to fill the polygon with a gradient.
//*******************************
Point[] pointArray;
// fill the point array with (for example) a manually generated rounded rectangle
Brush brushFill = new SolidBrush(Color.Blue); // I want this to be a gradien not solid!!!!
e.Graphics.FillPolygon(brushFill, pointArray);
//********************************
Microsoft shows how to fill a rectangle: http://msdn2.microsoft.com/en-us/library/ms229655.aspx
but not a polygon.
How do I do it?
This works beautifully on a Windows Vista desktop as the target:
//*******************************
GraphicsPath pathPoints;
// fill the points path (for example a rounded rectangle)
Brush brushButton = new LinearGradientBrush(rectDraw, colorTop, colorBottom, LinearGradientMode.Vertical);
e.Graphics.FillPath(brushButton, pathPoints);
//*******************************
However I need to run my app on a CE 5.0 (.NET) system.
I've made the shape into a Polygon since the Compact Framework doesn't have a "GraphicsPath" - however, I really want to fill the polygon with a gradient.
//*******************************
Point[] pointArray;
// fill the point array with (for example) a manually generated rounded rectangle
Brush brushFill = new SolidBrush(Color.Blue); // I want this to be a gradien not solid!!!!
e.Graphics.FillPolygon(brushFill, pointArray);
//********************************
Microsoft shows how to fill a rectangle: http://msdn2.microsoft.com/en-us/library/ms229655.aspx
but not a polygon.
How do I do it?