Exemplo n.º 1
0
        internal override void Render(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 (BackShadowOffset != 0)
                {
                    RectangleF rect = rectangleF;
                    rect.Offset(BackShadowOffset, BackShadowOffset);
                    g.FillRectangle(g.GetShadowBrush(), rect);
                }
                using (Brush brush = g.CreateBrush(rectangleF, BackColor, BackHatchStyle, "", MapImageWrapMode.Unscaled, Color.Empty, MapImageAlign.Center, BackGradientType, BackSecondaryColor))
                {
                    g.FillRectangle(brush, rectangleF);
                }
            }
            finally
            {
                g.AntiAliasing = antiAliasing;
            }
        }
Exemplo n.º 2
0
        internal virtual void RenderBackground(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 (BackShadowOffset != 0)
                {
                    RectangleF rect = absoluteRectangle;
                    rect.Offset(BackShadowOffset, BackShadowOffset);
                    g.FillRectangle(g.GetShadowBrush(), rect);
                }
                if (IsMakeTransparentRequired())
                {
                    using (Brush brush = new SolidBrush(GetColorForMakeTransparent()))
                    {
                        g.FillRectangle(brush, absoluteRectangle);
                    }
                }
                using (Brush brush2 = g.CreateBrush(absoluteRectangle, BackColor, BackHatchStyle, "", MapImageWrapMode.Unscaled, Color.Empty, MapImageAlign.Center, BackGradientType, BackSecondaryColor))
                {
                    g.FillRectangle(brush2, absoluteRectangle);
                }
            }
            finally
            {
                g.AntiAliasing = antiAliasing;
            }
        }