Beispiel #1
0
        /// <summary>Stroke and fill the MetaPen and MetaBrush paths.</summary>
        public virtual void StrokeAndFill()
        {
            MetaPen   pen        = state.GetCurrentPen();
            MetaBrush brush      = state.GetCurrentBrush();
            int       penStyle   = pen.GetStyle();
            int       brushStyle = brush.GetStyle();

            if (penStyle == MetaPen.PS_NULL)
            {
                cb.ClosePath();
                if (state.GetPolyFillMode() == MetaState.ALTERNATE)
                {
                    cb.EoFill();
                }
                else
                {
                    cb.Fill();
                }
            }
            else
            {
                bool isBrush = brushStyle == MetaBrush.BS_SOLID || brushStyle == MetaBrush.BS_HATCHED && state.GetBackgroundMode
                                   () == MetaState.OPAQUE;
                if (isBrush)
                {
                    if (state.GetPolyFillMode() == MetaState.ALTERNATE)
                    {
                        cb.ClosePathEoFillStroke();
                    }
                    else
                    {
                        cb.ClosePathFillStroke();
                    }
                }
                else
                {
                    cb.ClosePathStroke();
                }
            }
        }