zoukankan      html  css  js  c++  java
  • ArcEngine 绘图

    画点 [C#] public void OnMouseDown(int Button, int Shift, int X, int Y) { IMxDocument mxDoc = m_App.Document as IMxDocument; IActiveView activeView = mxDoc.FocusMap as IActiveView; IScreenDisplay screenDisplay = activeView.ScreenDisplay; screenDisplay.StartDrawing(screenDisplay.hDC, (short)  esriScreenCache.esriNoScreenCache); screenDisplay.SetSymbol(new SimpleMarkerSymbolClass()); screenDisplay.DrawPoint(mxDoc.CurrentLocation); screenDisplay.FinishDrawing(); } 画线 public void OnMouseDown(int Button, int Shift, int X, int Y) { IMxDocument mxDoc = m_App.Document as IMxDocument; IActiveView activeView = mxDoc.FocusMap as IActiveView; IScreenDisplay screenDisplay = activeView.ScreenDisplay; ISimpleLineSymbol lineSymbol = new SimpleLineSymbolClass(); IRgbColor rgbColor = new RgbColorClass(); rgbColor.Red = 255; lineSymbol.Color = rgbColor; IRubberBand rubberLine = new RubberLineClass(); IPolyline newPolyline = (IPolyline)rubberLine.TrackNew(screenDisplay, (ISymbol)lineSymbol); screenDisplay.StartDrawing(screenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache); screenDisplay.SetSymbol((ISymbol)lineSymbol); screenDisplay.DrawPolyline(newPolyline); screenDisplay.FinishDrawing(); } 画线2 { ICartographicLineSymbol pCartoLineSyl; pCartoLineSyl = new CartographicLineSymbolClass(); pCartoLineSyl.Color = getRGB(255, 110, 210); pCartoLineSyl.Cap = esriLineCapStyle.esriLCSButt; pCartoLineSyl.Join = esriLineJoinStyle.esriLJSBevel; pCartoLineSyl.Width=4; pCartoLineSyl.MiterLimit=4; ILineProperties pLinePro ; pLinePro = pCartoLineSyl as ILineProperties;//取地址 ISimpleLineDecorationElement pSimpleLineDecoEle; pSimpleLineDecoEle = new SimpleLineDecorationElementClass(); pSimpleLineDecoEle.FlipAll = true; pSimpleLineDecoEle.FlipFirst = true; ILineDecoration pLineDeco; pLineDeco = new LineDecorationClass(); pLineDeco.AddElement(pSimpleLineDecoEle); pLinePro.LineDecoration = pLineDeco; pLinePro.DecorationOnTop=true; IGeometry pGeo; pGeo = axMapControl2.TrackLine(); object oLineSymbol = pCartoLineSyl; axMapControl2.DrawShape(pGeo, ref oLineSymbol); } 画线3 private void axMapControl2_OnMouseDown(object sender, AxESRI.ArcGIS.MapControl.IMapControlEvents2_OnMouseDownEvent e) { //                        ISimpleLineSymbol pLineSyl; //                                pLineSyl = new SimpleLineSymbolClass(); //                                pLineSyl.Color = getRGB(30, 60, 90); //                                pLineSyl.Width = 4; //                                pLineSyl.Style = esriSimpleLineStyle.esriSLSDashDot; ICartographicLineSymbol pCartoLineSyl; pCartoLineSyl = new CartographicLineSymbolClass(); //pCartoLineSyl.Color = getRGB(255, 110, 210); pCartoLineSyl.Cap = esriLineCapStyle.esriLCSButt; pCartoLineSyl.Join = esriLineJoinStyle.esriLJSBevel; pCartoLineSyl.Width=10; pCartoLineSyl.MiterLimit=4; ILineProperties pLinePro ; pLinePro = pCartoLineSyl as ILineProperties;//取地址 ISimpleLineDecorationElement pSimpleLineDecoEle; pSimpleLineDecoEle = new SimpleLineDecorationElementClass(); pSimpleLineDecoEle.FlipAll = true; pSimpleLineDecoEle.FlipFirst = true; ILineDecoration pLineDeco; pLineDeco = new LineDecorationClass(); pLineDeco.AddElement(pSimpleLineDecoEle); pLinePro.LineDecoration = pLineDeco; pLinePro.DecorationOnTop=true; ILineFillSymbol pLineFillSymbol =new LineFillSymbolClass(); pLineFillSymbol.Offset=3; pLineFillSymbol.Angle=45; pLineFillSymbol.Offset=10; IFillSymbol pFillSymbol =pLineFillSymbol as IFillSymbol; pFillSymbol.Color=getRGB(0,0,200); pFillSymbol.Outline=pCartoLineSyl; ICharacterMarkerSymbol pCharacterMarkerSymbol; pCharacterMarkerSymbol = new CharacterMarkerSymbolClass(); //设置它的字符,114为‘r’ pCharacterMarkerSymbol.CharacterIndex = 114; IMarkerFillSymbol pMarkerFillSymbol =new MarkerFillSymbolClass(); pMarkerFillSymbol.Outline=pCartoLineSyl; pMarkerFillSymbol.Style=esriMarkerFillStyle.esriMFSRandom; pMarkerFillSymbol.MarkerSymbol=pCharacterMarkerSymbol; pMarkerFillSymbol.GridAngle=45; pMarkerFillSymbol.Color=getRGB(0,255,255); IGeometry pGeo; pGeo = axMapControl2.TrackLine(); object oLineSymbol = pCartoLineSyl; axMapControl2.DrawShape(pGeo, ref oLineSymbol); } 画面 public void OnMouseDown(int Button, int Shift, int X, int Y) { IMxDocument mxDoc = m_App.Document as IMxDocument; IActiveView activeView = mxDoc.FocusMap as IActiveView; IScreenDisplay screenDisplay = activeView.ScreenDisplay; ISimpleFillSymbol fillSymbol = new SimpleFillSymbolClass(); IRgbColor rgbColor = new RgbColorClass(); rgbColor.Red = 255; fillSymbol.Color = rgbColor; IRubberBand rubberPolygon = new RubberPolygonClass(); IPolygon newPolygon = (IPolygon)rubberPolygon.TrackNew(screenDisplay, (ISymbol)fillSymbol); screenDisplay.StartDrawing(screenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache); screenDisplay.SetSymbol((ISymbol)fillSymbol); screenDisplay.DrawPolygon(newPolygon); screenDisplay.FinishDrawing(); } 画矩形 public void OnMouseDown(int Button, int Shift, int X, int Y) { IMxDocument mxDoc = m_App.Document as IMxDocument; IActiveView activeView = mxDoc.FocusMap as IActiveView; IScreenDisplay screenDisplay = activeView.ScreenDisplay; ISimpleFillSymbol fillSymbol = new SimpleFillSymbolClass(); IRgbColor rgbColor = new RgbColorClass(); rgbColor.Red = 255; fillSymbol.Color = rgbColor; IRubberBand rubberEnv = new RubberEnvelopeClass(); IEnvelope newEnvelope = (IEnvelope)rubberEnv.TrackNew(screenDisplay, (ISymbol)fillSymbol); screenDisplay.StartDrawing(screenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache); screenDisplay.SetSymbol((ISymbol)fillSymbol); screenDisplay.DrawRectangle(newEnvelope); screenDisplay.FinishDrawing(); }
  • 相关阅读:
    Oracle Linux 6.1 说明
    Oracle Golden Gate 系列 小结
    Oracle 执行计划 提示 'PLAN_TABLE' is old version 解决方法
    Oracle 聚合函数(Aggregate Functions)说明
    Oracle 11g 行列互换 pivot 和 unpivot 说明
    Oracle 聚合函数(Aggregate Functions)说明
    MySQL 数据文件 说明
    MySQL 启动故障 处理 小记
    Oracle Validated Configurations 安装使用 说明
    Oracle DBMS_STATS 包 和 Analyze 命令的区别
  • 原文地址:https://www.cnblogs.com/adodo1/p/4327289.html
Copyright © 2011-2022 走看看