Back to Devexpress

DrawMapSegmentEventArgs.Stroke Property

windowsforms-devexpress-dot-xtramap-dot-drawmapsegmenteventargs-c84d178f.md

latest1.9 KB
Original Source

DrawMapSegmentEventArgs.Stroke Property

Gets or sets the segment outline color.

Namespace : DevExpress.XtraMap

Assembly : DevExpress.XtraMap.v25.2.dll

NuGet Package : DevExpress.Win.Map

Declaration

csharp
public Color Stroke { get; set; }
vb
Public Property Stroke As Color

Property Value

TypeDescription
Color

The segment outline color.

|

Remarks

The following code sets the outline color and width of odd MapPie segments:

csharp
private void mapControl1_DrawMapItem(object sender, DrawMapItemEventArgs e) {  
  if(e.Item is MapPie) {  
    DrawMapSegmentableItemEventArgs args = (DrawMapSegmentableItemEventArgs)e;  
    for(int i = 1; i < args.Segments.Length; i += 2){  
       args.Segments[i].StrokeWidth = 2;
       args.Segments[i].Stroke = Color.Red;  
    }
  }  
}
vb
Private Sub mapControl1_DrawMapItem(ByVal sender As Object, ByVal e As DrawMapItemEventArgs)
    If TypeOf e.Item Is MapPie Then
        Dim args As DrawMapSegmentableItemEventArgs = CType(e, DrawMapSegmentableItemEventArgs)
        For i As Integer = 1 To args.Segments.Length - 1
            args.Segments[i].StrokeWidth = 2
            args.Segments(i).Stroke = Color.Red
        Next
    End If
End Sub

See Also

DrawMapSegmentEventArgs Class

DrawMapSegmentEventArgs Members

DevExpress.XtraMap Namespace