Actually I am struggle this issue for quick a few days. What I want to develop is to draw a transparent polygon on the map, after that perform a spatial query (get polylines on a layer intersect the polygon drawn). I follow the examples from ESRI and several experts from internet, but still cannot make it work.
The first step, draw a transparent polygon on map, I followed the bellowing "Draw Polygon Snippet" from ESRI website, but the strange thing is the start point of the polygon always at the top of the map:
Public Sub DrawPolygon(ByVal activeView As ESRI.ArcGIS.Carto.IActiveView)
If activeView Is Nothing Then
Dim screenDisplay As ESRI.ArcGIS.Display.IScreenDisplay = activeView.ScreenDisplay
Dim rgbColor As ESRI.ArcGIS.Display.IRgbColor = New ESRI.ArcGIS.Display.RgbColorClass
rgbColor.Red = 255
Dim color As ESRI.ArcGIS.Display.IColor = rgbColor ' Implicit Cast
Dim simpleFillSymbol As ESRI.ArcGIS.Display.ISimpleFillSymbol = New ESRI.ArcGIS.Display.SimpleFillSymbolClass
simpleFillSymbol.Color = color
Dim symbol As ESRI.ArcGIS.Display.ISymbol = TryCast(simpleFillSymbol, ESRI.ArcGIS.Display.ISymbol) ' Dynamic Cast
Dim rubberBand As ESRI.ArcGIS.Display.IRubberBand = New ESRI.ArcGIS.Display.RubberPolygonClass
Dim geometry As ESRI.ArcGIS.Geometry.IGeometry = rubberBand.TrackNew(screenDisplay, symbol)
And how to select all the features (in a polyline layer) intersect the polygon? All the steps will be perform after clicking a button.
Can anybody kindly give me advice? Thanks.