天天看點

MapXtreme開發經驗分享-使用LegacyText生成文本注記

    LegacyText 繼承于FeatureGeometry,可用于建立Feature。代碼如下:

    Private m_table As MapInfo.Data.Table

    Dim converter As MapInfo.Geometry.DisplayTransform = Me.MapControl1.Map.DisplayTransform

       Dim MapPointText As New MapInfo.Geometry.DPoint()

            converter.FromDisplay(PointF, MapPointText)

            Dim rect As MapInfo.Geometry.DRect = New MapInfo.Geometry.DRect(MapPointText.x, MapPointText.y, MapPointText.x + 0.06, MapPointText.y + 0.06)

        Dim txt As MapInfo.Geometry.LegacyText

            txt = New MapInfo.Geometry.LegacyText(MapControl1.Map.GetDisplayCoordSys(), rect, Angle, Text)

            f = New Feature(txt, Nothing)

            m_table.InsertFeature(f)