Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

The following code snippet successfully draws a graphic polygon and fills it with the specified picture fill symbol. When the x values for all of the points are made negative and a repeat call to the snippet is made, the polygon is symbolized but it is not visible. However, when you grab one of the resizing grips of the polygon graphic and stretch it a little the symbolization becomes visible. Can anyone vouch for this behavior? Is this a bug with ArcGIS maybe? I'm completely baffled etc.

Dim pGC As IGraphicsContainer
pGC = pMap

Dim oPoint As IPoint

Dim pPolygon As IPointCollection
pPolygon = New Polygon

oPoint.PutCoords(150, 120)
pPolygon.AddPoint(oPoint)

oPoint = New ESRI.ArcGIS.Geometry.Point
oPoint.PutCoords(160, 120)
pPolygon.AddPoint(oPoint)

oPoint = New ESRI.ArcGIS.Geometry.Point
oPoint.PutCoords(160, 115)
pPolygon.AddPoint(oPoint)

oPoint = New ESRI.ArcGIS.Geometry.Point
oPoint.PutCoords(150, 115)
pPolygon.AddPoint(oPoint)

oPoint = New ESRI.ArcGIS.Geometry.Point
oPoint.PutCoords(150, 120)
pPolygon.AddPoint(oPoint)

Dim pElement As IElement
pElement = New PolygonElement
pElement.Geometry = pPolygon

Dim pFillShapeElement As IFillShapeElement
pFillShapeElement = pElement

Dim pPictureFillSymbol As IPictureFillSymbol
pPictureFillSymbol = New PictureFillSymbol
pPictureFillSymbol.CreateFillSymbolFromFile(esriIPictureType.esriIPictureBitmap, clsAppHelper.GetArcGISInstallDir & "styles\pictures\smallwave.bmp")

pFillShapeElement.Symbol = pPictureFillSymbol
pGC.AddElement(pElement, 0)
pMxDoc.ActiveView.Refresh()
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.