FillPath() 공개 메소드

public FillPath ( GDIBrush aBrush, GPath aPath ) : void
aBrush GDIBrush
aPath GPath
리턴 void
예제 #1
0
        public void RunOnce(GDIRenderer aPort)
        {
            // Do some path stuff
            GPath aPath = new GPath();
            
            aPath.Begin();
            aPath.MoveTo(10, 10, false);
            aPath.LineTo(10, 100, false);
            aPath.LineTo(100, 100, true);
            aPath.End();

            GDIBrush pathBrush = new GDIBrush(BrushStyle.Solid, HatchStyle.BDiagonal, RGBColor.Cyan, Guid.NewGuid());
            aPort.FillPath(pathBrush, aPath);

            GDIPen pathPen = new GDIPen(PenType.Geometric, 
                PenStyle.Solid, 
                PenJoinStyle.Round, 
                PenEndCap.Round, 
                RGBColor.Black, 
                10, 
                Guid.NewGuid());
            //aPort.DrawPath(pathPen, aPath);

            // Now use a GDIPath
            aPort.SetBkMode((int)BackgroundMixMode.Transparent);
            aPort.SetTextColor(RGBColor.Black);

            GDIFont aFont = new GDIFont("Impact", 96, Guid.NewGuid());

            GDIContext dc = aPort.DeviceContext;
            GDIPath gdipath = new GDIPath(dc, Guid.NewGuid());
            gdipath.Begin();
            aPort.SetFont(aFont);
            aPort.DrawString(200, 200, "The Scaled Text");
            gdipath.End();
            aPort.Flush();

            // First fill the text
            aPort.FillPath(pathBrush, gdipath);

            // Then stroke the path around it
            GDIPen textPen = new GDIPen(PenType.Geometric,
                PenStyle.Solid,
                PenJoinStyle.Round,
                PenEndCap.Round,
                RGBColor.Black,
                2,
                Guid.NewGuid());
            aPort.DrawPath(textPen, gdipath);
            aPort.Flush();

        }