C# 在Windows Phone C中显示像图片库一样的图像交换#
我无法像windows phone中的图像库那样进行平滑交换 我尝试了C# 在Windows Phone C中显示像图片库一样的图像交换#,c#,windows-phone-7,windows-phone-8,galleryview,windowsphotogallery,C#,Windows Phone 7,Windows Phone 8,Galleryview,Windowsphotogallery,我无法像windows phone中的图像库那样进行平滑交换 我尝试了翻转手势监听器,它可以交换图像,但交换不顺畅 我试图搜索,但没有得到任何答案。我正在尝试以画廊视图的方式显示图像列表。我在过去的3天里苦苦挣扎。请它将是一个帮助,如果你给我一些建议或链接 这是我刚刚创建的一个简单示例,旨在向您展示如何完成此任务。。希望对你有所帮助 <phone:PhoneApplicationPage xmlns:Controls="clr-namespace:Microsoft.Phone.Contr
翻转手势监听器
,它可以交换图像,但交换不顺畅
我试图搜索,但没有得到任何答案。我正在尝试以画廊视图的方式显示图像列表。我在过去的3天里苦苦挣扎。请它将是一个帮助,如果你给我一些建议或链接 这是我刚刚创建的一个简单示例,旨在向您展示如何完成此任务。。希望对你有所帮助
<phone:PhoneApplicationPage xmlns:Controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
x:Class="PhotoChooser.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
<TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
<TextBlock x:Name="PageTitle" Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<ListBox x:Name="lbImages">
<ListBox.ItemTemplate>
<DataTemplate>
<Controls:Panorama>
<Controls:PanoramaItem>
<Image Source="{Binding ImageName}"/>
</Controls:PanoramaItem>
</Controls:Panorama>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Grid>
这个设计器的类文件是这样的
public partial class MainPage : PhoneApplicationPage
{
public MainPage()
{
InitializeComponent();
PanoramaItem panItem = new PanoramaItem();
List<ImageList> imgList = new List<ImageList>();
imgList.Add(new ImageList() { ImageName = ImagePath.Image4 });
lbImages.ItemsSource = imgList;
}
public class ImageList
{
public string ImageName { get; set; }
}
}
public部分类主页:PhoneApplicationPage
{
公共主页()
{
初始化组件();
PanoramaItem panItem=新的PanoramaItem();
List imgList=新列表();
Add(newImageList(){ImageName=ImagePath.Image4});
lbImages.ItemsSource=imgList;
}
公共类图像列表
{
公共字符串ImageName{get;set;}
}
}
这实际上工作顺利,看起来也不错。。要实现你正在尝试的目标,没有更多的方法了。一定要让我知道这是否有效。如果这对你不起作用,我会建议其他人 这是我刚刚创建的一个简单示例,旨在向您展示如何完成此任务。。希望对你有所帮助
<phone:PhoneApplicationPage xmlns:Controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
x:Class="PhotoChooser.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
<TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
<TextBlock x:Name="PageTitle" Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<ListBox x:Name="lbImages">
<ListBox.ItemTemplate>
<DataTemplate>
<Controls:Panorama>
<Controls:PanoramaItem>
<Image Source="{Binding ImageName}"/>
</Controls:PanoramaItem>
</Controls:Panorama>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Grid>
这个设计器的类文件是这样的
public partial class MainPage : PhoneApplicationPage
{
public MainPage()
{
InitializeComponent();
PanoramaItem panItem = new PanoramaItem();
List<ImageList> imgList = new List<ImageList>();
imgList.Add(new ImageList() { ImageName = ImagePath.Image4 });
lbImages.ItemsSource = imgList;
}
public class ImageList
{
public string ImageName { get; set; }
}
}
public部分类主页:PhoneApplicationPage
{
公共主页()
{
初始化组件();
PanoramaItem panItem=新的PanoramaItem();
List imgList=新列表();
Add(newImageList(){ImageName=ImagePath.Image4});
lbImages.ItemsSource=imgList;
}
公共类图像列表
{
公共字符串ImageName{get;set;}
}
}
这实际上工作顺利,看起来也不错。。要实现你正在尝试的目标,没有更多的方法了。一定要让我知道这是否有效。如果这对你不起作用,我会建议其他人 你的问题不是很清楚。当你说“平滑”时,你的意思是它不是动画,还是动画以非常低的帧速率运行?@dr.mo让我说清楚。我有一个图像列表,现在我想像在windows phone中查看照片库图像一样查看它。我没有在这里做任何动画,我只是将我的图像从左向右移动,或者反之亦然,以查看列表中的所有图像。我可以这样做,但您在windows phone gallery中找到的用于查看图像的动画我无法这样做。它应该可以像gallery一样工作。请帮助我…@SanghatiMukherjee你想在一个屏幕上查看一张又一张图片还是一张图片列表?如果你让我知道你想要哪一个,我想买一个可以用的。。我会给你密码或者告诉你怎么做。@apoorva我想要第一个选项,即从左到右依次查看一张图片。。。就像windows phone中的gallery。如果你有一些建议或代码,这将是一个帮助我有一个建议。。使用全景控件,动态创建全景项目,并将每张图片绑定到每个全景项目。您的问题不是很清楚。当你说“平滑”时,你的意思是它不是动画,还是动画以非常低的帧速率运行?@dr.mo让我说清楚。我有一个图像列表,现在我想像在windows phone中查看照片库图像一样查看它。我没有在这里做任何动画,我只是将我的图像从左向右移动,或者反之亦然,以查看列表中的所有图像。我可以这样做,但您在windows phone gallery中找到的用于查看图像的动画我无法这样做。它应该可以像gallery一样工作。请帮助我…@SanghatiMukherjee你想在一个屏幕上查看一张又一张图片还是一张图片列表?如果你让我知道你想要哪一个,我想买一个可以用的。。我会给你密码或者告诉你怎么做。@apoorva我想要第一个选项,即从左到右依次查看一张图片。。。就像windows phone中的gallery。如果你有一些建议或代码,这将是一个帮助我有一个建议。。获取全景控件并动态创建全景项目,并将每个图片绑定到每个全景项目