1

Building a WinRT app that has a large image extending beyond the viewport horizontally and vertically. I'd like to know if it's possible (and how) to create hotspots on the image so that when the user taps on any spot a popup box would display related information.

Thank you in advance.

solution

<ScrollViewer>

    <Grid x:Name="LayoutRoot">
        <Grid.Background>
            <ImageBrush Stretch="Fill" ImageSource="Assets/Map.jpg" AlignmentY="Top" AlignmentX="Left"/>
        </Grid.Background>

        <Grid.RowDefinitions>
            <RowDefinition Height="50*" />
            <RowDefinition Height="50*" />
        </Grid.RowDefinitions>
        <Rectangle Fill="#FF7771FF" HorizontalAlignment="Left" Height="75" Margin="1070,210,0,0" VerticalAlignment="Top" Width="75"/>
        <Rectangle Fill="#FF7771FF" HorizontalAlignment="Left" Height="75" Margin="635,211,0,0" VerticalAlignment="Top" Width="75" Grid.Row="1"/>

    </Grid>

</ScrollViewer>
user1027620
  • 2,745
  • 5
  • 37
  • 65

1 Answers1

2

A Way to do this is, to use a Grid (or Canvas...) and set the Background to your Image. Then as next Layer set invisible Buttons, Rectangles or something like that with a Touch-Event.

There are some Ways like this here to set a Image Map.

Community
  • 1
  • 1
  • I need to pan right, left, top, bottom and zoom in, out. So I decided to use a `ScrollViewer`. Is there a way to also embed this in the app? – user1027620 Nov 04 '13 at 09:54
  • 1
    You can use his suggestion and just embed all of it in a `ScrollViewer` as the parent and accomplish the same thing. – Chris W. Nov 04 '13 at 21:19