Stretch renderer

This sample demonstrates how to use stretch renderer on a raster layer.

Apply a stretch renderer to a raster layer


Choose a stretch renderer type from the dropdown listbox to change the settings for the stretch renderer. The sample allows you to change the stretch type and the parameters for each type. Click/tap the 'Update Renderer' button to update the raster. Experiment with settings for the various types for stretch parameters. For example, setting the renderer to use stretch parameters: Min Max with a min value of 50 and a max value of 200 will stretch between these pixel values. A higher min value will remove more of the lighter pixels values whilst a lower max will remove more of the darker. Percent Clip with a min value of 2 and a max value of 98 will stretch from 2% to 98% of the pixel values histogram. A lower min and higher max percentage will render using more of the original raster histogram. Standard Deviation with a factor of 2.0 will stretch 2 standard deviations from the mean. A higher factor (further from the mean) will render using more of the original raster histogram.


<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns=""
             Title="Stretch renderer">
            <RowDefinition Height="40"/>
            <RowDefinition Height="100" />
            <RowDefinition Height="40" />
            <RowDefinition Height="40"/>
            <RowDefinition Height="40"/>
            <RowDefinition Height="*" />
        <Label Grid.Row="0">Choose a stretch renderer type from the listbox, adjust the parameter values, then click the 'Update Renderer' button.</Label>
        <ListView Grid.Row="1" x:Name="RendererTypes" ItemSelected="RendererTypes_SelectionChanged"/>
        <StackLayout Orientation="Horizontal" Grid.Row="2">
            <Label x:Name="Label_Parameter1" Text="Parameter1" />
            <Entry x:Name="Input_Parameter1" Text="EnterValue1" />
        <StackLayout Orientation="Horizontal" Grid.Row="3">
            <Label x:Name="Label_Parameter2" Text="Parameter2" />
            <Entry x:Name="Input_Parameter2" Text="EnterValue2" />
        <Button Grid.Row="4" x:Name="UpdateRenderer" Clicked="OnUpdateRendererClicked" Text="Update Renderer" />
        <esriUI:MapView Grid.Row="5" x:Name="MyMapView" />

In this topic
  1. Instructions
  2. Code