Ejemplo n.º 1
0
        public object Clone(CloneOptions options)
        {
            var display = options?.Display;

            if (display == null)
            {
                return(Clone());
            }

            float fac = 1;

            if (options.ApplyRefScale)
            {
                fac = (float)(display.refScale / display.mapScale);
                fac = options.RefScaleFactor(fac);
            }
            fac *= options.DpiFactor;

            HatchSymbol hSym = new HatchSymbol(_forecolor, _backcolor, _hatchStyle);

            if (_outlineSymbol != null)
            {
                hSym._outlineSymbol = (ISymbol)_outlineSymbol.Clone(options);
            }

            hSym.LegendLabel = _legendLabel;

            return(hSym);
        }
Ejemplo n.º 2
0
        public object Clone(CloneOptions options)
        {
            var display = options?.Display;

            if (display == null)
            {
                return(Clone());
            }

            float fac = 1;

            if (options.ApplyRefScale)
            {
                fac = (float)(display.refScale / display.mapScale);
                fac = options.RefScaleFactor(fac);
            }

            if (display.dpi != 96.0)
            {
                fac *= (float)(display.dpi / 96.0);
            }

            GradientFillSymbol fSym = new GradientFillSymbol(_gradient);

            if (_outlineSymbol != null)
            {
                fSym._outlineSymbol = (ISymbol)_outlineSymbol.Clone(options);
            }

            fSym._rectType   = _rectType;
            fSym.LegendLabel = _legendLabel;
            return(fSym);
        }
Ejemplo n.º 3
0
        public object Clone(CloneOptions options)
        {
            var display = options?.Display;

            if (display == null)
            {
                return(Clone());
            }

            float fac = 1;

            if (options.ApplyRefScale && display.mapScale >= 1)
            {
                fac = (float)(display.refScale / display.mapScale);
                fac = options.RefScaleFactor(fac);
            }
            fac *= options.DpiFactor;

            SymbolDotedLineSymbol cloneSym = new SymbolDotedLineSymbol();

            if (this.LineSymbol != null)
            {
                cloneSym.LineSymbol = this.LineSymbol.Clone(options) as ILineSymbol;
            }

            if (this.PointSymbol != null)
            {
                cloneSym.PointSymbol = this.PointSymbol.Clone(options) as IPointSymbol;
            }

            cloneSym.LegendLabel = _legendLabel;

            cloneSym.DrawStartPoint    = this.DrawStartPoint;
            cloneSym.DrawEndPoint      = this.DrawEndPoint;
            cloneSym.DrawStepPoints    = this.DrawStepPoints;
            cloneSym.StepWidthUnit     = this.StepWidthUnit;
            cloneSym.SymbolMaxDistance = (int)((float)this.SymbolMaxDistance * fac);

            switch (cloneSym.StepWidthUnit)
            {
            case StepWidthUnit.Pixel:
                cloneSym.StepWidth    = (int)((float)this.StepWidth * fac);
                cloneSym.StepStartPos = (int)((float)this.StepStartPos * fac);
                break;

            default:
                cloneSym.StepWidth    = this.StepWidth;
                cloneSym.StepStartPos = this.StepStartPos;
                break;
            }

            cloneSym.UseSymbolRotation = this.UseSymbolRotation;

            return(cloneSym);
        }
Ejemplo n.º 4
0
        static public float CalcPixelUnitFactor(CloneOptions options)
        {
            float fac = 1f;

            var display = options.Display;

            if (display != null)
            {
                if (options.ApplyRefScale)
                {
                    fac = (float)(display.refScale / display.mapScale);
                    fac = options.RefScaleFactor(fac);
                }
                fac *= options.DpiFactor;
            }

            return(fac);
        }
Ejemplo n.º 5
0
        public object Clone(CloneOptions options)
        {
            var display = options?.Display;

            if (display == null)
            {
                return(Clone());
            }

            float fac = 1;

            if (options.ApplyRefScale)
            {
                fac = ReferenceScaleHelper.RefscaleFactor(
                    (float)(display.refScale / display.mapScale),
                    this.SymbolSize,
                    this.MinSymbolSize,
                    this.MaxSymbolSize);

                fac = options.RefScaleFactor(fac);
            }
            fac *= options.DpiFactor;

            TrueTypeMarkerSymbol marker = new TrueTypeMarkerSymbol(Current.Engine.CreateFont(Font.Name, Math.Max(Font.Size * fac / display.Screen.LargeFontsFactor, 2f), _font.Style), _brush.Color);

            marker.Angle            = Angle;
            marker.HorizontalOffset = HorizontalOffset * fac;
            marker.VerticalOffset   = VerticalOffset * fac;

            marker._char       = _char;
            marker.LegendLabel = _legendLabel;

            marker.MaxSymbolSize = this.MaxSymbolSize;
            marker.MinSymbolSize = this.MinSymbolSize;

            CloneEngineOffsets(marker._engineOffset);

            return(marker);
        }
Ejemplo n.º 6
0
        public object Clone(CloneOptions options)
        {
            var display = options?.Display;

            if (display == null)
            {
                return(Clone());
            }

            float fac = 1;

            if (options.ApplyRefScale)
            {
                fac = ReferenceScaleHelper.RefscaleFactor(
                    (float)(display.refScale / display.mapScale),
                    this.SymbolSize, this.MinSymbolSize, this.MaxSymbolSize);
                fac = options.RefScaleFactor(fac);
            }
            fac *= options.DpiFactor;

            SimplePointSymbol pSym = new SimplePointSymbol(_pen.Color, _pen.Width * fac, _brush.Color);

            pSym._size            = Math.Max(_size * fac, 1f);
            pSym._symbolWidth     = _symbolWidth * fac;
            pSym.Angle            = Angle;
            pSym.Marker           = _type;
            pSym.HorizontalOffset = HorizontalOffset * fac;
            pSym.VerticalOffset   = VerticalOffset * fac;
            pSym.LegendLabel      = _legendLabel;
            pSym.Smoothingmode    = this.Smoothingmode;

            pSym.MaxSymbolSize = this.MaxSymbolSize;
            pSym.MinSymbolSize = this.MinSymbolSize;

            return(pSym);
        }