ColorNode Object
The ColorNode object contains the properties of a color spectrum node in a given ColorMap.
Following table provides the properties of the ColorNode object:
Property |
Description |
Returns the application object. It is a read-only property. |
|
Returns the RGBA color object. It is a read-only property. |
|
Returns the parent object. It is a read-only property. |
|
Returns/sets the color node position. |
Example
The following script demonstrates how the ColorNode object is used in reference to the ColorMap object.
Sub Main
'Declares SurferApp as an object
Dim SurferApp As Object
'Creates an instance of the Surfer Application object and assigns it
'to the variable named "SurferApp"
Set SurferApp = CreateObject("Surfer.Application")
'Makes Surfer visible
SurferApp.Visible = True
'Declares Plot as an object
Dim Plot As Object
'Creates a plot document in Surfer and assigns it to the variable
'named "Plot"
Set Plot = SurferApp.Documents.Add(srfDocPlot)
'Declares Shapes as an object
Dim Shapes As Object
'Assigns the Shapes collection to the variable named "Shapes"
Set Shapes = Plot.Shapes
'Declares MapFrame as an object
Dim MapFrame As Object
'Creates a color relief map and assigns the map coordinate system to the
'variable named "MapFrame"
Set MapFrame = Shapes.AddColorReliefMap(GridFileName:=SurferApp.Path+"\Samples\demogrid.grd")
'Declares ColorReliefLayer as an object
Dim ColorReliefLayer As Object
'Assigns the color relief map properties to the variable named "ColorReliefLayer"
Set ColorReliefLayer = MapFrame.Overlays(1)
'Declares ColorMap as an object
Dim ColorMap As Object
'Assigns the color spectrum properties to the variable named
'"ColorMap"
Set ColorMap = ColorReliefLayer.ColorMap
'Assigns the color spectrum properties to the variable named
'"ColorMap"
Set ColorMap = ColorReliefLayer.ColorMap
'Declares ColorNodes as an object
Dim ColorNodes As Object
'Assigns the ColorNodes collection to the variable named
'"ColorNodes"
Set ColorNodes = ColorMap.ColorNodes
'Declares Node1 as an object
Dim Node1 As Object
'Assigns the first color node in the ColorNodes collection to the
' variable named "ColorNodes"
Set Node1 = ColorNodes(1)
End Sub