1
我正在開發一個應用程序,它需要從圖庫中選擇背景圖片。對於這個我在Windows phone 8.1
實現相同的功能Choose Photo
功能(設置背景圖片),如何在windows phone中實現選擇照片功能
我已經試過這樣:
XAML:
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Name="contentPanel">
<ScrollViewer Name="scrl" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" Opacity="0.3">
</ScrollViewer>
<ScrollViewer Name="scrlView" Height="500" Width="300" BorderBrush="Red" BorderThickness="1" Background="Transparent">
</ScrollViewer>
<Image Name="mtpImg" Stretch="Fill" />
</Grid>
</Grid>
<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar Mode="Minimized">
<shell:ApplicationBarIconButton IconUri="Assets\ApplicationIcon.png" Click="gallery_click" Text="gallery"/>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>
C#:
private void gallery_click(object sender, EventArgs e)
{
PhotoChooserTask chooser = new PhotoChooserTask();
chooser.Completed += gallery_Completed;
chooser.Show();
}
private void gallery_Completed(object sender, PhotoResult e)
{
if (e.TaskResult == TaskResult.OK)
{
Image img = new Image();
BitmapImage tmpBitmap = new BitmapImage();
tmpBitmap.SetSource(e.ChosenPhoto);
img.Source = tmpBitmap;
scrl.Content = img;
}
}
問題:如何設置opacity=1
內部顯示的圖像scrlView
ScrollViewer?
這樣設置opacity = 1表示誰le形象。我需要的是對於幀內部可見的圖像部分,不透明度= 1。 – Dev 2014-10-01 07:21:09