日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Symbol对象

發布時間:2025/3/13 编程问答 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Symbol对象 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

  GIS中的離散實體有三種:點、線、面,在ArcEngine中用三種符號對應表示,分別是:MarkSymbol、LineSymbol和FillSymbol。此外還有TextSymbol用于文字標注,3DChart用來顯示餅圖等三維對象。

  所有符號都實現ISymbol和IMapLevel接口,ISymbol定義一個符號對象的基本屬性和方法,IMapLevel定義屬性可以確定符號顯示的圖層,和圖層類似,用于確定符號的疊加順序。

一、MarkerSymbol對象

  MarkerSymbol對象用于修飾點對象符號,擁有12個子類:

ClassesDescription
ArrowMarkerSymbol箭頭形式符號,箭頭的樣式只有一個:esriAMSPlain
BarChartSymbolDefines a bar chart symbol.
CharacterMarker3DSymbol (3DAnalyst)3D Character Marker Symbol component.
CharacterMarkerSymbol字符形式符號,用于將一個點要素顯示為字符狀。Characterindex屬性用來確定顯示的字符
Marker3DSymbol (3DAnalyst)3D Marker Symbol component.
MultiLayerMarkerSymbol使用多個符號進行疊加生成新符號。
PictureMarkerSymbol以圖片為背景的符號,把一個點對象的外形表示為一個位圖,可以指定Picture或者使用CreateMarkSymbolFromFile獲取一張位圖
PieChartSymbolDefines a pie chart symbol.
SimpleMarker3DSymbol (3DAnalyst)Simple 3D Marker Symbol component.
SimpleMarkerSymbol簡單類型點符號,有五種類型(esriSMSCircle、esriSMSSquare、esriSMSCross、esriSMSX和esriSMSDiamond)
StackedChartSymbolDefines a stacked chart symbol.
TextMarkerSymbol (TrackingAnalyst)

Class used to create a text marker symbol used to symbolize point geometries.

  都實現IMarkerSymbol接口,定義了Angle、Color、Size、Xoffset、Yoffset。

private void simpleMarkerSymbolToolStripMenuItem_Click(object sender, EventArgs e){ISimpleMarkerSymbol iMarkerSymbol;ISymbol iSymbol;IRgbColor iRgbColor;iMarkerSymbol = new SimpleMarkerSymbol();iMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSCircle;iRgbColor = new RgbColor();iRgbColor = getRGB(100, 100, 100);iMarkerSymbol.Color = iRgbColor;iSymbol = (ISymbol)iMarkerSymbol;iSymbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen;//Raster operation code for pixel drawingIPoint point1 = new PointClass();IPoint point2 = new PointClass();point1.PutCoords(5, 5);point2.PutCoords(5, 10);this.axMapControl1.FlashShape(point1 as IGeometry, 3, 200, iSymbol);//閃爍this.axMapControl1.FlashShape(point2);}private void arrowMarkerSymbolToolStripMenuItem_Click(object sender, EventArgs e){IArrowMarkerSymbol arrowMarkerSymbol = new ArrowMarkerSymbolClass();IRgbColor iRgbColor;iRgbColor = new RgbColor();iRgbColor = getRGB(100, 100, 100);arrowMarkerSymbol.Angle = 90;arrowMarkerSymbol.Color = iRgbColor;arrowMarkerSymbol.Length = 30;arrowMarkerSymbol.Width = 20;arrowMarkerSymbol.XOffset = 0;arrowMarkerSymbol.YOffset = 0;arrowMarkerSymbol.Style = esriArrowMarkerStyle.esriAMSPlain;IPoint point1 = new PointClass();IPoint point2 = new PointClass();point1.PutCoords(5, 5);point2.PutCoords(5, 10);this.axMapControl1.FlashShape(point1 as IGeometry, 3, 500, arrowMarkerSymbol);this.axMapControl1.FlashShape(point2 as IGeometry);}//定義字體符號private void chartMarkerSymbolToolStripMenuItem_Click(object sender, EventArgs e){ICharacterMarkerSymbol characterMarkerSymbol = new CharacterMarkerSymbol();stdole.IFontDisp fontDisp = (stdole.IFontDisp)(new stdole.StdFontClass());IRgbColor rgbColor = new RgbColor();rgbColor = getRGB(100, 100, 100);fontDisp.Name = "arial";fontDisp.Size = 12;fontDisp.Italic = true;//斜體 characterMarkerSymbol.Angle = 0;characterMarkerSymbol.CharacterIndex = 97;characterMarkerSymbol.Color = rgbColor;characterMarkerSymbol.Font = fontDisp;characterMarkerSymbol.Size = 24;characterMarkerSymbol.XOffset = 0;characterMarkerSymbol.YOffset = 0;IPoint point1 = new PointClass();IPoint point2 = new PointClass();point1.PutCoords(5, 5);point2.PutCoords(5, 10);this.axMapControl1.FlashShape(point1 as IGeometry, 3, 500, characterMarkerSymbol);this.axMapControl1.FlashShape(point2 as IGeometry);}private void pictureMarkerSmpolToolStripMenuItem_Click(object sender, EventArgs e){IRgbColor rgbColor = new RgbColorClass();IPictureMarkerSymbol pictureMarkerSymbol = new PictureMarkerSymbolClass();//string fileName = @"E:\vs2005\第五章\lesson2\lesson2\data\qq.bmp";string path = Directory.GetCurrentDirectory();string fileName = path + @"Images\00_43.gif";pictureMarkerSymbol.CreateMarkerSymbolFromFile(esriIPictureType.esriIPictureBitmap, fileName);pictureMarkerSymbol.Angle = 0;pictureMarkerSymbol.BitmapTransparencyColor = rgbColor;pictureMarkerSymbol.Size = 20;pictureMarkerSymbol.XOffset = 0;pictureMarkerSymbol.YOffset = 0;IPoint point1 = new PointClass();IPoint point2 = new PointClass();point1.PutCoords(5, 5);point2.PutCoords(5, 10);this.axMapControl1.FlashShape(point1 as IGeometry, 3, 200, pictureMarkerSymbol);this.axMapControl1.FlashShape(point2 as IGeometry);}private void multiLayerMarkerSmbolToolStripMenuItem_Click(object sender, EventArgs e){IMultiLayerMarkerSymbol multiLayerMarkerSymbol = new MultiLayerMarkerSymbolClass();IPictureMarkerSymbol pictureMarkerSymbol = new PictureMarkerSymbolClass();ICharacterMarkerSymbol characterMarkerSymbol = new CharacterMarkerSymbol();stdole.IFontDisp fontDisp = (stdole.IFontDisp)(new stdole.StdFontClass());IRgbColor rgbColor = new RgbColor();rgbColor = getRGB(0, 0, 0);fontDisp.Name = "arial";fontDisp.Size = 12;fontDisp.Italic = true;//創建字符符號characterMarkerSymbol.Angle = 0;characterMarkerSymbol.CharacterIndex = 97;characterMarkerSymbol.Color = rgbColor;characterMarkerSymbol.Font = fontDisp;characterMarkerSymbol.Size = 24;characterMarkerSymbol.XOffset = 0;characterMarkerSymbol.YOffset = 0;//創建圖片符號//string fileName = @"E:\vs2005\第五章\lesson2\lesson2\data\qq.bmp";string path = Directory.GetCurrentDirectory();string fileName = path + @"Images\00_43.gif";pictureMarkerSymbol.CreateMarkerSymbolFromFile(esriIPictureType.esriIPictureBitmap, fileName);pictureMarkerSymbol.Angle = 0;pictureMarkerSymbol.BitmapTransparencyColor = rgbColor;pictureMarkerSymbol.Size = 30;pictureMarkerSymbol.XOffset = 0;pictureMarkerSymbol.YOffset = 0;//添加圖片、字符符號到組合符號中 multiLayerMarkerSymbol.AddLayer(pictureMarkerSymbol);multiLayerMarkerSymbol.AddLayer(characterMarkerSymbol);multiLayerMarkerSymbol.Angle = 0;multiLayerMarkerSymbol.Size = 30;multiLayerMarkerSymbol.XOffset = 0;multiLayerMarkerSymbol.YOffset = 0;IPoint point1 = new PointClass();IPoint point2 = new PointClass();point1.PutCoords(5, 5);point2.PutCoords(5, 10);this.axMapControl1.FlashShape(point1 as IGeometry, 3, 200, multiLayerMarkerSymbol);this.axMapControl1.FlashShape(point2 as IGeometry);}

?

二、LineSymbol對象

  用于修飾線性幾何對象符號。Color和Width屬性為兩個唯一公共屬性。

  子類有:

ClassesDescription
CartographicLineSymbol制圖線符號,實現ICatographicLineSymbol(主要設置線符號的節點屬性,Join:設置線要素轉折處的樣式)和ILineProperties接口
HashLineSymbol離散線符號
MarkerLineSymbolA line symbol composed of repeating markers.點線符號
MultiLayerLineSymbolA line symbol that contains one or more layers.使用重疊符號方法產生新符號
PictureLineSymbolA line symbol composed of either a BMP or an EMF picture.比如火車線路符號
SimpleLine3DSymbol (3DAnalyst)Simple 3D Line Symbol component.
SimpleLineSymbol簡單線符號
TextureLineSymbol (3DAnalyst)Texture Line Symbol component.(紋理貼圖線符號)

?

private void simpleLineSymbolToolStripMenuItem_Click(object sender, EventArgs e){ISimpleLineSymbol simpleLineSymbol = new SimpleLineSymbolClass();simpleLineSymbol.Style = esriSimpleLineStyle.esriSLSDashDotDot;IPolyline polyline = new PolylineClass();IPoint point = new PointClass();point.PutCoords(1, 1);polyline.FromPoint = point;point.PutCoords(10, 10);polyline.ToPoint = point;simpleLineSymbol.Width = 10;IRgbColor rgbColor = getRGB(255, 0, 0);simpleLineSymbol.Color = rgbColor;ISymbol symbol = simpleLineSymbol as ISymbol;symbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen;IActiveView activeView = this.axMapControl1.ActiveView;//用activeView.ScreenDisplay進行畫圖activeView.ScreenDisplay.StartDrawing(activeView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache);activeView.ScreenDisplay.SetSymbol(symbol);activeView.ScreenDisplay.DrawPolyline(polyline as IGeometry);activeView.ScreenDisplay.FinishDrawing();activeView.ScreenDisplay.FinishDrawing();//釋放資源 }private void cartographicLineSymbolToolStripMenuItem_Click(object sender, EventArgs e){ICartographicLineSymbol cartographicLineSymbol = new CartographicLineSymbolClass();//制圖線符號cartographicLineSymbol.Cap = esriLineCapStyle.esriLCSButt;cartographicLineSymbol.Join = esriLineJoinStyle.esriLJSBevel;//連接方式cartographicLineSymbol.Width = 10;cartographicLineSymbol.MiterLimit = 4;//Size threshold(閾值) for showing mitered line joins. ILineProperties lineProperties;lineProperties = cartographicLineSymbol as ILineProperties;lineProperties.Offset = 0;double[] dob = new double[6];dob[0] = 0;dob[1] = 1;dob[2] = 2;dob[3] = 3;dob[4] = 4;dob[5] = 5;ITemplate template = new TemplateClass();//定義模版template.Interval = 1;for (int i = 0; i < dob.Length; i += 2){template.AddPatternElement(dob[i], dob[i + 1]);}lineProperties.Template = template;IPolyline polyline = new PolylineClass();IPoint point = new PointClass();point.PutCoords(1, 1);polyline.FromPoint = point;point.PutCoords(10, 10);polyline.ToPoint = point;IRgbColor rgbColor = getRGB(0, 255, 0);cartographicLineSymbol.Color = rgbColor;IActiveView activeView = this.axMapControl1.ActiveView;activeView.ScreenDisplay.StartDrawing(activeView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache);activeView.ScreenDisplay.SetSymbol(cartographicLineSymbol as ISymbol);activeView.ScreenDisplay.DrawPolyline(polyline as IGeometry);activeView.ScreenDisplay.FinishDrawing();activeView.ScreenDisplay.FinishDrawing();}private void multiLayerLineSymbolToolStripMenuItem_Click(object sender, EventArgs e){IMultiLayerLineSymbol multiLayerLineSymbol = new MultiLayerLineSymbolClass();ISimpleLineSymbol simpleLineSymbol = new SimpleLineSymbolClass();simpleLineSymbol.Style = esriSimpleLineStyle.esriSLSDashDotDot;simpleLineSymbol.Width = 10;IRgbColor rgbColor = getRGB(255, 0, 0);simpleLineSymbol.Color = rgbColor;ISymbol symbol = simpleLineSymbol as ISymbol;symbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen;ICartographicLineSymbol cartographicLineSymbol = new CartographicLineSymbolClass();cartographicLineSymbol.Cap = esriLineCapStyle.esriLCSButt;cartographicLineSymbol.Join = esriLineJoinStyle.esriLJSBevel;cartographicLineSymbol.Width = 10;cartographicLineSymbol.MiterLimit = 4;ILineProperties lineProperties;lineProperties = cartographicLineSymbol as ILineProperties;lineProperties.Offset = 0;double[] dob = new double[6];dob[0] = 0;dob[1] = 1;dob[2] = 2;dob[3] = 3;dob[4] = 4;dob[5] = 5;ITemplate template = new TemplateClass();template.Interval = 1;for (int i = 0; i < dob.Length; i += 2){template.AddPatternElement(dob[i], dob[i + 1]);}lineProperties.Template = template;IPolyline polyline = new PolylineClass();IPoint point = new PointClass();point.PutCoords(1, 1);polyline.FromPoint = point;point.PutCoords(10, 10);polyline.ToPoint = point;rgbColor = getRGB(0, 255, 0);cartographicLineSymbol.Color = rgbColor;multiLayerLineSymbol.AddLayer(simpleLineSymbol);multiLayerLineSymbol.AddLayer(cartographicLineSymbol);IActiveView activeView = this.axMapControl1.ActiveView;activeView.ScreenDisplay.StartDrawing(activeView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache);activeView.ScreenDisplay.SetSymbol(multiLayerLineSymbol as ISymbol);activeView.ScreenDisplay.DrawPolyline(polyline as IGeometry);activeView.ScreenDisplay.FinishDrawing();activeView.ScreenDisplay.FinishDrawing();}private void hashLineSymbolToolStripMenuItem_Click(object sender, EventArgs e){IHashLineSymbol hashLineSymbol = new HashLineSymbolClass();ILineProperties lineProperties = hashLineSymbol as ILineProperties;lineProperties.Offset = 0;double[] dob = new double[6];dob[0] = 0;dob[1] = 1;dob[2] = 2;dob[3] = 3;dob[4] = 4;dob[5] = 5;ITemplate template = new TemplateClass();template.Interval = 1;for (int i = 0; i < dob.Length; i += 2){template.AddPatternElement(dob[i], dob[i + 1]);}lineProperties.Template = template;hashLineSymbol.Width = 2;hashLineSymbol.Angle = 45;IRgbColor hashColor = new RgbColor();hashColor = getRGB(0, 0, 255);hashLineSymbol.Color = hashColor;IPolyline polyline = new PolylineClass();IPoint point = new PointClass();point.PutCoords(1, 1);polyline.FromPoint = point;point.PutCoords(10, 10);polyline.ToPoint = point;IActiveView activeView = this.axMapControl1.ActiveView;activeView.ScreenDisplay.StartDrawing(activeView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache);activeView.ScreenDisplay.SetSymbol(hashLineSymbol as ISymbol);activeView.ScreenDisplay.DrawPolyline(polyline as IGeometry);activeView.ScreenDisplay.FinishDrawing();activeView.ScreenDisplay.FinishDrawing();}//下面的沒有看private void markerLineSymbolToolStripMenuItem_Click(object sender, EventArgs e){IArrowMarkerSymbol arrowMarkerSymbol = new ArrowMarkerSymbolClass();IRgbColor rgbColor = getRGB(255, 0, 0);arrowMarkerSymbol.Color = rgbColor as IColor;arrowMarkerSymbol.Length = 10;arrowMarkerSymbol.Width = 10;arrowMarkerSymbol.Style = esriArrowMarkerStyle.esriAMSPlain;IMarkerLineSymbol markerLineSymbol = new MarkerLineSymbolClass();markerLineSymbol.MarkerSymbol = arrowMarkerSymbol;rgbColor = getRGB(0, 255, 0);markerLineSymbol.Color = rgbColor;IPolyline polyline = new PolylineClass();IPoint point = new PointClass();point.PutCoords(1, 1);polyline.FromPoint = point;point.PutCoords(10, 10);polyline.ToPoint = point;IActiveView activeView = this.axMapControl1.ActiveView;activeView.ScreenDisplay.StartDrawing(activeView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache);activeView.ScreenDisplay.SetSymbol(markerLineSymbol as ISymbol);activeView.ScreenDisplay.DrawPolyline(polyline as IGeometry);activeView.ScreenDisplay.FinishDrawing();activeView.ScreenDisplay.FinishDrawing();}private void pictureLineSymbolToolStripMenuItem_Click(object sender, EventArgs e){IPictureLineSymbol pictureLineSymbol = new PictureLineSymbolClass();//創建圖片符號//string fileName = @"E:\vs2005\第五章\lesson2\lesson2\data\qq.bmp";string path = Directory.GetCurrentDirectory();string fileName = path + @"\qq.bmp";pictureLineSymbol.CreateLineSymbolFromFile(esriIPictureType.esriIPictureBitmap, fileName);IRgbColor rgbColor = getRGB(0, 255, 0);pictureLineSymbol.Color = rgbColor;pictureLineSymbol.Offset = 0;pictureLineSymbol.Width = 10;pictureLineSymbol.Rotate = false;IPolyline polyline = new PolylineClass();IPoint point = new PointClass();point.PutCoords(1, 1);polyline.FromPoint = point;point.PutCoords(10, 10);polyline.ToPoint = point;IActiveView activeView = this.axMapControl1.ActiveView;activeView.ScreenDisplay.StartDrawing(activeView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache);activeView.ScreenDisplay.SetSymbol(pictureLineSymbol as ISymbol);activeView.ScreenDisplay.DrawPolyline(polyline as IGeometry);activeView.ScreenDisplay.FinishDrawing();activeView.ScreenDisplay.FinishDrawing();}

?

三、FillSymbol對象

  用來修飾多邊形等具有面積的幾何形體的符號對象。只定義Color和OutLine兩個屬性。

ClassesDescription
ColorRampSymbol (Carto)ESRI ColorRampSymbol for raster rendering.
ColorSymbol (Carto)ESRI ColorSymbol for raster rendering.
DotDensityFillSymbolDefines a dot density fill symbol, a data driven symbol commonly used with the DotDensityRenderer對象.
GradientFillSymbol漸變顏色填充符號,IntervalCount屬性來設置用戶所需要的顏色梯度。
LineFillSymbol線填充符號,表現為重復的線條,可以設置線的角度,偏移量和線之間的間隔距離。
MarkerFillSymbol點填充符號,使用一個Marker符號作為背景填充符號,實現了IMarkerFillSymbol和IFillProperties兩個接口
MultiLayerFillSymbol多層填充符號,使用多個填充符號進行疊加
PictureFillSymbolA fill symbol based on either a BMP or an EMF picture.
RasterRGBSymbol (Carto)ESRI RasterRGBSymbol for raster rendering.
SimpleFillSymbolA fill symbol comprised from a predefined set of styles.
TextureFillSymbol (3DAnalyst)Texture Fill Symbol component.

?

private void simpleFillSymbolToolStripMenuItem_Click(object sender, EventArgs e){//簡單填充符號ISimpleFillSymbol simpleFillSymbol = new SimpleFillSymbolClass();simpleFillSymbol.Style = esriSimpleFillStyle.esriSFSSolid;simpleFillSymbol.Color = getRGB(255, 0, 0);//創建邊線符號ISimpleLineSymbol simpleLineSymbol = new SimpleLineSymbolClass();simpleLineSymbol.Style = esriSimpleLineStyle.esriSLSDashDotDot;simpleLineSymbol.Color = getRGB(0, 255, 0);simpleLineSymbol.Width = 10;ISymbol symbol = simpleLineSymbol as ISymbol;symbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen;simpleFillSymbol.Outline = simpleLineSymbol;//創建面對象object Missing = Type.Missing;IPolygon polygon = new PolygonClass();IPointCollection pointCollection = polygon as IPointCollection;IPoint point = new PointClass();point.PutCoords(5, 5);pointCollection.AddPoint(point, ref Missing, ref Missing);point.PutCoords(5, 10);pointCollection.AddPoint(point, ref Missing, ref Missing);point.PutCoords(10, 10);pointCollection.AddPoint(point, ref Missing, ref Missing);point.PutCoords(10, 5);pointCollection.AddPoint(point, ref Missing, ref Missing);polygon.SimplifyPreserveFromTo();IActiveView activeView = this.axMapControl1.ActiveView;activeView.ScreenDisplay.StartDrawing(activeView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache);activeView.ScreenDisplay.SetSymbol(simpleFillSymbol as ISymbol);activeView.ScreenDisplay.DrawPolygon(polygon as IGeometry);activeView.ScreenDisplay.FinishDrawing();}private void lineFillSymbolToolStripMenuItem_Click(object sender, EventArgs e){ICartographicLineSymbol cartoLine = new CartographicLineSymbol();cartoLine.Cap = esriLineCapStyle.esriLCSButt;cartoLine.Join = esriLineJoinStyle.esriLJSMitre;cartoLine.Color = getRGB(255, 0, 0);cartoLine.Width = 2;//Create the LineFillSymboILineFillSymbol lineFill = new LineFillSymbol();lineFill.Angle = 45;lineFill.Separation = 10;lineFill.Offset = 5;lineFill.LineSymbol = cartoLine;object Missing = Type.Missing;IPolygon polygon = new PolygonClass();IPointCollection pointCollection = polygon as IPointCollection;IPoint point = new PointClass();point.PutCoords(5, 5);pointCollection.AddPoint(point, ref Missing, ref Missing);point.PutCoords(5, 10);pointCollection.AddPoint(point, ref Missing, ref Missing);point.PutCoords(10, 10);pointCollection.AddPoint(point, ref Missing, ref Missing);point.PutCoords(10, 5);pointCollection.AddPoint(point, ref Missing, ref Missing);polygon.SimplifyPreserveFromTo();IActiveView activeView = this.axMapControl1.ActiveView;activeView.ScreenDisplay.StartDrawing(activeView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache);activeView.ScreenDisplay.SetSymbol(lineFill as ISymbol);activeView.ScreenDisplay.DrawPolygon(polygon as IGeometry);activeView.ScreenDisplay.FinishDrawing();}private void markerFillSymbolToolStripMenuItem_Click(object sender, EventArgs e){IArrowMarkerSymbol arrowMarkerSymbol = new ArrowMarkerSymbolClass();IRgbColor rgbColor = getRGB(255, 0, 0);arrowMarkerSymbol.Color = rgbColor as IColor;arrowMarkerSymbol.Length = 10;arrowMarkerSymbol.Width = 10;arrowMarkerSymbol.Style = esriArrowMarkerStyle.esriAMSPlain;IMarkerFillSymbol markerFillSymbol = new MarkerFillSymbolClass();markerFillSymbol.MarkerSymbol = arrowMarkerSymbol;rgbColor = getRGB(0, 255, 0);markerFillSymbol.Color = rgbColor;markerFillSymbol.Style = esriMarkerFillStyle.esriMFSGrid;IFillProperties fillProperties = markerFillSymbol as IFillProperties;fillProperties.XOffset = 2;fillProperties.YOffset = 2;fillProperties.XSeparation = 15;fillProperties.YSeparation = 20;object Missing = Type.Missing;IPolygon polygon = new PolygonClass();IPointCollection pointCollection = polygon as IPointCollection;IPoint point = new PointClass();point.PutCoords(5, 5);pointCollection.AddPoint(point, ref Missing, ref Missing);point.PutCoords(5, 10);pointCollection.AddPoint(point, ref Missing, ref Missing);point.PutCoords(10, 10);pointCollection.AddPoint(point, ref Missing, ref Missing);point.PutCoords(10, 5);pointCollection.AddPoint(point, ref Missing, ref Missing);polygon.SimplifyPreserveFromTo();IActiveView activeView = this.axMapControl1.ActiveView;activeView.ScreenDisplay.StartDrawing(activeView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache);activeView.ScreenDisplay.SetSymbol(markerFillSymbol as ISymbol);activeView.ScreenDisplay.DrawPolygon(polygon as IGeometry);activeView.ScreenDisplay.FinishDrawing();}private void gradientFillSymbolToolStripMenuItem_Click(object sender, EventArgs e){IGradientFillSymbol gradientFillSymbol = new GradientFillSymbolClass();IAlgorithmicColorRamp algorithcColorRamp = new AlgorithmicColorRampClass();algorithcColorRamp.FromColor = getRGB(255, 0, 0);algorithcColorRamp.ToColor = getRGB(0, 255, 0);algorithcColorRamp.Algorithm = esriColorRampAlgorithm.esriHSVAlgorithm;gradientFillSymbol.ColorRamp = algorithcColorRamp;gradientFillSymbol.GradientAngle = 45;gradientFillSymbol.GradientPercentage = 0.9;gradientFillSymbol.Style = esriGradientFillStyle.esriGFSLinear;object Missing = Type.Missing;IPolygon polygon = new PolygonClass();IPointCollection pointCollection = polygon as IPointCollection;IPoint point = new PointClass();point.PutCoords(5, 5);pointCollection.AddPoint(point, ref Missing, ref Missing);point.PutCoords(5, 10);pointCollection.AddPoint(point, ref Missing, ref Missing);point.PutCoords(10, 10);pointCollection.AddPoint(point, ref Missing, ref Missing);point.PutCoords(10, 5);pointCollection.AddPoint(point, ref Missing, ref Missing);polygon.SimplifyPreserveFromTo();IActiveView activeView = this.axMapControl1.ActiveView;activeView.ScreenDisplay.StartDrawing(activeView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache);activeView.ScreenDisplay.SetSymbol(gradientFillSymbol as ISymbol);activeView.ScreenDisplay.DrawPolygon(polygon as IGeometry);activeView.ScreenDisplay.FinishDrawing();}private void pictureFillSymbolToolStripMenuItem_Click(object sender, EventArgs e){IPictureFillSymbol pictureFillSymbol = new PictureFillSymbolClass();//創建圖片符號//string fileName = @"E:\vs2005\第五章\lesson2\lesson2\data\qq.bmp";string path = Directory.GetCurrentDirectory();string fileName = path + @"\qq.bmp";pictureFillSymbol.CreateFillSymbolFromFile(esriIPictureType.esriIPictureBitmap, fileName);pictureFillSymbol.Color = getRGB(0, 255, 0);ISimpleLineSymbol simpleLineSymbol = new SimpleLineSymbolClass();simpleLineSymbol.Style = esriSimpleLineStyle.esriSLSDashDotDot;simpleLineSymbol.Color = getRGB(255, 0, 0);ISymbol symbol = pictureFillSymbol as ISymbol;symbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen;pictureFillSymbol.Outline = simpleLineSymbol;pictureFillSymbol.Angle = 45;object Missing = Type.Missing;IPolygon polygon = new PolygonClass();IPointCollection pointCollection = polygon as IPointCollection;IPoint point = new PointClass();point.PutCoords(5, 5);pointCollection.AddPoint(point, ref Missing, ref Missing);point.PutCoords(5, 10);pointCollection.AddPoint(point, ref Missing, ref Missing);point.PutCoords(10, 10);pointCollection.AddPoint(point, ref Missing, ref Missing);point.PutCoords(10, 5);pointCollection.AddPoint(point, ref Missing, ref Missing);polygon.SimplifyPreserveFromTo();IActiveView activeView = this.axMapControl1.ActiveView;activeView.ScreenDisplay.StartDrawing(activeView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache);activeView.ScreenDisplay.SetSymbol(pictureFillSymbol as ISymbol);activeView.ScreenDisplay.DrawPolygon(polygon as IGeometry);activeView.ScreenDisplay.FinishDrawing();}private void multilayerFillSymbolToolStripMenuItem_Click(object sender, EventArgs e){IMultiLayerFillSymbol multiLayerFillSymbol = new MultiLayerFillSymbolClass();IGradientFillSymbol gradientFillSymbol = new GradientFillSymbolClass();IAlgorithmicColorRamp algorithcColorRamp = new AlgorithmicColorRampClass();algorithcColorRamp.FromColor = getRGB(255, 0, 0);algorithcColorRamp.ToColor = getRGB(0, 255, 0);algorithcColorRamp.Algorithm = esriColorRampAlgorithm.esriHSVAlgorithm;gradientFillSymbol.ColorRamp = algorithcColorRamp;gradientFillSymbol.GradientAngle = 45;gradientFillSymbol.GradientPercentage = 0.9;gradientFillSymbol.Style = esriGradientFillStyle.esriGFSLinear;ICartographicLineSymbol cartoLine = new CartographicLineSymbol();cartoLine.Cap = esriLineCapStyle.esriLCSButt;cartoLine.Join = esriLineJoinStyle.esriLJSMitre;cartoLine.Color = getRGB(255, 0, 0);cartoLine.Width = 2;//Create the LineFillSymboILineFillSymbol lineFill = new LineFillSymbol();lineFill.Angle = 45;lineFill.Separation = 10;lineFill.Offset = 5;lineFill.LineSymbol = cartoLine;multiLayerFillSymbol.AddLayer(gradientFillSymbol);multiLayerFillSymbol.AddLayer(lineFill);object Missing = Type.Missing;IPolygon polygon = new PolygonClass();IPointCollection pointCollection = polygon as IPointCollection;IPoint point = new PointClass();point.PutCoords(5, 5);pointCollection.AddPoint(point, ref Missing, ref Missing);point.PutCoords(5, 10);pointCollection.AddPoint(point, ref Missing, ref Missing);point.PutCoords(10, 10);pointCollection.AddPoint(point, ref Missing, ref Missing);point.PutCoords(10, 5);pointCollection.AddPoint(point, ref Missing, ref Missing);polygon.SimplifyPreserveFromTo();IActiveView activeView = this.axMapControl1.ActiveView;activeView.ScreenDisplay.StartDrawing(activeView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache);activeView.ScreenDisplay.SetSymbol(multiLayerFillSymbol as ISymbol);activeView.ScreenDisplay.DrawPolygon(polygon as IGeometry);activeView.ScreenDisplay.FinishDrawing();}

?

?

?

四、TextSymbol對象

  用于修飾文字元素,實現ITextSymbol,ISimpleTextSymbol,IFormattedTextSymbol接口。

  ITextSymbol是定義文本字符對象的主要接口,通過IFontDisp接口來設置字體的大小、粗體、斜體等。

  ISimpleTextSymbol

?

?  BezierTextPath對象可以讓文字的路徑按照貝塞爾曲線設置。

  ITextPath接口提供用來計算每個字符文字路徑的位置。

  IFormattedTextSymbol接口用來設置背景對象、陰影等屬性

private void textSybmolToolStripMenuItem_Click(object sender, EventArgs e)
??????? {
??????????? ITextSymbol textSymbol = new TextSymbolClass();
??????????? System.Drawing.Font drawFont = new System.Drawing.Font("宋體", 16, FontStyle.Bold);
??????????? stdole.IFontDisp fontDisp = (stdole.IFontDisp)(new stdole.StdFontClass());
??????????? textSymbol.Font = fontDisp;
??????????? textSymbol.Color = getRGB(0, 255, 0);
??????????? textSymbol.Size = 20;
??????????? IPolyline polyline = new PolylineClass();
??????????? IPoint point = new PointClass();
??????????? point.PutCoords(1, 1);
??????????? polyline.FromPoint = point;
??????????? point.PutCoords(10, 10);
??????????? polyline.ToPoint = point;
??????????? ITextPath textPath = new BezierTextPathClass();
??????????? //創建簡單標注
??????????? ILineSymbol lineSymbol = new SimpleLineSymbolClass();
??????????? lineSymbol.Color = getRGB(255, 0, 0);
??????????? lineSymbol.Width = 5;
??????????? ISimpleTextSymbol simpleTextSymbol = textSymbol as ISimpleTextSymbol;
??????????? simpleTextSymbol.TextPath = textPath;
??????????? object oLineSymbol = lineSymbol;
??????????? object oTextSymbol = textSymbol;
??????????? IActiveView activeView = this.axMapControl1.ActiveView;
??????????? activeView.ScreenDisplay.StartDrawing(activeView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache);
??????????? activeView.ScreenDisplay.SetSymbol(oLineSymbol as ISymbol);
??????????? activeView.ScreenDisplay.DrawPolyline(polyline as IGeometry);
??????????? activeView.ScreenDisplay.SetSymbol(oTextSymbol as ISymbol);
??????????? activeView.ScreenDisplay.DrawText(polyline as IGeometry, "簡單標注"); ;
??????????? activeView.ScreenDisplay.FinishDrawing();

??????????? //創建氣泡標注(兩中風格,一種是有錨點,一種是marker方式)
??????????? //錨點方式
??????????? ISimpleFillSymbol simpleFillSymbol = new SimpleFillSymbolClass();
??????????? simpleFillSymbol.Color = getRGB(0, 255, 0);
??????????? simpleFillSymbol.Style = esriSimpleFillStyle.esriSFSSolid;
??????????? IBalloonCallout balloonCallout = new BalloonCalloutClass();
??????????? balloonCallout.Style = esriBalloonCalloutStyle.esriBCSRectangle;
??????????? balloonCallout.Symbol = simpleFillSymbol;
??????????? balloonCallout.LeaderTolerance = 10;

??????????? point.PutCoords(5, 5);
??????????? balloonCallout.AnchorPoint = point;

??????????? IGraphicsContainer graphicsContainer = activeView as IGraphicsContainer;
??????????? IFormattedTextSymbol formattedTextSymbol = new TextSymbolClass();
??????????? formattedTextSymbol.Color = getRGB(0, 0, 255);
??????????? point.PutCoords(10, 5);
??????????? ITextBackground textBackground = balloonCallout as ITextBackground;
??????????? formattedTextSymbol.Background = textBackground;
??????????? activeView.ScreenDisplay.StartDrawing(activeView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache);
??????????? activeView.ScreenDisplay.SetSymbol(formattedTextSymbol as ISymbol);
??????????? activeView.ScreenDisplay.DrawText(point as IGeometry, "氣泡1");
??????????? activeView.ScreenDisplay.FinishDrawing();


??????????? //marker方式
??????????? textSymbol = new TextSymbolClass();
??????????? textSymbol.Color = getRGB(255, 0, 0);
??????????? textSymbol.Angle = 0;
??????????? textSymbol.RightToLeft = false;
??????????? textSymbol.VerticalAlignment = esriTextVerticalAlignment.esriTVABaseline;
??????????? textSymbol.HorizontalAlignment = esriTextHorizontalAlignment.esriTHAFull;


??????????? IMarkerTextBackground markerTextBackground = new MarkerTextBackgroundClass();
??????????? markerTextBackground.ScaleToFit = true;
??????????? markerTextBackground.TextSymbol = textSymbol;

??????????? IRgbColor rgbColor = new RgbColorClass();
??????????? IPictureMarkerSymbol pictureMarkerSymbol = new PictureMarkerSymbolClass();
??????????? //string fileName = @"E:\vs2005\第五章\lesson2\lesson2\data\qq.bmp";
??????????? string path = Directory.GetCurrentDirectory();
??????????? string fileName = path + @"\qq.bmp";
??????????? pictureMarkerSymbol.CreateMarkerSymbolFromFile(esriIPictureType.esriIPictureBitmap, fileName);
??????????? pictureMarkerSymbol.Angle = 0;
??????????? pictureMarkerSymbol.BitmapTransparencyColor = rgbColor;
??????????? pictureMarkerSymbol.Size = 20;
??????????? pictureMarkerSymbol.XOffset = 0;
??????????? pictureMarkerSymbol.YOffset = 0;

??????????? markerTextBackground.Symbol = pictureMarkerSymbol as IMarkerSymbol;

??????????? formattedTextSymbol = new TextSymbolClass();
??????????? formattedTextSymbol.Color = getRGB(255, 0, 0);
??????????? fontDisp.Size = 10;
??????????? fontDisp.Bold = true;
??????????? formattedTextSymbol.Font = fontDisp;

??????????? point.PutCoords(15, 5);

??????????? formattedTextSymbol.Background = markerTextBackground;
??????????? activeView.ScreenDisplay.StartDrawing(activeView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache);
??????????? activeView.ScreenDisplay.SetSymbol(formattedTextSymbol as ISymbol);
??????????? activeView.ScreenDisplay.DrawText(point as IGeometry, "氣泡2");
??????????? activeView.ScreenDisplay.FinishDrawing();

??????? }

?五、3DChartSymbol對象

  是一個抽象類,有三個子類:BarChart(用來著色)、PieChart、StaekedChart。

  它實現多個接口:IChartSymbol、IBarChartSymbol、IPieChartSymbol和IStackedSymbol等。

  IChartSymbol接口主要用于計算一個ChartSymbol對象中的柱狀和餅狀部分的尺寸,其中Maximum值是創建3DChartSymbol對象后必須設置的一個屬性,著色一般在一個要素圖層上進行,因而可以從它的要素類中獲得一系列的數值統計值。如果有三個數值參與著色,系統則必須對三個數值進行大小比較,找出最大的那個賦值給Maximum。Value屬性用數組來設置柱狀高度或餅狀寬度。可以用ISymbolArray來管理多個參與著色的符號對象。

  BarChartSymbol對象實現IBarChartSymbol接口,用不同類型的柱子代表一個要素中的不同屬性,高度取決于屬性值得大小。

  PieChartSymbol對象實現IPieChartSymbol接口,用一個餅圖來顯示一個要素中的不同屬性,不同屬性按照他們的數值大小,占有不同比例的扇形區域。

  StackedSymbol對象實現IStackedSymbol接口,堆積的柱子表示一個要素中的不同屬性,Fixed屬性為true時,每個柱子的高度都一樣,false時,柱子尺寸根據要素類的屬性來計算得出。

轉載于:https://www.cnblogs.com/jerfer/archive/2012/08/07/2626180.html

與50位技術專家面對面20年技術見證,附贈技術全景圖

總結

以上是生活随笔為你收集整理的Symbol对象的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 奇米影视狠狠 | 蜜臀av一区二区三区激情综合 | 欧美操女人 | 一区二区在线视频观看 | 中国少妇初尝黑人巨大 | 天堂中文视频在线 | 亚洲一级视频在线观看 | 欧洲av在线播放 | 国产日韩欧美另类 | 青青草手机在线观看 | 成人激情文学 | 中文有码一区 | 精品国产无码在线观看 | 欧美日韩免费观看一区=区三区 | 怡红院av久久久久久久 | 快播色图 | 欧美18一19性内谢 | 欧美片网站免费 | 日韩欧美小视频 | 后进极品白嫩翘臀在线视频 | 国产又大又黄视频 | www九九九 | 亚欧中文字幕 | 亚洲国产片 | 一二三区在线 | 日韩三级黄色 | 国产网红在线观看 | japan粗暴video蹂躏 | 一级理论片 | 精品伦理一区二区 | 中文字幕亚洲色图 | 在线观看免费日韩av | 亚洲视频在线看 | 91精品国产aⅴ一区二区 | 精品人妻一区二区三区久久嗨 | 国产精品不卡在线 | 欧美色图12p | 一级成人av | 亚洲av永久无码精品三区在线 | 免费福利av | 亚洲第一av | 亚洲一级免费毛片 | 国产青青视频 | 无码黑人精品一区二区 | 91刺激| 在线观看国产亚洲 | 国产av日韩一区二区三区精品 | 国产精欧美一区二区三区白种人 | 精品久久无码中文字幕 | www.com亚洲| 性欧美高清| 中文字幕亚洲综合 | 亚洲国产二区 | 九九色在线 | 日日干日日射 | 一级做a爱视频 | www男人的天堂| 国产欧美一区二区 | 日本寂寞少妇 | sm在线观看| 男人撒尿视频xvideos | 国产三区在线成人av | 嫩草视频在线观看 | 国产精品电影 | 操你啦影院 | 少妇被躁爽到高潮无码人狍大战 | 日日日干干干 | 两性视频久久 | 午夜影院一区二区三区 | 亚洲天堂成人在线 | 三级网站在线免费观看 | 永久免费看片 | 亚洲国产aⅴ精品一区二区 日韩黄色在线视频 | av资源首页 | 激情四射网| 相亲对象是问题学生在线观看 | 神马电影久久 | 国产精品无码专区 | 美女屁股网站 | 欧美××××黑人××性爽 | 欧美另类老妇 | 欧美aaa大片 | 国产精品国产三级国产aⅴ下载 | 日批在线 | 欧美精品黄色 | 91在线观看视频 | 国产又爽又猛又粗的视频a片 | 国产熟妇一区二区三区aⅴ网站 | 免看一级a毛片一片成人不卡 | 久久在线精品视频 | av在线官网 | 狠狠爱天天干 | 婷婷资源网 | 天堂欧美 | 日本裸体网站 | 国产精品18久久久久久vr下载 | 俺也去av| 人妖性做爰aaaa| 91国在线 |