ColorScale Object
The ColorScale object represents either the continuous color scale bar or the discrete color scale bar. The ColorScale object contains the title properties for color scale bars. Color scale bars can be shown or hidden by properties in the owning map object.
Derived from: Shape object (All methods and properties of Shape apply to this object.)
The following table provides the properties for the ColorScale object:
Property |
Description |
This sets/returns the title text. |
|
This sets/returns the title angle. |
|
This returns the FontFormat object for the title text. This is a read-only property. |
|
This sets/returns the title horizontal offset. |
|
This sets/returns the title vertical offset. |
|
This sets/returns the title position. |
Example 1
The following example demonstrates how the ColorScale object is used in reference to the ContourLayer object with the contours.srf sample file.
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 contour map and assigns the map coordinate system to
'the variable named "MapFrame"
Set MapFrame = Shapes.AddContourMap(GridFileName:=SurferApp.Path+"\Samples\demogrid.grd")
'Declares ContourLayer as an object
Dim ContourLayer As Object
'Assigns the contour map properties to the variable named
'"ContourLayer"
Set ContourLayer = MapFrame.Overlays(1)
'Displays the contour map color scale
ContourLayer.ShowColorScale = True
'Declares DiscreteColorScale as an object
Dim DiscreteColorScale As Object
'Assigns the color scale properties to the variable named
'DiscreteColorScale"
Set DiscreteColorScale = ContourLayer.ColorScale
End Sub
Example 2
The following example demonstrates how the ColorScale object is used in reference to the ImageLayer 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 it 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)
'Displays the color relief map color scale
ColorReliefLayer.ShowColorScale = True
'Declares ContinuousColorScale as an object
Dim ContinuousColorScale As Object
'Assigns the color scale properties to the variable named
'"ContinuousColorScale"
Set ContinuousColorScale = ColorReliefLayer.ColorScale
End Sub