示例#1
0
        private void DrawSelectionOutline(Graphics g, PdnGraphicsPath outline)
        {
            if (outline == null)
            {
                return;
            }

            if (outlinePen1 == null)
            {
                outlinePen1           = new Pen(Color.FromArgb(160, Color.Black), 1.0f);
                outlinePen1.Alignment = PenAlignment.Outset;
                outlinePen1.LineJoin  = LineJoin.Bevel;
                outlinePen1.Width     = -1;
            }

            if (outlinePen2 == null)
            {
                outlinePen2             = new Pen(Color.White, 1.0f);
                outlinePen2.Alignment   = PenAlignment.Outset;
                outlinePen2.LineJoin    = LineJoin.Bevel;
                outlinePen2.MiterLimit  = 2;
                outlinePen2.Width       = -1;
                outlinePen2.DashStyle   = DashStyle.Dash;
                outlinePen2.DashPattern = new float[] { 4, 4 };
                outlinePen2.Color       = Color.White;
                outlinePen2.DashOffset  = 4.0f;
            }

            PixelOffsetMode oldPOM = g.PixelOffsetMode;

            g.PixelOffsetMode = PixelOffsetMode.None;

            SmoothingMode oldSM = g.SmoothingMode;

            g.SmoothingMode = SmoothingMode.AntiAlias;

            outline.Draw(g, outlinePen1);

            float offset = (float)((double)dancingAntsT / OwnerList.ScaleFactor.Ratio);

            outlinePen2.DashOffset += offset;

            if (whiteOpacity != 0)
            {
                outlinePen2.Color = Color.FromArgb(whiteOpacity, Color.White);
                outline.Draw(g, outlinePen2);
            }

            outlinePen2.DashOffset -= offset;

            g.SmoothingMode   = oldSM;
            g.PixelOffsetMode = oldPOM;
        }
示例#2
0
        private void DrawSelectionOutline(Graphics g, PdnGraphicsPath outline)
        {
            if (outline == null)
            {
                return;
            }

            if (outlinePen1 == null)
            {
                outlinePen1 = new Pen(Color.FromArgb(160, Color.Black), 1.0f);
                outlinePen1.Alignment = PenAlignment.Outset;
                outlinePen1.LineJoin = LineJoin.Bevel;
                outlinePen1.Width = -1;
            }

            if (outlinePen2 == null)
            {
                outlinePen2 = new Pen(Color.White, 1.0f);
                outlinePen2.Alignment = PenAlignment.Outset;
                outlinePen2.LineJoin = LineJoin.Bevel;
                outlinePen2.MiterLimit = 2;
                outlinePen2.Width = -1;
                outlinePen2.DashStyle = DashStyle.Dash;
                outlinePen2.DashPattern = new float[] { 4, 4 };
                outlinePen2.Color = Color.White;
                outlinePen2.DashOffset = 4.0f;
            }

            PixelOffsetMode oldPOM = g.PixelOffsetMode;
            g.PixelOffsetMode = PixelOffsetMode.None;
            
            SmoothingMode oldSM = g.SmoothingMode;
            g.SmoothingMode = SmoothingMode.AntiAlias;

            outline.Draw(g, outlinePen1);

            float offset = (float)((double)dancingAntsT / OwnerList.ScaleFactor.Ratio);
            outlinePen2.DashOffset += offset;

            if (whiteOpacity != 0)
            {
                outlinePen2.Color = Color.FromArgb(whiteOpacity, Color.White);
                outline.Draw(g, outlinePen2);
            }

            outlinePen2.DashOffset -= offset;

            g.SmoothingMode = oldSM;
            g.PixelOffsetMode = oldPOM;
        }