/// <summary> /// 闪烁地物 /// </summary> /// <param name="pMapControl"></param> /// <param name="pGeometry"></param> public static void FlashGeometry(IMapControl4 pMapControl, IGeometry pGeometry) { ICartographicLineSymbol ipCartographicLineSymbol; ISimpleFillSymbol ipSimpleFillSymbol; ISimpleMarkerSymbol ipSimpleMarkersymbol; ISymbol ipSymbol = null; IRgbColor ipColor; int Size; ipColor = new RgbColor(); ipColor.Blue = 255; Size = 2; esriGeometryType type = pGeometry.GeometryType; if (type == esriGeometryType.esriGeometryPolyline) { ipCartographicLineSymbol = new CartographicLineSymbol(); ipSymbol = (ISymbol)ipCartographicLineSymbol; ipSymbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen; ipCartographicLineSymbol.Width = Size; ipCartographicLineSymbol.Color = ipColor; ipCartographicLineSymbol.Cap = esriLineCapStyle.esriLCSRound; } else if (type == esriGeometryType.esriGeometryPolygon) { ipSimpleFillSymbol = new SimpleFillSymbol(); ipSymbol = (ISymbol)ipSimpleFillSymbol; ipSymbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen; ipColor.Red = 0; ipColor.Blue = 255; ipColor.Green = 0; ipSimpleFillSymbol.Style = esriSimpleFillStyle.esriSFSSolid; ipSimpleFillSymbol.Color = ipColor; } else if (type == esriGeometryType.esriGeometryPoint || type == esriGeometryType.esriGeometryMultipoint) { ipSimpleMarkersymbol = new SimpleMarkerSymbol(); ipSymbol = (ISymbol)ipSimpleMarkersymbol; ipSymbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen; ipSimpleMarkersymbol.Color = ipColor; ipSimpleMarkersymbol.Size = 8; } pMapControl.FlashShape(pGeometry, 2, 100, ipSymbol); }
/// <summary> /// Flashes the geometry. /// </summary> /// <param name="pMapControl">The p map control.</param> /// <param name="pFeature">The p feature.</param> public static void FlashGeometry(IMapControl4 pMapControl, IFeature pFeature) { pMapControl.Extent = pFeature.Extent; IGeometry pGeometry = pFeature.ShapeCopy as IGeometry; pMapControl.FlashShape(pGeometry, 2, 300); //IColor rgbColor = EngineAPI.GetRgbColor(0, 255, 0); //ISymbol symbol = null; //switch (pGeometry.GeometryType) //{ // case esriGeometryType.esriGeometryPoint: // case esriGeometryType.esriGeometryMultipoint: // symbol = (new SimpleMarkerSymbolClass // { // Color = rgbColor, // Size = 8.0 // } as ISymbol); // break; // case esriGeometryType.esriGeometryPolyline: // symbol = (new CartographicLineSymbolClass // { // Width = 2.0, // Color = rgbColor, // Cap = esriLineCapStyle.esriLCSRound // } as ISymbol); // break; // case esriGeometryType.esriGeometryPolygon: // symbol = (new SimpleFillSymbolClass // { // Style = esriSimpleFillStyle.esriSFSSolid, // Color = rgbColor // } as ISymbol); // break; //} //if (symbol != null) //{ // symbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen; // pMapControl.FlashShape(pGeometry, 2, 300, symbol); //} }