ColorReliefLayer Object

The ColorReliefLayer object contains the properties and methods for a color relief map created in Surfer with the Shapes method AddImageLayer or AddImageMap.

The color relief map was called an image map in Surfer 13 and earlier versions.

Derived from: Layer object, which is derived from Shape object (All methods and properties of Layer and Shape apply to this object.)

The following table provides the properties of the ColorReliefLayer object.

Property

Description

ColorMap

Returns the color map object. It is a read-only property.

ColorScale

Returns the color scale object if enabled. It is a read-only property.

Grid

Returns the grid object used to create the map. It is a read-only property.

GridFile

Returns/sets the name of the grid file used to create the map.

HillShadingHorzLightAngle

Returns or sets the horizontal light angle for the hill shading light source.

HillShadingLightIntensity

Returns or sets the ambient light intensity for the surface

HillShadingVertLightAngle

Returns or sets the vertical light angle for the hill shading light source.

HillShadingZScale

Returns or sets the hill shading Z scale factor.

HLightAngle

Returns/sets the horizontal light angle for the reflectance shading light source.

InterpolatePixels

Returns/sets the interpolate pixels state.

MissingDataColorRGBA

Returns the missing data RGBA color object. It is a read-only property.

Opacity

Returns/sets the opacity.

ReflectanceMethod

Returns/sets the method for calculating reflectance shading.

ShowColorScale

Returns/sets the show color scale state.

TerrainRepresentation

Returns/sets the terrain representation.

VLightAngle

Returns/sets the vertical light angle for the reflectance shading light source.

zScale

Returns or sets the reflectance shading Z scale factor.

Example

The following script demonstrates how the ColorReliefLayer object is used in reference to the MapFrame object.

 

Sub Main

 

'Declare the variable that will reference the application

Dim SurferApp As Object

Set SurferApp = CreateObject("Surfer.Application")

SurferApp.Visible = True

 

'Declares Plot as an object

Dim Plot As Object

Set Plot = SurferApp.Documents.Add

 

'Creates a color relief map using the default Terrain Representation of "Hill shaded"

Set MapFrame = Plot.Shapes.AddColorReliefMap(SurferApp.Path+"\samples\demogrid.grd")

Dim ColorReliefLayer As Object

Set ColorReliefLayer = MapFrame.Overlays(1)

 

'Loads a CLR file

ColorReliefLayer.ColorMap.LoadFile(FileName:=SurferApp.Path+"\samples\Rainbow.clr")

 

'Changes the colormap to an existing preset

ColorReliefLayer.ColorMap.LoadPreset("BlueGreen-OrangeRed")

 

'Reverses the colormap

ColorReliefLayer.ColorMap.Reverse

 

'Sets the interpolate pixels state

ColorReliefLayer.InterpolatePixels = True

 

'Displays the color relief map color scale

ColorReliefLayer.ShowColorScale = True

 

'Declares ContinuousColorScale as an object and sets title

Dim ContinuousColorScale As Object

Set ContinuousColorScale = ColorReliefLayer.ColorScale

ContinuousColorScale.Title = "Elevation"

 

'Set the horizontal light angle

ColorReliefLayer.HillShadingHorzLightAngle = 98.5

 

'Set the vertical light angle

ColorReliefLayer.HillShadingVertLightAngle = 37

 

'Set the z scale factor

ColorReliefLayer.HillShadingZScale = 0.05

 

'Set the ambient light intensity

ColorReliefLayer.HillShadingLightIntensity = .6

 

'Sets the color for the areas with missing or blanked data

ColorReliefLayer.MissingDataColorRGBA.Color = srfColorMagenta

ColorReliefLayer.MissingDataColorRGBA.Opacity = 57

 

'Sets the opacity for the color relief layer to 85%

ColorReliefLayer.Opacity = 85

 

'Creates a color relief map using the Terrain Representation of "Color only"

Set MapFrame2 = Plot.Shapes.AddColorReliefMap(SurferApp.Path+"\samples\demogrid.grd")

Dim ColorReliefLayer2 As Object

Set ColorReliefLayer2 = MapFrame2.Overlays(1)

ColorReliefLayer2.TerrainRepresentation = srfTerrainRepresentationColorOnly

ColorReliefLayer2.ColorMap.LoadPreset("Blue-Yellow")

ColorReliefLayer2.InterpolatePixels = False

ColorReliefLayer2.ShowColorScale = True

ColorReliefLayer2.MissingDataColorRGBA.Color = srfColorCyan

ColorReliefLayer2.MissingDataColorRGBA.Opacity = 63

 

'Creates a color relief map using the Terrain Representation of "Reflectance"

Set MapFrame3 = Plot.Shapes.AddColorReliefMap(SurferApp.Path+"\samples\demogrid.grd")

Dim ColorReliefLayer3 As Object

Set ColorReliefLayer3 = MapFrame3.Overlays(1)

Plot.Selection.DeselectAll

MapFrame3.Select

Plot.Selection.Top = 2.75

ColorReliefLayer3.TerrainRepresentation = srfTerrainRepresentationReflectance

ColorReliefLayer3.ColorMap.LoadPreset("Rainbow4")

ColorReliefLayer3.InterpolatePixels = True

ColorReliefLayer3.ShowColorScale = False

ColorReliefLayer3.ReflectanceMethod = srfReflectanceMethodLommel

ColorReliefLayer3.HLightAngle = 160

ColorReliefLayer3.VLightAngle = 35

ColorReliefLayer3.zScale = 0.04

ColorReliefLayer3.MissingDataColorRGBA.Color = srfColorRed

ColorReliefLayer3.MissingDataColorRGBA.Opacity = 82

 

End Sub