Drawing points differently

Mar 8, 2012 at 10:42 PM

Hey all, I am trying to draw each point in a shapefile using a different color, size and shape based on a user's setting and not the shapefile's data.  I don't see how I can use the new defaultdrawingoptions and categories to do this.  I have been using 4.8.1 for a while now and it seems to work well with one small catch.  I am using the deprecated set_layerpointcolor,size,shape.  I also need to decide the way to draw it as soon as the user creates a new point.  Right now my only solution is to loop through each shape every time the user adds a new point add draw them accordingly using this code:


    Public Sub AddPoint(ByRef Index As Integer, ByRef Color As String, ByRef MySize As Short, ByRef Shape As String, ByRef handle_Renamed As Short, ByVal MUTCDCode As String)

            Dim MyColor As System.Drawing.Color
            Dim MyShape As String

            Select Case Color
                Case "Green"
                    MyColor = System.Drawing.ColorTranslator.FromOle(&HC000)
                Case "Light Blue"
                    MyColor = System.Drawing.ColorTranslator.FromOle(&HFFFF80)
                Case "Dark Blue"
                    MyColor = System.Drawing.ColorTranslator.FromOle(&HFF0000)
                Case "Purple"
                    MyColor = System.Drawing.ColorTranslator.FromOle(&HC000C0)
                Case "Grey"
                    MyColor = System.Drawing.ColorTranslator.FromOle(&HC0C0C0)
                Case "Yellow"
                    MyColor = System.Drawing.ColorTranslator.FromOle(&HFFFF)
                Case "Red"
                    MyColor = System.Drawing.ColorTranslator.FromOle(&HFF)
                Case "Black"
                    MyColor = System.Drawing.ColorTranslator.FromOle(&H0)
            End Select

            Select Case Shape
                Case "Circle"
                    MyShape = CStr(MapWinGIS.tkPointType.ptCircle)
                Case "Diamond"
                    MyShape = CStr(MapWinGIS.tkPointType.ptDiamond)
                Case "Square"
                    MyShape = CStr(MapWinGIS.tkPointType.ptSquare)
                Case "Triangle Up"
                    MyShape = CStr(MapWinGIS.tkPointType.ptTriangleUp)
                Case "Triangle Down"
                    MyShape = CStr(MapWinGIS.tkPointType.ptTriangleDown)
                Case "Triangle Left"
                    MyShape = CStr(MapWinGIS.tkPointType.ptTriangleLeft)
                Case "Triangle Right"
                    MyShape = CStr(MapWinGIS.tkPointType.ptTriangleRight)
            End Select

            Dim col As UInteger
            col = System.Drawing.ColorTranslator.ToOle(MyColor)
            Map1.set_ShapePointColor(handle_Renamed, Index, col)
            Map1.set_ShapePointSize(handle_Renamed, Index, MySize)
            Map1.set_ShapePointType(handle_Renamed, Index, MyShape)

    End Sub


This works but takes a long time especially as the shapefile grows.

Ideally I'd like to only call this sub on the newest point added.  However, doing so turns all previous points to small, black squares (presumably the default shape in 4.8.1).

Any ideas?