Shaded Relief, Slope

This samples demonstrates how to apply an ESRI.ArcGIS.Client RenderingRule class on an ArcGISImageServiceLayer to display imagery in different display formats. The raster functions used to display images include: ShadedRelief, Hillshade and Slope. To use the sample, choose the shaded relief or slope raster function (via the radio buttons), then define input properties and click Apply to see the changes.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.ShadedReliefImageService"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:esri="http://schemas.esri.com/arcgis/client/2009">

    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.Resources>
            <LinearGradientBrush x:Key="PanelGradient" EndPoint="0.5,1" StartPoint="0.5,0">
                <LinearGradientBrush.RelativeTransform>
                    <TransformGroup>
                        <ScaleTransform CenterY="0.5" CenterX="0.5"/>
                        <SkewTransform CenterY="0.5" CenterX="0.5"/>
                        <RotateTransform Angle="176" CenterY="0.5" CenterX="0.5"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </LinearGradientBrush.RelativeTransform>
                <GradientStop Color="#FF145787" Offset="0.16"/>
                <GradientStop Color="#FF3D7FAC" Offset="0.502"/>
                <GradientStop Color="#FF88C5EF" Offset="0.984"/>
            </LinearGradientBrush>
        </Grid.Resources>
        <esri:Map x:Name="MyMap" MinimumResolution="0.001">
            <esri:Map.Extent>
                <esri:Envelope XMin="-13252696.9772181" YMin="4334986.98647778" XMax="-13035597.7375257" YMax="4441723.50446743">
                    <esri:Envelope.SpatialReference>
                        <esri:SpatialReference WKID="102100"/>
                    </esri:Envelope.SpatialReference>
                </esri:Envelope>
            </esri:Map.Extent>
            <esri:ArcGISImageServiceLayer ID="ImageServiceLayer"  
                    Url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/CaliforniaDEM/ImageServer"  
                    ImageFormat="JPGPNG" InitializationFailed="Layer_InitializationFailed" />
            <esri:ArcGISTiledMapServiceLayer Opacity="100" 
                    Url="http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer" />
        </esri:Map>

        <Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,10,10,0" >
            <Rectangle Fill="{StaticResource PanelGradient}" Stroke="Gray"  RadiusX="10" RadiusY="10" Margin="0,0,0,5">
                <Rectangle.Effect>
                    <DropShadowEffect/>
                </Rectangle.Effect>
            </Rectangle>
            <Rectangle Fill="#FFFFFFFF" Stroke="DarkGray" RadiusX="5" RadiusY="5" Margin="10,10,10,15" />
            <StackPanel Orientation="Vertical" Margin="30,20,20,30" >
                <TextBlock x:Name="ResponseTextBlock" Text="Choose the shaded relief or slope raster function, then define input properties.  Click Apply to apply the changes." 
                           Width="200" TextAlignment="Left"  TextWrapping="Wrap" Margin="0,0,0,5" Foreground="Black"/>
                <StackPanel Orientation="Vertical">
                    <StackPanel Orientation="Horizontal" Margin="3">
                        <RadioButton x:Name="SRRadioButton" IsChecked="True" GroupName="RasterFunction" 
                                     Content="Shaded Relief"  Margin="3" />
                        <RadioButton x:Name="SlopeRadioButton" IsChecked="False" GroupName="RasterFunction" 
                                     Content="Slope"  Margin="3" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="3">
                        <TextBlock Text="Azimuth" VerticalAlignment="Center" Margin="3"  Foreground="Black"  />
                        <TextBox x:Name="AzimuthTextBox" Text="215" 
                                 IsEnabled="{Binding ElementName=SRRadioButton, Path=IsChecked}" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="3">
                        <TextBlock Text="Altitude" Margin="3" VerticalAlignment="Center"  Foreground="Black" />
                        <TextBox x:Name="AltitudeTextBox"  Text="60" 
                                 IsEnabled="{Binding ElementName=SRRadioButton, Path=IsChecked}"  Foreground="Black" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="3">
                        <TextBlock Text="ZFactor" VerticalAlignment="Center" Margin="3"  Foreground="Black" />
                        <TextBox x:Name="ZFactorTextBox" Text="3"  Foreground="Black" />
                    </StackPanel>
                    <CheckBox x:Name="ColormapCheckBox" IsChecked="True" Content="Use Colormap" Margin="3"
                              IsEnabled="{Binding ElementName=SRRadioButton, Path=IsChecked}"/>
                </StackPanel>
                <Button Content="Apply" Margin="0,5,5,0" Click="ApplyButton_Click"  />
            </StackPanel>
        </Grid>
    </Grid>
</UserControl>

Sample code usage restrictions
5/16/2014