SetPolyFillMode() public method

public SetPolyFillMode ( PolygonFillMode fillMode ) : void
fillMode PolygonFillMode
return void
Beispiel #1
0
        public void RunOnce(GDIRenderer aPort)
        {
            System.Drawing.Point[] points = new Point[10];

            for (int i = 0; i < 10; i++)
            {
                points[i].X = fSize.Width * fFigure[i].X / 200;
                points[i].Y = fSize.Height * fFigure[i].Y / 100;
            }

            // Select a gray brush to draw with
            //aPort.SelectStockObject(GDI32.GRAY_BRUSH);
            GDIBrush aBrush = new GDIBrush(BrushStyle.Solid, HatchStyle.Vertical, RGBColor.Blue, Guid.NewGuid());
            aPort.SetBrush(aBrush);

            // First draw with ALTERNATE method
            aPort.SetPolyFillMode(PolygonFillMode.Alternate);
            aPort.Polygon(points);


            // Translate the x coordinates by half the screen
            for (int i = 0; i < 10; i++)
            {
                points[i].X += fSize.Width / 2;
            }

            // Now draw with WINDING method
            aPort.SetPolyFillMode(PolygonFillMode.Winding);
            aPort.Polygon(points);
        }