Query

This sample demonstrates using an ESRI.ArcGIS.Client.Tasks QueryTask class to Query an ArcGISImageServiceLayer to find and display the outlines of image tiles and display them as SimpleFillSymbols in a GraphicsLayer. MapTips containing attribute information is displayed for those tiles that are returned from the Query when the mouse is hovered over them. To use this sample, drag a rectangle to query image tiles. Tile footprints will be displayed and their attributes will be available in map tips.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.QueryImageService"
    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"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity">
    <Grid x:Name="LayoutRoot" Background="White">

        <Grid.Resources>
            <esri:SimpleFillSymbol x:Key="DrawFillSymbol" BorderBrush="Red" Fill="#33FF0000" />
            <esri:SimpleFillSymbol x:Key="FootprintFillSymbol" Fill="#01FFFFFF" BorderBrush="White" BorderThickness="2" />
            <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" WrapAround="True">
            <esri:Map.Extent>
                <esri:Envelope XMin="-13670997.592674" YMin="5697204.89662362" XMax="-13637149.3323152" YMax="5714270.45407472">
                    <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/Portland/Aerial/ImageServer" ImageFormat="JPGPNG" />
            <esri:ArcGISTiledMapServiceLayer Opacity="100" 
                    Url="http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer" />
            <esri:GraphicsLayer ID="FootprintsGraphicsLayer" >
                <esri:GraphicsLayer.MapTip>
                    <Border CornerRadius="10" BorderBrush="#FF222957" Background="LightGray" BorderThickness="2" Margin="0,0,15,15">
                        <StackPanel Orientation="Vertical" Margin="5">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="Name: " FontWeight="Bold"  Foreground="Black" />
                                <TextBlock Text="{Binding [Name]}"  Foreground="Black" />
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="Pixel Size (meters/pixel): "  Foreground="Black" />
                                <TextBlock Text="{Binding [LowPS]}"  Foreground="Black" />
                            </StackPanel>
                        </StackPanel>
                    </Border>
                </esri:GraphicsLayer.MapTip>
            </esri:GraphicsLayer>
        </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="Drag a rectangle to query image tiles.  Tile footprints will be displayed and their attributes will be available in map tips." 
                           Width="200" TextAlignment="Left"  TextWrapping="Wrap"  Foreground="Black" />
                <Button Content="Clear Results" Margin="0,5,5,0" Click="ClearButton_Click"  />
            </StackPanel>
        </Grid>

    </Grid>
</UserControl>

Sample code usage restrictions
5/16/2014