AE开发第五章地图整饰与输出.ppt
文本预览下载声明
//产生一个线符号 ISimpleLineSymbol pSimpleLineSymbol; pSimpleLineSymbol.Color = getRGBColor(255, 0, 0); pSimpleLineSymbol.Width = 2; //设置填充符号属性 ISimpleFillSymbol pSimpleFillSymbol; pSimpleFillSymbol.Color = getRGBColor(255, 100, 80); pSimpleFillSymbol.Outline = pSimpleLineSymbol; pSimpleFillSymbol.Style = esriSimpleFillStyle.esriSFSSolid; //设置填充元素符号属性 IFillShapeElement pFillShapeElement; pFillShapeElement = new PolygonElementClass(); pFillShapeElement.Symbol = pSimpleFillSymbol; IElement pElement; pElement = pFillShapeElement as IElement; IPolygon pPolygon; pPolygon = axMapControl1.TrackPolygon() as IPolygon; // Object.TrackPolygon( ) 在某个对象上画个多边形; // Object.TrackRectangle ( ) 在某个对象上画个矩形; pElement.Geometry = pPolygon; pGraphicsContainer.AddElement(pElement,0); pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics,null,null); GroupElement对象(组建类) GroupElement对象可以将多个元素编为一组作为一个实体使用。如果用户需要对多个要素进行相同的操作,如同时移动多个要素的时候,可以将它们编为一组。 GroupElement类实现IGroupElement接口,它定义了操作GroupElement的方法和属性。AddElement方法:把一个元素添加到GroupElements对象中,ClearElements: 清空GroupElement中的所有元素;DeleteElement;ElementCount:返回GroupElement中的元素数目。 PictureElement对象(抽象类) 该对象有7个子类,如BmpPictureElement, GifPictureElement JpgPictureElement TifPictureElement EmfPictureElement,它们分别用于往版式视图中插入bmp, gif,Jpg, tif和emf文件。每个子类都实现的接口IPictureElement,使用它可以用于操作一个图片元素。 5.4.2 框架元素(Frame Element) 框架元素(Frame Element)包括:MapElement,MapSurrundFrame,OleFrame和TableFrame等,作为不可见的容器存在。 所有的框架元素都实现IFrameElment接口; MapFrame对象是Map的容器,用于管理Map对象;实现IMapFrame接口, CreateSurroundFrame方法:获得一个MapSurroundFrame对象。 MapSurroundFrame对象是MapSorrund的容器,是一种用于管理MapSorrund对象的框架元素,该对象包括比例尺,比例文本,指北针,图例等 ; MapSorrund对象自动与某个地图对象关联,随着地图视图的变化而变化。 MapSurroundFrame对象实现IMapSurroundFrame接口。 每个MapSurroundFrame对象都与一个MapFrame相联系,如果MapFrame被删除,与其相连的MapSurroundFrame对象都绘被删除。 框架元素FrameElement 属于 PageLayout 的附属 MapSurroun
显示全部