Using AE to create a bubble prompt box-VB. Net source code

Source: Internet
Author: User
Tags ipoint

Using AE to create a bubble prompt box-VB. Net source code

Address: http://www.cnblogs.com/wall/archive/2008/07/17/1244942.html

''' <Summary>

''' Create a text prompt box

''' </Summary>

''' <Param name = "x"> the X coordinate of the position marked by the prompt box </param>

''' <Param name = "y"> Y coordinate of the position marked by the prompt box </param>

''' <Param name = "pTextString"> text displayed in the prompt box </param>

''' <Param name = "pPoint"> point pointed by the arrow in the prompt box </param>

''' <Param name = "pGraphicsContainer"> graphicscontainer containing the prompt box </param>

''' <Returns> </returns>

''' <Remarks> </remarks>

Public Function
CreateTextElement (ByVal x As Double, ByVal y As Double, ByVal
PTextString As String, Optional ByVal pPoint As IPoint = Nothing,
Optional ByVal pGraphicsContainer As IGraphicsContainer = Nothing)
IElement

Dim pElement As IElement = New MarkerElementClass ()

Dim pTElement As IElement = New TextElementClass ()

Dim pTextSymbol As IFormattedTextSymbol = New TextSymbolClass ()

Dim pBalloonCallout As IBalloonCallout = CreateBalloonCallout (x, y)

Dim pColor As IRgbColor = New RgbColorClass ()

PColor. red= 150

PColor. Green = 0

PColor. Blue = 0

PTextSymbol. Color = pColor

Dim pTextBackground As ITextBackground

PTextBackground = pBalloonCallout

PTextSymbol. Background = pTextBackground

PTextSymbol. Size = 8

CType (pTElement, ITextElement). Symbol = pTextSymbol

CType (pTElement, ITextElement). Text = pTextString

If pPoint Is Nothing Then pPoint = New Point: pPoint. PutCoords (x + Const_Dis, y + Const_Dis)

PTElement. Geometry = pPoint

PGraphicsContainer. AddElement (pTElement, 1)

Return pTElement

End Function

''' <Summary>

''' Create a balloon prompt box

''' </Summary>

''' <Param name = "x"> X coordinate of the position of the prompt box </param>

''' <Param name = "y"> Y coordinate of the prompt box </param>

''' <Returns> </returns>

''' <Remarks> </remarks>

Public Function CreateBalloonCallout (ByVal x As Double, ByVal y As Double) As IBalloonCallout

Dim pRgbClr As IRgbColor = New RgbColorClass ()

PRgbClr. red= 255

PRgbClr. Blue = 255

PRgbClr. green= 255

Dim pSmplFill As ISimpleFillSymbol = New SimpleFillSymbolClass ()

PSmplFill. Color = pRgbClr

PSmplFill. Style = esriSimpleFillStyle. esriSFSSolid

Dim pBllnCallout As IBalloonCallout = New BalloonCalloutClass ()

PBllnCallout. Style = esriBalloonCalloutStyle. esriBCSRoundedRectangle

PBllnCallout. Symbol = pSmplFill

PBllnCallout. LeaderTolerance = 1

Dim pPoint As IPoint = New ESRI. ArcGIS. Geometry. PointClass ()

PPoint. X = x

PPoint. Y = y

PBllnCallout. AnchorPoint = pPoint

Return pBllnCallout

End Function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.