User Tools

Site Tools


api:dk11:delphi:gislayerpixel.tgis_layerpixel.generaterampex_double_double_tgis_colormaparray_tgis_paramssectionpixel

Table of Contents

TGIS_LayerPixel.GenerateRampEx(Double; Double; TGIS_ColorMapArray; TGIS_ParamsSectionPixel) method

DK for Delphi | GisLayerPixel.TGIS_LayerPixel.GenerateRampEx | Overloads | Constructors | Fields | Methods | Properties | Events

Generates a grid ramp from a mapped color array.

Available also on: .NET | Java | ActiveX | Python.

Syntax

// Delphi
public
  procedure GenerateRampEx(
    const _minValue : Double;
    const _maxValue : Double;
    const _colorMap : TGIS_ColorMapArray;
    const _params : TGIS_ParamsSectionPixel
  ); overload;
// C++ Builder
public:
  void GenerateRampEx(
    const double _minValue,
    const double _maxValue,
    TGIS_ColorMapArray* const _colorMap,
    TGIS_ParamsSectionPixel* const _params
  ) /* overload */;

Parameters

Name Type Description
_minValue Double minimum value
_maxValue Double maximum value
_colorMap TGIS_ColorMapArray mapped color array
_params TGIS_ParamsSectionPixel parameters to be altered, if nil then a layer parameters will be altered

Example

Below are a few Python examples of how to apply a specified color ramp to a grid layer.

// pseudocode
min_value = grid_layer.MinHeight
max_value = grid_layer.MaxHeight
 
// default representation of 'ElevationDark' color ramp
color_ramp = TGIS_Utils.GisColorRampList.ByName(TGIS_ColorRampNames.ElevationDark)
color_map = color_ramp.RealizeColorMap(TGIS_ColorMapMode.Continuous, 0, false )
grid_layer.GenerateRampEx(min_value, max_value, color_map, nil)
 
// discrete representation of 'Accent' color ramp with maximum number of colors
color_ramp = TGIS_Utils.GisColorRampList.ByName(TGIS_ColorRampNames.Accent)
color_map = color_ramp.RealizeColorMap(TGIS_ColorMapMode.Discrete, -1, false)
grid_layer.GenerateRampEx(min_value, max_value, color_map, nil)
 
// reversed continuous representation of 'Spectral' color ramp, get subclass with 3 colors
color_ramp = TGIS_Utils.GisColorRampList.ByName(TGIS_ColorRampNames.Spectral)
color_map = color_ramp.RealizeColorMap(TGIS_ColorMapMode.Continuous, 3, true)
grid_layer.GenerateRampEx(min_value, max_value, color_map, nil)
2025/03/12 17:32

Page Tools