日韩性视频-久久久蜜桃-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网站免费看 | 日批视频在线免费看 | 伊人久操 | 18我禁在线观看 | 成人精品影院 | 97视频网址| jizz一区二区三区 | 色噜噜一区二区三区 | 一区二区三区在线观看视频 | 一级久久久久 | 国产色av| 欧美操穴| 欧美videos另类精品 | 18深夜在线观看免费视频 | 久热网| h片免费网站 | 亚洲久视频 | 影音先锋在线看片资源 | 在线电影一区二区 | 北京富婆泄欲对白 | 9i在线看片成人免费 | 国产精品a久久久久 | 波多野结衣av一区二区全免费观看 | 亚洲综合99| 亚洲中文字幕一区在线 | 看了下面会湿的视频 | 麻豆资源 | 成人黄色片免费看 | 精品丰满少妇一区二区三区 | 欧美精品免费在线观看 | 欧美嫩交 | 日本视频在线播放 | 中国黄色网址 | 亚洲第一视频网 | 最近最新最好看的2019 | 91春色 | 国产成人精品免费视频 | 亚洲熟妇无码av | 国产精品丝袜视频无码一区69 | 欧美色涩在线第一页 | 88xx成人永久免费观看 | 一区二区三区在线观看免费 | 黄91在线观看 | 边啃奶头边躁狠狠躁 | 一区二区日本视频 | 91精品亚洲一区 | 欧美成人福利 | 强辱丰满人妻hd中文字幕 | 中文在线亚洲 | www..com黄色 | 日韩h在线观看 | 久久影视av| 一亲二脱三插 | 久久久久久久久久久电影 | 精品动漫一区二区三区在线观看 | 韩国三级在线视频 | 四虎网址大全 | 18禁免费无码无遮挡不卡网站 | 啪啪的网站 | 精品三级视频 | 6680新视觉电影免费观看 | 影音先锋国产精品 | 亚洲图片欧美激情 | 日韩欧美一级二级 | 河北彩花av在线播放 | 性欧美一区二区三区 | 翔田千里x88aⅴ | 成人a级片 | 日韩伊人久久 | 国产成人无码性教育视频 | 嫩草嫩草嫩草嫩草嫩草 | 亚洲精品视频二区 | 亚洲天堂伊人网 | 在线观看欧美一区二区三区 | 国产三级中文字幕 | 国产十八熟妇av成人一区 | 亚洲欧美自拍偷拍 | 日韩在线激情视频 | 久久一区二区三区视频 | 中文字幕日韩一区二区 | 法国少妇愉情理伦片 | 中文字幕一区二区三区在线不卡 | 天天曰夜夜曰 | 成人av电影免费观看 | 中文字幕一区二区三区人妻在线视频 | 动漫精品一区二区三区 | 又爽又黄又无遮挡 | 牛牛影视免费观看 | av五月天在线 | 亚洲影视在线 | 手机av在线不卡 | 欧美wwwwww| 国产一区二区三区网站 | 亚洲国产精品无码观看久久 | 国产传媒一区二区三区 | 日韩一级片网站 | 美女被变态侵犯 | 亚洲精品自拍偷拍 | 日本高清免费观看 |