예제 #1
0
        public virtual void RenderBorder(MapGraphics g)
        {
            AntiAliasing antiAliasing = g.AntiAliasing;

            g.AntiAliasing = AntiAliasing.None;
            RectangleF absoluteRectangle = g.GetAbsoluteRectangle(new RectangleF(0f, 0f, 100f, 100f));

            absoluteRectangle.X      = (float)Math.Round((double)absoluteRectangle.X);
            absoluteRectangle.Y      = (float)Math.Round((double)absoluteRectangle.Y);
            absoluteRectangle.Width  = (float)Math.Round((double)absoluteRectangle.Width);
            absoluteRectangle.Height = (float)Math.Round((double)absoluteRectangle.Height);
            try
            {
                if (this.BorderWidth > 0 && !this.BorderColor.IsEmpty && this.BorderStyle != 0)
                {
                    using (Pen pen = new Pen(this.BorderColor, (float)this.BorderWidth))
                    {
                        pen.DashStyle = MapGraphics.GetPenStyle(this.BorderStyle);
                        pen.Alignment = PenAlignment.Inset;
                        if (this.BorderWidth == 1)
                        {
                            absoluteRectangle.Width  -= 1f;
                            absoluteRectangle.Height -= 1f;
                        }
                        g.DrawRectangle(pen, absoluteRectangle.X, absoluteRectangle.Y, absoluteRectangle.Width, absoluteRectangle.Height);
                    }
                }
            }
            finally
            {
                g.AntiAliasing = antiAliasing;
            }
        }
예제 #2
0
        internal virtual void RenderBorder(MapGraphics g)
        {
            AntiAliasing antiAliasing = g.AntiAliasing;

            g.AntiAliasing = AntiAliasing.None;
            RectangleF absoluteRectangle = g.GetAbsoluteRectangle(new RectangleF(0f, 0f, 100f, 100f));

            absoluteRectangle.X      = (float)Math.Round(absoluteRectangle.X);
            absoluteRectangle.Y      = (float)Math.Round(absoluteRectangle.Y);
            absoluteRectangle.Width  = (float)Math.Round(absoluteRectangle.Width);
            absoluteRectangle.Height = (float)Math.Round(absoluteRectangle.Height);
            try
            {
                if (BorderWidth <= 0 || BorderColor.IsEmpty || BorderStyle == MapDashStyle.None)
                {
                    return;
                }
                using (Pen pen = new Pen(BorderColor, BorderWidth))
                {
                    pen.DashStyle = MapGraphics.GetPenStyle(BorderStyle);
                    pen.Alignment = PenAlignment.Inset;
                    if (BorderWidth == 1)
                    {
                        absoluteRectangle.Width  -= 1f;
                        absoluteRectangle.Height -= 1f;
                    }
                    g.DrawRectangle(pen, absoluteRectangle.X, absoluteRectangle.Y, absoluteRectangle.Width, absoluteRectangle.Height);
                }
            }
            finally
            {
                g.AntiAliasing = antiAliasing;
            }
        }
예제 #3
0
 internal Pen GetPen()
 {
     return(new Pen(LineColor, LineWidth)
     {
         Width = LineWidth,
         DashStyle = MapGraphics.GetPenStyle(LineStyle)
     });
 }
예제 #4
0
        public Pen GetPen()
        {
            Pen pen = new Pen(this.LineColor, (float)this.LineWidth);

            pen.Width     = (float)this.LineWidth;
            pen.DashStyle = MapGraphics.GetPenStyle(this.LineStyle);
            return(pen);
        }
예제 #5
0
        public Pen GetPen()
        {
            if (this.BorderWidth <= 0)
            {
                return(null);
            }
            Pen pen = new Pen(this.ApplyLayerTransparency(this.BorderColorInt), (float)this.BorderWidth);

            pen.DashStyle = MapGraphics.GetPenStyle(this.BorderStyle);
            pen.Alignment = PenAlignment.Center;
            pen.LineJoin  = LineJoin.Round;
            return(pen);
        }
예제 #6
0
 internal Pen GetPen()
 {
     if (BorderWidth <= 0)
     {
         return(null);
     }
     return(new Pen(ApplyLayerTransparency(BorderColorInt), BorderWidth)
     {
         DashStyle = MapGraphics.GetPenStyle(BorderStyle),
         Alignment = PenAlignment.Center,
         LineJoin = LineJoin.Round
     });
 }
예제 #7
0
 public Pen GetPen()
 {
     if (this.BorderWidth > 0 && this.BorderStyle != 0)
     {
         Color        borderColor = this.BorderColor;
         int          borderWidth = this.BorderWidth;
         MapDashStyle borderStyle = this.BorderStyle;
         Pen          pen         = new Pen(this.BorderColor, (float)this.BorderWidth);
         pen.DashStyle = MapGraphics.GetPenStyle(this.BorderStyle);
         pen.Alignment = PenAlignment.Center;
         return(pen);
     }
     return(null);
 }
예제 #8
0
 internal Pen GetPen()
 {
     if (BorderWidth <= 0 || BorderStyle == MapDashStyle.None)
     {
         return(null);
     }
     _ = BorderColor;
     _ = BorderWidth;
     _ = BorderStyle;
     return(new Pen(BorderColor, BorderWidth)
     {
         DashStyle = MapGraphics.GetPenStyle(BorderStyle),
         Alignment = PenAlignment.Center
     });
 }
예제 #9
0
        internal void Render(MapGraphics g)
        {
            if (Common == null || !Visible || GetScale() == null)
            {
                return;
            }
            g.StartHotRegion(this);
            if (!string.IsNullOrEmpty(Image))
            {
                DrawImage(g, drawShadow: false);
                g.EndHotRegion();
                return;
            }
            Pen pen = new Pen(BorderColor, BorderWidth);

            pen.DashStyle = MapGraphics.GetPenStyle(BorderStyle);
            if (pen.DashStyle != 0)
            {
                pen.Alignment = PenAlignment.Center;
            }
            MarkerStyleAttrib markerStyleAttrib = GetMarkerStyleAttrib(g);

            try
            {
                if (markerStyleAttrib.path != null)
                {
                    bool circularFill = (MarkerStyle == MarkerStyle.Circle) ? true : false;
                    g.FillPath(markerStyleAttrib.brush, markerStyleAttrib.path, 0f, useBrushOffset: true, circularFill);
                }
                if (BorderWidth > 0 && markerStyleAttrib.path != null)
                {
                    g.DrawPath(pen, markerStyleAttrib.path);
                }
            }
            catch (Exception)
            {
                markerStyleAttrib.Dispose();
            }
            if (markerStyleAttrib.path != null)
            {
                Common.MapCore.HotRegionList.SetHotRegion(g, this, markerStyleAttrib.path);
            }
            g.EndHotRegion();
        }
예제 #10
0
 public void Render(MapGraphics g)
 {
     if (this.Common != null && this.Visible && this.GetScale() != null)
     {
         g.StartHotRegion(this);
         if (!string.IsNullOrEmpty(this.Image))
         {
             this.DrawImage(g, false);
             g.EndHotRegion();
         }
         else
         {
             Pen pen = new Pen(this.BorderColor, (float)this.BorderWidth);
             pen.DashStyle = MapGraphics.GetPenStyle(this.BorderStyle);
             if (pen.DashStyle != 0)
             {
                 pen.Alignment = PenAlignment.Center;
             }
             MarkerStyleAttrib markerStyleAttrib = this.GetMarkerStyleAttrib(g);
             try
             {
                 if (markerStyleAttrib.path != null)
                 {
                     bool circularFill = (byte)((this.MarkerStyle == MarkerStyle.Circle) ? 1 : 0) != 0;
                     g.FillPath(markerStyleAttrib.brush, markerStyleAttrib.path, 0f, true, circularFill);
                 }
                 if (this.BorderWidth > 0 && markerStyleAttrib.path != null)
                 {
                     g.DrawPath(pen, markerStyleAttrib.path);
                 }
             }
             catch (Exception)
             {
                 markerStyleAttrib.Dispose();
             }
             if (markerStyleAttrib.path != null)
             {
                 this.Common.MapCore.HotRegionList.SetHotRegion(g, this, markerStyleAttrib.path);
             }
             g.EndHotRegion();
         }
     }
 }
예제 #11
0
        internal override void RenderBorder(MapGraphics g)
        {
            AntiAliasing antiAliasing = g.AntiAliasing;

            g.AntiAliasing = AntiAliasing.None;
            RectangleF rectangleF = new RectangleF(GetAbsoluteLocation(), GetAbsoluteSize());

            rectangleF.X      = (float)Math.Round(rectangleF.X);
            rectangleF.Y      = (float)Math.Round(rectangleF.Y);
            rectangleF.Width  = (float)Math.Round(rectangleF.Width);
            rectangleF.Height = (float)Math.Round(rectangleF.Height);
            if (!(rectangleF.Width > 0f) || !(rectangleF.Height > 0f))
            {
                return;
            }
            try
            {
                if (BorderWidth <= 0 || BorderColor.IsEmpty || BorderStyle == MapDashStyle.None)
                {
                    return;
                }
                using (Pen pen = new Pen(BorderColor, BorderWidth))
                {
                    pen.DashStyle = MapGraphics.GetPenStyle(BorderStyle);
                    pen.Alignment = PenAlignment.Inset;
                    if (BorderWidth == 1)
                    {
                        rectangleF.Width  -= 1f;
                        rectangleF.Height -= 1f;
                    }
                    g.DrawRectangle(pen, rectangleF.X, rectangleF.Y, rectangleF.Width, rectangleF.Height);
                }
            }
            finally
            {
                g.AntiAliasing = antiAliasing;
            }
        }
예제 #12
0
        public override void RenderBorder(MapGraphics g)
        {
            AntiAliasing antiAliasing = g.AntiAliasing;

            g.AntiAliasing = AntiAliasing.None;
            RectangleF rectangleF = new RectangleF(base.GetAbsoluteLocation(), base.GetAbsoluteSize());

            rectangleF.X      = (float)Math.Round((double)rectangleF.X);
            rectangleF.Y      = (float)Math.Round((double)rectangleF.Y);
            rectangleF.Width  = (float)Math.Round((double)rectangleF.Width);
            rectangleF.Height = (float)Math.Round((double)rectangleF.Height);
            if (rectangleF.Width > 0.0 && rectangleF.Height > 0.0)
            {
                try
                {
                    if (this.BorderWidth > 0 && !this.BorderColor.IsEmpty && this.BorderStyle != 0)
                    {
                        using (Pen pen = new Pen(this.BorderColor, (float)this.BorderWidth))
                        {
                            pen.DashStyle = MapGraphics.GetPenStyle(this.BorderStyle);
                            pen.Alignment = PenAlignment.Inset;
                            if (this.BorderWidth == 1)
                            {
                                rectangleF.Width  -= 1f;
                                rectangleF.Height -= 1f;
                            }
                            g.DrawRectangle(pen, rectangleF.X, rectangleF.Y, rectangleF.Width, rectangleF.Height);
                        }
                    }
                }
                finally
                {
                    g.AntiAliasing = antiAliasing;
                }
            }
        }