/// <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); }
private void cmbSymbolType_SelectedIndexChanged(object sender, EventArgs e) { if (cmbSymbolType.SelectedItem.ToString() == "Simple") { if (tabSymbolProperties.TabPages.Contains(tabPicture)) { tabSymbolProperties.TabPages.Remove(tabPicture); } if (tabSymbolProperties.TabPages.Contains(tabCharacter)) { tabSymbolProperties.TabPages.Remove(tabCharacter); } if (tabSymbolProperties.TabPages.Contains(tabSimple) == false) { tabSymbolProperties.TabPages.Insert(0, tabSimple); tabSymbolProperties.SelectedTab = tabSimple; } } if (cmbSymbolType.SelectedItem.ToString() == "Character") { if (tabSymbolProperties.TabPages.Contains(tabPicture)) { tabSymbolProperties.TabPages.Remove(tabPicture); } if (tabSymbolProperties.TabPages.Contains(tabSimple)) { tabSymbolProperties.TabPages.Remove(tabSimple); } if (tabSymbolProperties.TabPages.Contains(tabCharacter) == false) { tabSymbolProperties.TabPages.Insert(0, tabCharacter); tabSymbolProperties.SelectedTab = tabCharacter; } } if (cmbSymbolType.SelectedItem.ToString() == "Picture") { if (tabSymbolProperties.TabPages.Contains(tabSimple)) { tabSymbolProperties.TabPages.Remove(tabSimple); } if (tabSymbolProperties.TabPages.Contains(tabCharacter)) { tabSymbolProperties.TabPages.Remove(tabCharacter); } if (tabSymbolProperties.TabPages.Contains(tabPicture) == false) { tabSymbolProperties.TabPages.Insert(0, tabPicture); tabSymbolProperties.SelectedTab = tabPicture; } } if (_ignoreChanges) return; int index = ccSymbols.Symbols.IndexOf(ccSymbols.SelectedSymbol); if (index == -1) return; ISymbol oldSymbol = ccSymbols.SelectedSymbol; if (cmbSymbolType.SelectedItem.ToString() == "Simple") { SimpleSymbol ss = new SimpleSymbol(); if (oldSymbol != null) ss.CopyPlacement(oldSymbol); ccSymbols.Symbols[index] = ss; ccSymbols.RefreshList(); ccSymbols.SelectedSymbol = ss; } if (cmbSymbolType.SelectedItem.ToString() == "Character") { CharacterSymbol cs = new CharacterSymbol(); if (oldSymbol != null) cs.CopyPlacement(oldSymbol); ccSymbols.Symbols[index] = cs; ccSymbols.RefreshList(); ccSymbols.SelectedSymbol = cs; } if (cmbSymbolType.SelectedItem.ToString() == "Picture") { PictureSymbol ps = new PictureSymbol(); if (oldSymbol != null) ps.CopyPlacement(oldSymbol); ccSymbols.Symbols[index] = ps; ccSymbols.RefreshList(); ccSymbols.SelectedSymbol = ps; } }
/// <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); ps.OutlineColor = Color.Cyan; ps.OutlineWidth = 2; ps.OutlineOpacity = 1f; SelectionSymbolizer = new PointSymbolizer(); }
void ccSymbols_AddClicked(object sender, EventArgs e) { ISymbol s = null; string type = cmbSymbolType.SelectedItem.ToString(); switch (type) { case "Simple": s = new SimpleSymbol(); break; case "Character": s = new CharacterSymbol(); break; case "Picture": s = new PictureSymbol(); break; } if (s != null) ccSymbols.Symbols.Add(s); ccSymbols.RefreshList(); UpdatePreview(); }
private void SetInnerSymbol(SymbolTypes type) { ISymbol newSymbol = null; // If this class is acting as a wrapper class, then it should update the internal IStroke. switch (type) { case SymbolTypes.Character: newSymbol = new CharacterSymbol(); break; case SymbolTypes.Picture: newSymbol = new PictureSymbol(); break; case SymbolTypes.Simple: newSymbol = new SimpleSymbol(); break; } if (newSymbol != null) { if (_innerSymbol != null) newSymbol.CopyPlacement(_innerSymbol); } _innerSymbol = newSymbol; }