Making a line callout
Line callouts provide a background for text that can be linked by a line to an anchor point. The symbols used for the leader line, accent bar, and border can be changed to suit the specific needs of the application for the callout.
Do the following basic steps to create a line callout:
- Create the background fill symbol.
- Create the line symbol used as the leader line.
- Create the line symbol used as the accent bar.
- Create the callout.
See the following code example:
[VB.NET] Public Sub LineCallout()
' Create the background fill symbol.
Dim backgroundRgbColorCls As ESRI.ArcGIS.Display.IRgbColor=New ESRI.ArcGIS.Display.RgbColorClass
backgroundRgbColorCls.Red=255
Dim simpleFillSymbolCls As ESRI.ArcGIS.Display.ISimpleFillSymbol=New ESRI.ArcGIS.Display.SimpleFillSymbolClass
With simpleFillSymbolCls
.Color=backgroundRgbColorCls
.Style=ESRI.ArcGIS.Display.esriSimpleFillStyle.esriSFSSolid
End With
' Create the line symbol used as the leader line.
Dim leaderlineRgbColorCls As ESRI.ArcGIS.Display.IRgbColor=New ESRI.ArcGIS.Display.RgbColorClass
leaderlineRgbColorCls.Blue=255
Dim leaderlineSimpleLineSymbolCls As ESRI.ArcGIS.Display.ISimpleLineSymbol=New ESRI.ArcGIS.Display.SimpleLineSymbolClass
With leaderlineSimpleLineSymbolCls
.Color=leaderlineRgbColorCls
.Width=2
End With
' Create the line symbol used as the accent bar.
Dim accentbarRgbColorCls As ESRI.ArcGIS.Display.IRgbColor=New ESRI.ArcGIS.Display.RgbColorClass
accentbarRgbColorCls.Green=255
Dim accentbarSimpleLineSymbolCls As ESRI.ArcGIS.Display.ISimpleLineSymbol=New ESRI.ArcGIS.Display.SimpleLineSymbolClass
With accentbarSimpleLineSymbolCls
.Color=accentbarRgbColorCls
End With
' Create the callout.
Dim lineCalloutCls As ESRI.ArcGIS.Display.ILineCallout=New ESRI.ArcGIS.Display.LineCalloutClass
With lineCalloutCls
.Style=ESRI.ArcGIS.Display.esriLineCalloutStyle.esriLCSFourPoint
.Border=simpleFillSymbolCls
.AccentBar=accentbarSimpleLineSymbolCls
.LeaderLine=leaderlineSimpleLineSymbolCls
End With
End Sub
[C#] public void LineCallout()
{
// Create the background fill symbol.
ESRI.ArcGIS.Display.IRgbColor backgroundRgbColorCls=new
ESRI.ArcGIS.Display.RgbColorClass();
backgroundRgbColorCls.Red=255;
ESRI.ArcGIS.Display.ISimpleFillSymbol simpleFillSymbolCls=new
ESRI.ArcGIS.Display.SimpleFillSymbolClass();
simpleFillSymbolCls.Color=backgroundRgbColorCls;
simpleFillSymbolCls.Style=ESRI.ArcGIS.Display.esriSimpleFillStyle.esriSFSSolid;
// Create the line symbol used as the leader line.
ESRI.ArcGIS.Display.IRgbColor leaderlineRgbColorCls=new
ESRI.ArcGIS.Display.RgbColorClass();
leaderlineRgbColorCls.Blue=255;
ESRI.ArcGIS.Display.ISimpleLineSymbol leaderlineSimpleLineSymbolCls=new
ESRI.ArcGIS.Display.SimpleLineSymbolClass();
leaderlineSimpleLineSymbolCls.Color=leaderlineRgbColorCls;
leaderlineSimpleLineSymbolCls.Width=2;
// Create the line symbol used as the accent bar.
ESRI.ArcGIS.Display.IRgbColor accentbarRgbColorCls=new
ESRI.ArcGIS.Display.RgbColorClass();
accentbarRgbColorCls.Green=255;
ESRI.ArcGIS.Display.ISimpleLineSymbol accentbarSimpleLineSymbolCls=new
ESRI.ArcGIS.Display.SimpleLineSymbolClass();
accentbarSimpleLineSymbolCls.Color=accentbarRgbColorCls;
// Create the callout.
ESRI.ArcGIS.Display.ILineCallout lineCalloutCls=new
ESRI.ArcGIS.Display.LineCalloutClass();
lineCalloutCls.Style=ESRI.ArcGIS.Display.esriLineCalloutStyle.esriLCSFourPoint;
lineCalloutCls.Border=simpleFillSymbolCls;
lineCalloutCls.AccentBar=accentbarSimpleLineSymbolCls;
lineCalloutCls.LeaderLine=leaderlineSimpleLineSymbolCls;
}
See Also:
How to make a cartographic line symbolHow to make a character marker symbol
How to make a gradient fill symbol
How to make a line fill symbol
How to make a picture marker symbol
Creating custom symbols
Creating other kinds of custom symbols
How to make different types of colors and color ramps
Development licensing | Deployment licensing |
---|---|
ArcGIS for Desktop Basic | ArcGIS for Desktop Basic |
ArcGIS for Desktop Standard | ArcGIS for Desktop Standard |
ArcGIS for Desktop Advanced | ArcGIS for Desktop Advanced |
Engine Developer Kit | Engine |