3

我显示与下面的代码的照片廊:访问摄像头的Windows Phone 10

FileOpenPicker openPicker = new FileOpenPicker(); 
openPicker.ViewMode = PickerViewMode.Thumbnail; 
openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary; 
openPicker.FileTypeFilter.Add(".jpg"); 
openPicker.FileTypeFilter.Add(".jpeg"); 
openPicker.FileTypeFilter.Add(".png"); 
filePicker.PickSingleFileAndContinue(); 

在的Windows Phone 8.1的FileOpenPicker是显示在ApplicationBar相机按钮。

当在Windows Phone 10中使用相同的代码时,将显示一个确认和取消按钮,而不是相机。

如何显示8.1中的摄像头按钮?

回答

3

ApplicationBar中点击Choose location会提示您提供照片支持的应用程序列表,包括相机。尽管我发现这个比Windows Phone 8.1更不突出(和奇怪的本地化),但我猜这是推出相机的方法。

0

无法在Windows 10 Mobile应用程序的应用程序栏中显示相机按钮。但是,如果您未指定SuggestedStartLocation,则相机选项将与菜单和照片等其他选项一起预先显示在菜单中。