簡體   English   中英

WinRT / 8在圖像控件上創建熱點

[英]WinRT / 8 Creating Hotspots on Image control

構建一個WinRT應用程序,該應用程序的大圖像在水平和垂直方向上都超出視口。 我想知道是否有可能(以及如何)在圖像上創建熱點,以便當用戶在任意點上點擊時,彈出框將顯示相關信息。

先感謝您。

<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>

一種方法是使用網格(或Canvas ...)並將背景設置為圖像。 然后,在下一個圖層中,設置不可見的按鈕,矩形或類似帶有觸摸事件的對象。

有一些方法像這樣在這里設置一個影像地圖。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM