コード例 #1
0
        private void SetInnerSymbol(SymbolType type)
        {
            ISymbol newSymbol = null;

            // If this class is acting as a wrapper class, then it should update the internal IStroke.
            switch (type)
            {
            case SymbolType.Character:
                newSymbol = new CharacterSymbol();
                break;

            case SymbolType.Picture:
                newSymbol = new PictureSymbol();
                break;

            case SymbolType.Simple:
                newSymbol = new SimpleSymbol();
                break;
            }

            if (newSymbol != null)
            {
                if (_innerSymbol != null)
                {
                    newSymbol.CopyPlacement(_innerSymbol);
                }
            }

            _innerSymbol = newSymbol;
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PointSymbolizer"/> class that has a member that is constructed
        /// from the specified image.
        /// </summary>
        /// <param name="image">The image to use as a point symbol</param>
        /// <param name="size">The desired output size of the larger dimension of the image.</param>
        public PointSymbolizer(Image image, double size)
        {
            Symbols = new CopyList <ISymbol>();
            IPictureSymbol ps = new PictureSymbol(image);

            ps.Size = new Size2D(size, size);
            Symbols.Add(ps);
        }
コード例 #3
0
 /// <summary>
 /// Creates a category where the picture is used for the symbol, and a selected
 /// symbol is created as the same symbol but with a cyan border.
 /// </summary>
 /// <param name="picture">The image to use</param>
 /// <param name="size">The size of the symbol</param>
 public PointCategory(Image picture, double size)
 {
     Symbolizer = new PointSymbolizer(picture, size);
     PictureSymbol ps = new PictureSymbol(picture, size)
                            {
                                OutlineColor = Color.Cyan,
                                OutlineWidth = 2,
                                OutlineOpacity = 1f
                            };
     SelectionSymbolizer = new PointSymbolizer(ps);
 }
コード例 #4
0
        /// <summary>
        /// This helps the copy process by preparing the internal variables AFTER memberwiseclone has created this
        ///
        /// </summary>
        /// <param name="copy"></param>
        protected override void OnCopy(Descriptor copy)
        {
            // Setting the image property has a built in check to dispose the older reference.
            // After a MemberwiseClone, however, this older reference is still in use in the original PictureSymbol.
            // We must, therefore, set the private variables to null before doing the cloning.
            PictureSymbol duplicate = copy as PictureSymbol;

            if (duplicate != null)
            {
                duplicate._image    = null;
                duplicate._original = null;
            }
            base.OnCopy(copy);
            if (duplicate != null)
            {
                duplicate._image    = _image.Copy();
                duplicate._original = _original.Copy();
            }
        }
コード例 #5
0
 /// <summary>
 /// Creates a point symbolizer with one memberw, and that member is constructed
 /// from the specified image.
 /// </summary>
 /// <param name="image">The image to use as a point symbol</param>
 /// <param name="size">The desired output size of the larger dimension of the image.</param>
 public PointSymbolizer(Image image, double size)
 {
     _symbols = new CopyList<ISymbol>();
     IPictureSymbol ps = new PictureSymbol(image);
     ps.Size = new Size2D(size, size);
     _symbols.Add(ps);
 }
コード例 #6
0
ファイル: Symbol.cs プロジェクト: ExRam/DotSpatial-PCL
 private void SetInnerSymbol(SymbolType type)
 {
     ISymbol newSymbol = null;
     // If this class is acting as a wrapper class, then it should update the internal IStroke.
     switch (type)
     {
         case SymbolType.Character:
             newSymbol = new CharacterSymbol();
             break;
         case SymbolType.Picture:
             newSymbol = new PictureSymbol();
             break;
         case SymbolType.Simple:
             newSymbol = new SimpleSymbol();
             break;
     }
     if (newSymbol != null)
     {
         if (_innerSymbol != null) newSymbol.CopyPlacement(_innerSymbol);
     }
     _innerSymbol = newSymbol;
 }
コード例 #7
0
ファイル: PointCategory.cs プロジェクト: hanchao/DotSpatial
 /// <summary>
 /// Creates a category where the picture is used for the symbol, and a selected
 /// symbol is created as the same symbol but with a cyan border.
 /// </summary>
 /// <param name="picture">The image to use</param>
 /// <param name="size">The size of the symbol</param>
 public PointCategory(Image picture, double size)
 {
     Symbolizer = new PointSymbolizer(picture, size);
     PictureSymbol ps = new PictureSymbol(picture, size)
                            {
                                OutlineColor = Color.Cyan,
                                OutlineWidth = 2,
                                OutlineOpacity = 1f
                            };
     SelectionSymbolizer = new PointSymbolizer(ps);
 }