View in WPF WinUI UWP Forms iOS Android View on GitHub
Sample viewer app
Use a hillshade renderer on a raster.
How to use the sample
Configure the options for rendering, then click 'Apply hillshade'.
How it works
The parameters provided by the user are passed to HillshadeRender
at instantiation: new HillshadeRenderer(mAltitude, mAzimuth, mZFactor, mSlopeType, mPixelSizeFactor, mPixelSizePower, mOutputBitDepth);
which returns a RasterRenderer
. The RasterRenderer
is then added to the RasterLayer
.
Offline data
This sample downloads the following items from ArcGIS Online automatically:
Visualization, hillshade, raster, shadow, slope
Sample CodeRasterHillshade.xaml RasterHillshade.xaml RasterHillshade.xaml.cs CopyUse dark colors for code blocks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
< UserControl x:Class = "ArcGISRuntime.WPF.Samples.RasterHillshade.RasterHillshade"
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/runtime/2013" >
< Grid >
< esri:MapView x:Name = "MyMapView" />
< Border Style = "{StaticResource BorderStyle}" >
< Grid >
< Grid.ColumnDefinitions >
< ColumnDefinition />
< ColumnDefinition Width = "3*" />
</ Grid.ColumnDefinitions >
< Grid.RowDefinitions >
< RowDefinition />
< RowDefinition />
< RowDefinition />
< RowDefinition />
</ Grid.RowDefinitions >
< TextBlock Text = "Slope type:"
Grid.Row = "0" Grid.Column = "0"
TextAlignment = "Right" VerticalAlignment = "Center" />
< ComboBox x:Name = "SlopeTypeCombo"
Grid.Row = "0" Grid.Column = "1"
Margin = "5" />
< TextBlock Grid.Row = "1" Grid.Column = "0"
TextAlignment = "Right" VerticalAlignment = "Center"
Text = "Altitude:" />
< Slider x:Name = "AltitudeSlider"
Grid.Row = "1" Grid.Column = "1"
Margin = "5"
Minimum = "0" Maximum = "90" >
< Slider.ToolTip >
< ToolTip
Content = "{Binding RelativeSource={RelativeSource Self},
Path=PlacementTarget.Value}"
ContentStringFormat = "{}{0:0}" />
</ Slider.ToolTip >
</ Slider >
< TextBlock Text = "Azimuth:"
Grid.Row = "2" Grid.Column = "0"
TextAlignment = "Right" VerticalAlignment = "Center" />
< Slider x:Name = "AzimuthSlider"
Grid.Row = "2" Grid.Column = "1"
Margin = "5"
Minimum = "0" Maximum = "360" >
< Slider.ToolTip >
< ToolTip
Content = "{Binding RelativeSource={RelativeSource Self},
Path=PlacementTarget.Value}"
ContentStringFormat = "{}{0:0}" />
</ Slider.ToolTip >
</ Slider >
< Button x:Name = "ApplyHillshadeButton"
Grid.Row = "3" Grid.Column = "0" Grid.ColumnSpan = "2"
Margin = "5" Padding = "3"
IsEnabled = "False"
Content = "Apply hillshade"
Click = "ApplyHillshadeButton_Click" />
</ Grid >
</ Border >
</ Grid >
</ UserControl >