Hi,
What I'm trying to achieve is placing a call out text with anchor point is the polygon centroid. I got that done. However for the callout part, I don't know how to make it appear about 1/2 an inch away from the point (polygon's centroid) on the screen.
Any help is greatly appreciated.
pArea = pFeature.Shape
pPointAnchor = pArea.Centroid
pPointText = ??????
Dim pCallout As ICallout
pCallout = New BalloonCallout
pCallout.AnchorPoint = pPointAnchor
Dim pElement As IElement
pElement = pTextElement
Dim pTextSymbol As IFormattedTextSymbol
pTextSymbol = New TextSymbol
pTextSymbol.Background = pCallout
pTextSymbol.Color = pColor
pTextSymbol.Font = pFontDisp
pTextElement.Symbol = pTextSymbol
pElement.Geometry = pPointText
pGraphicsContainer.AddElement(pElement, 0)
pGraphicsContainer.AddElement(pointElement, 0)
Hi Helen,
You can reach this using ITransform2D.Move Method it will move your element dx units horizontally and dy units vertically.
The code should be like the following before you add your element to graphics container
:
Dim transform2d As ITransform2D = CType(pElement, ITransform2D) 'move your element by dX and dY in map units transform2d.Move(dX, dY)