Back to Devexpress

DrawMapSegmentableItemEventArgs Class

windowsforms-devexpress-dot-xtramap-c19127cd.md

latest3.1 KB
Original Source

DrawMapSegmentableItemEventArgs Class

Contains segment data for the MapPath and MapPie vector items.

Namespace : DevExpress.XtraMap

Assembly : DevExpress.XtraMap.v25.2.dll

NuGet Package : DevExpress.Win.Map

Declaration

csharp
public class DrawMapSegmentableItemEventArgs :
    DrawMapShapeEventArgs,
    ICompositeRenderItemStyle,
    IShapeRenderItemStyle,
    IRenderItemStyle
vb
Public Class DrawMapSegmentableItemEventArgs
    Inherits DrawMapShapeEventArgs
    Implements ICompositeRenderItemStyle,
               IShapeRenderItemStyle,
               IRenderItemStyle

Remarks

Handle the MapControl.DrawMapItem event and cast its EventArgs object to the DrawMapSegmentableItemEventArgs type. The DrawMapSegmentableItemEventArgs.Segments property contains an array of the Fill, Stroke, and StrokeWidth values for MapPath or MapPie segments.

The following code sets the fill color of odd MapPie segments to red:

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].Fill = 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).Fill = Color.Red
        Next
    End If
End Sub

Inheritance

Object EventArgs MapItemEventArgs DrawMapItemEventArgs DrawMapShapeEventArgs DrawMapSegmentableItemEventArgs

See Also

DrawMapSegmentableItemEventArgs Members

DevExpress.XtraMap Namespace