Hi Don,
below is my Code for the PointStyle.
I have reduced to the essential lines…
Public Class gisMEImagePointStyle
Inherits PointStyle
Public Sub New(theImage As GeoImage, MapUnit As GeographyUnit, ImageWorldWidth As String, ImageWorldHeight As String, ImageUnit As DistanceUnit, RotateAngle As Single, Optional RotationColumn As String = “”, Optional CodeColumn As String = “”, Optional scaleColumn As String = “”, Optional Layer As FeatureLayer = Nothing, Optional Level As String = “”, Optional offsetx As String = “”, Optional offsety As String = “”, Optional minimalScale As Integer = 0, Optional maximalScale As Integer = 0)
'Me.m_image = GeoImage
Me.m_image = theImage
Me.m_mapUnit = MapUnit
Me.m_imageWorldWidth = ImageWorldWidth
Me.m_imageWorldHeight = ImageWorldHeight
Me.m_imageUnit = ImageUnit
Me.m_rotateAngle = RotateAngle
Me.m_rotationColumn = RotationColumn
Me.m_FeatureCodeColumn = CodeColumn
Me.m_ScaleColumn = scaleColumn
Me.m_Layer = Layer
m_DrawingLevel = Level
m_offsetx = offsetx
m_offsety = offsety
End Sub
Protected Overrides Sub DrawCore(features As IEnumerable(Of ThinkGeo.MapSuite.Core.Feature), canvas As GeoCanvas, labelsInThisLayer As Collection(Of SimpleCandidate), labelsInAllLayers As Collection(Of SimpleCandidate))
Dim Scale As Single = 1
Dim width As Double = 1
Dim height As Double = 1
Dim offsetxDrawing As Double = 0
Dim offsetyDrawing As Double = 0
'Dim columnCounter As Integer = 0
Dim myColumns() As String = Nothing
For Each feature As ThinkGeo.MapSuite.Core.Feature In features
If m_imageWorldWidth <> "" Then
If IsNumeric(m_imageWorldWidth) Then
width = m_imageWorldWidth
Else
width = feature.ColumnValues(m_imageWorldWidth)
End If
End If
If m_imageWorldHeight <> "" Then
If IsNumeric(m_imageWorldHeight) Then
height = m_imageWorldHeight
Else
height = feature.ColumnValues(m_imageWorldHeight)
End If
End If
Dim imageWidthMeter As Double = Conversion.ConvertMeasureUnits(width, m_imageUnit, DistanceUnit.Meter)
Dim imageHeightMeter As Double = Conversion.ConvertMeasureUnits(height, m_imageUnit, DistanceUnit.Meter)
Dim widthSize As Single = 1
'GmGisRibbonForm is the Mainform from Application
If GmGisRibbonForm.canvasWidthMeter > 0.01 Then
widthSize = CSng((imageWidthMeter * canvas.Width) / GmGisRibbonForm.canvasWidthMeter)
Else
widthSize = imageWidthMeter * canvas.Width
End If
If widthSize < 1 Then Exit Sub
Dim heightSize As Single = 1
If GmGisRibbonForm.canvasHeightMeter > 0.01 Then
heightSize = CSng((imageHeightMeter * canvas.Height) / GmGisRibbonForm.canvasHeightMeter)
Else
heightSize = imageHeightMeter * canvas.Height
End If
Select Case feature.GetWellKnownType()
Case WellKnownType.Point, WellKnownType.Multipoint
Case Else
Exit Sub
End Select
'Column testen
m_rotateAngle = 0 ' GmGisRibbonForm.rotateProjection.Angle
If m_rotationColumn <> "" Then
Try
If IsNumeric(m_rotationColumn) Then
m_rotateAngle += m_rotationColumn
Else
m_rotateAngle += feature.ColumnValues(m_rotationColumn).ToString
End If
If Not IsNumeric(m_rotateAngle) Then '.ToString = "-1.#IND"
m_rotateAngle = 0
End If
Catch ex As Exception
m_rotateAngle = 0
End Try
End If
If m_ScaleColumn <> "" Then
Try
If IsNumeric(m_ScaleColumn) Then
Scale = m_ScaleColumn
Else
Scale = feature.ColumnValues(m_ScaleColumn)
If Not IsNumeric(Scale) Then
Scale = 1
End If
End If
Catch e As Exception
Try
Scale = feature.ColumnValues(m_ScaleColumn)
Catch ex As Exception
Scale = 1
End Try
End Try
Else
Scale = 1
End If
If m_DrawingLevel <> "" Then
If IsNumeric(m_DrawingLevel) Then
m_Level = m_DrawingLevel
Else
m_Level = feature.ColumnValues(m_DrawingLevel)
End If
Else
m_Level = Core.DrawingLevel.LevelOne
End If
If m_offsetx <> "" Then
Try
If IsNumeric(m_offsetx) Then
offsetxDrawing = m_offsetx
Else
offsetxDrawing = selectedFeature.ColumnValues(m_offsetx)
End If
Catch e As Exception
offsetxDrawing = 0
End Try
End If
If m_offsety <> "" Then
Try
If IsNumeric(m_offsety) Then
offsetyDrawing = m_offsety
Else
offsetyDrawing = selectedFeature.ColumnValues(m_offsety)
End If
Catch e As Exception
offsetyDrawing = 0
End Try
End If
Try
Select Case feature.GetWellKnownType()
Case WellKnownType.Point ', WellKnownType.Multipoint
' Call the canvas method to draw the image scaled.
Dim point As New PointShape(feature.GetWellKnownBinary())
If m_image IsNot Nothing Then
canvas.DrawWorldImage(m_image, point.X + offsetxDrawing, point.Y + offsetyDrawing, widthSize * Scale * GmGisRibbonForm.SymbolWidthScale, heightSize * Scale * GmGisRibbonForm.SymbolHeightScale, m_Level, 0, 0, m_rotateAngle)
End If
Case WellKnownType.Multipoint
' Let's make sure the features being passed in are points or multi points.
' Call the canvas method to draw the image scaled.
Dim point As PointShape
point = CType(feature.GetShape, MultipointShape).GetCenterPoint
If m_image IsNot Nothing Then
canvas.DrawWorldImage(m_image, point.X + offsetxDrawing, point.Y + offsetyDrawing, widthSize * Scale * GmGisRibbonForm.SymbolWidthScale, heightSize * Scale * GmGisRibbonForm.SymbolHeightScale, m_Level, 0, 0, m_rotateAngle)
End If
End Select
Catch e As Exception
Debug.WriteLine(m_Layer.Name)
Debug.WriteLine(e.Message)
End Try
Next
End Sub
End Class
I think there is a dependency to Transformation (World to Paper).
Regards
Hardy