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,則相機選項將與菜單和照片等其他選項一起預先顯示在菜單中。