Hello,
I try to display a CustomStyle, format ValueStyle, in the Legend Adorment Layer (Community Code).
I manage to loop through the items in ValueStyle (DrawLegend), but I have problems to properly align each item.
Someone already working on this subject?
Thank you.
legendBitmap = New Bitmap(CInt(m_legendIconWidth), CInt(m_legendIconHeight))
legendCanvas.BeginDrawing(legendBitmap, New RectangleShape(0, m_legendIconWidth, m_legendIconHeight, 0), GeographyUnit.Meter)
layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.DrawSample(legendCanvas)
layer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle.DrawSample(legendCanvas)
layer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.DrawSample(legendCanvas)
For i As Integer = 0 To layer.ZoomLevelSet.ZoomLevel01.CustomStyles.Count - 1
Dim customStyle As Style = layer.ZoomLevelSet.ZoomLevel01.CustomStyles(i)
Dim valueStyle As ValueStyle = TryCast(customStyle, ValueStyle)
If valueStyle IsNot Nothing Then
For j As Integer = 0 To valueStyle.ValueItems.Count - 1
<<< Calculate the x offset and y offset >>>
valueStyle.DrawSample(legendCanvas)
Next
Else
customStyle.DrawSample(legendCanvas)
End If
Next