Image saving (MediaLibrary call does not work), icons and tiles
Двоичные данные
CameraExplorer/Assets/ApplicationIcon.png
До Ширина: | Высота: | Размер: 3.3 KiB После Ширина: | Высота: | Размер: 6.0 KiB |
После Ширина: | Высота: | Размер: 3.0 KiB |
Двоичные данные
CameraExplorer/Assets/Tiles/FlipCycleTileLarge.png
До Ширина: | Высота: | Размер: 9.8 KiB После Ширина: | Высота: | Размер: 14 KiB |
Двоичные данные
CameraExplorer/Assets/Tiles/FlipCycleTileMedium.png
До Ширина: | Высота: | Размер: 7.4 KiB После Ширина: | Высота: | Размер: 14 KiB |
Двоичные данные
CameraExplorer/Assets/Tiles/FlipCycleTileSmall.png
До Ширина: | Высота: | Размер: 3.6 KiB После Ширина: | Высота: | Размер: 8.0 KiB |
Двоичные данные
CameraExplorer/Assets/Tiles/IconicTileMediumLarge.png
До Ширина: | Высота: | Размер: 6.8 KiB |
Двоичные данные
CameraExplorer/Assets/Tiles/IconicTileSmall.png
До Ширина: | Высота: | Размер: 3.6 KiB |
|
@ -182,6 +182,7 @@
|
|||
<Content Include="Assets\Icons\overlay.scenemode.snow.png" />
|
||||
<Content Include="Assets\Icons\overlay.scenemode.sport.png" />
|
||||
<Content Include="Assets\Icons\overlay.scenemode.sunset.png" />
|
||||
<Content Include="Assets\Icons\save.png" />
|
||||
<Content Include="Assets\Tiles\FlipCycleTileLarge.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
|
|
@ -64,14 +64,7 @@ namespace CameraExplorer
|
|||
}
|
||||
}
|
||||
|
||||
BitmapImage _image = new BitmapImage();
|
||||
public BitmapImage Image
|
||||
{
|
||||
get
|
||||
{
|
||||
return _image;
|
||||
}
|
||||
}
|
||||
public MemoryStream ImageStream { get; set; }
|
||||
|
||||
public async Task InitializeCamera(CameraSensorLocation sensorLocation)
|
||||
{
|
||||
|
|
|
@ -64,130 +64,6 @@ namespace CameraExplorer
|
|||
videoBrush.SetSource(_dataContext.Device);
|
||||
}
|
||||
|
||||
#region camera parameter printing functions
|
||||
void PrintCameraParameters(PhotoCaptureDevice device)
|
||||
{
|
||||
PrintSensorLocations(device);
|
||||
PrintPreviewResolutions(device);
|
||||
PrintCaptureResolutions(device);
|
||||
PrintMiscellaneousInfo(device);
|
||||
|
||||
PrintCameraParameter(KnownCameraPhotoProperties.ExposureCompensation, "KnownCameraPhotoProperties.ExposureCompensation");
|
||||
PrintCameraParameter(KnownCameraPhotoProperties.ExposureTime, "KnownCameraPhotoProperties.ExposureTime");
|
||||
PrintCameraParameter(KnownCameraPhotoProperties.FlashMode, "KnownCameraPhotoProperties.FlashMode");
|
||||
PrintCameraParameter(KnownCameraPhotoProperties.FlashPower, "KnownCameraPhotoProperties.FlashPower");
|
||||
PrintCameraParameter(KnownCameraPhotoProperties.FocusIlluminationMode, "KnownCameraPhotoProperties.FocusIlluminationMode");
|
||||
PrintCameraParameter(KnownCameraPhotoProperties.Iso, "KnownCameraPhotoProperties.Iso");
|
||||
PrintCameraParameter(KnownCameraPhotoProperties.LockedAutoFocusParameters, "KnownCameraPhotoProperties.LockedAutoFocusParameters");
|
||||
PrintCameraParameter(KnownCameraPhotoProperties.ManualWhiteBalance, "KnownCameraPhotoProperties.ManualWhiteBalance");
|
||||
PrintCameraParameter(KnownCameraPhotoProperties.SceneMode, "KnownCameraPhotoProperties.SceneMode");
|
||||
PrintCameraParameter(KnownCameraPhotoProperties.WhiteBalancePreset, "KnownCameraPhotoProperties.WhiteBalancePreset");
|
||||
|
||||
PrintCameraParameter(KnownCameraGeneralProperties.AutoFocusRange, "KnownCameraGeneralProperties.AutoFocusRange");
|
||||
PrintCameraParameter(KnownCameraGeneralProperties.EncodeWithOrientation, "KnownCameraGeneralProperties.EncodeWithOrientation");
|
||||
PrintCameraParameter(KnownCameraGeneralProperties.IsShutterSoundEnabledByUser, "KnownCameraGeneralProperties.IsShutterSoundEnabledByUser");
|
||||
PrintCameraParameter(KnownCameraGeneralProperties.IsShutterSoundRequiredForRegion, "KnownCameraGeneralProperties.IsShutterSoundRequiredForRegion");
|
||||
PrintCameraParameter(KnownCameraGeneralProperties.ManualFocusPosition, "KnownCameraGeneralProperties.ManualFocusPosition");
|
||||
PrintCameraParameter(KnownCameraGeneralProperties.PlayShutterSoundOnCapture, "KnownCameraGeneralProperties.PlayShutterSoundOnCapture");
|
||||
PrintCameraParameter(KnownCameraGeneralProperties.SpecifiedCaptureOrientation, "KnownCameraGeneralProperties.SpecifiedCaptureOrientation");
|
||||
}
|
||||
|
||||
void PrintMiscellaneousInfo(PhotoCaptureDevice device)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("PhotoCaptureDevice.IsFocusRegionSupported is " + PhotoCaptureDevice.IsFocusRegionSupported(device.SensorLocation));
|
||||
System.Diagnostics.Debug.WriteLine("");
|
||||
|
||||
System.Diagnostics.Debug.WriteLine("PhotoCaptureDevice.IsFocusSupported is " + PhotoCaptureDevice.IsFocusSupported(device.SensorLocation));
|
||||
System.Diagnostics.Debug.WriteLine("");
|
||||
}
|
||||
|
||||
void PrintPreviewResolutions(PhotoCaptureDevice device)
|
||||
{
|
||||
IReadOnlyList<Windows.Foundation.Size> resolutions = PhotoCaptureDevice.GetAvailablePreviewResolutions(device.SensorLocation);
|
||||
|
||||
System.Diagnostics.Debug.WriteLine("Current preview resolution is " + device.PreviewResolution + ", all supported " + resolutions.Count + " resolutions being:");
|
||||
|
||||
for (int i = 0; i < resolutions.Count; i++)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(" " + resolutions[i].Width + "x" + resolutions[i].Height);
|
||||
}
|
||||
|
||||
System.Diagnostics.Debug.WriteLine("");
|
||||
}
|
||||
|
||||
void PrintCaptureResolutions(PhotoCaptureDevice device)
|
||||
{
|
||||
IReadOnlyList<Windows.Foundation.Size> resolutions = PhotoCaptureDevice.GetAvailableCaptureResolutions(device.SensorLocation);
|
||||
|
||||
System.Diagnostics.Debug.WriteLine("Current capture resolution is " + device.CaptureResolution + ", all supported " + resolutions.Count + " resolutions being:");
|
||||
|
||||
for (int i = 0; i < resolutions.Count; i++)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(" " + resolutions[i].Width + "x" + resolutions[i].Height);
|
||||
}
|
||||
|
||||
System.Diagnostics.Debug.WriteLine("");
|
||||
}
|
||||
|
||||
void PrintSensorLocations(PhotoCaptureDevice device)
|
||||
{
|
||||
IReadOnlyList<CameraSensorLocation> sensorLocations = PhotoCaptureDevice.AvailableSensorLocations;
|
||||
|
||||
System.Diagnostics.Debug.WriteLine("Current sensor location is " + device.SensorLocation + " with rotation of "
|
||||
+ device.SensorRotationInDegrees + " degrees, all supported " + sensorLocations.Count + " sensor locations being:");
|
||||
|
||||
for (int i = 0; i < sensorLocations.Count; i++)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(" " + sensorLocations[i].ToString());
|
||||
}
|
||||
|
||||
System.Diagnostics.Debug.WriteLine("");
|
||||
}
|
||||
|
||||
void PrintCameraParameter(Guid guid, string name)
|
||||
{
|
||||
bool isRange = true;
|
||||
object value = null;
|
||||
string valueString;
|
||||
|
||||
try
|
||||
{
|
||||
CameraCapturePropertyRange range = PhotoCaptureDevice.GetSupportedPropertyRange(_dataContext.Device.SensorLocation, guid);
|
||||
value = _dataContext.Device.GetProperty(guid);
|
||||
valueString = value != null ? value.ToString() : "(null)";
|
||||
|
||||
System.Diagnostics.Debug.WriteLine(name + " is a range " + range.Min + "..." + range.Max + " with current value " + valueString);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
isRange = false;
|
||||
}
|
||||
|
||||
if (!isRange)
|
||||
{
|
||||
try
|
||||
{
|
||||
IReadOnlyList<object> values = PhotoCaptureDevice.GetSupportedPropertyValues(_dataContext.Device.SensorLocation, guid);
|
||||
value = _dataContext.Device.GetProperty(guid);
|
||||
valueString = value != null ? value.ToString() : "(null)";
|
||||
|
||||
System.Diagnostics.Debug.WriteLine(name + " is a " + values.Count + "-value set with current value " + valueString + " and all values being:");
|
||||
|
||||
for (int i = 0; i < values.Count; i++)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(" " + values[i].ToString());
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("Unable to read " + name);
|
||||
}
|
||||
}
|
||||
|
||||
System.Diagnostics.Debug.WriteLine("");
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void settingsButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
NavigationService.Navigate(new Uri("/SettingsPage.xaml", UriKind.Relative));
|
||||
|
@ -239,10 +115,7 @@ namespace CameraExplorer
|
|||
await _dataContext.Device.PrepareCaptureSequenceAsync(sequence);
|
||||
await sequence.StartCaptureAsync();
|
||||
|
||||
//MediaLibrary library = new MediaLibrary();
|
||||
//Picture picture = library.SavePictureToCameraRoll("CameraExplorer.jpg", stream);
|
||||
|
||||
_dataContext.Image.SetSource(stream);
|
||||
_dataContext.ImageStream = stream;
|
||||
|
||||
NavigationService.Navigate(new Uri("/PreviewPage.xaml", UriKind.Relative));
|
||||
|
||||
|
|
|
@ -29,4 +29,11 @@
|
|||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<phone:PhoneApplicationPage.ApplicationBar>
|
||||
<shell:ApplicationBar IsVisible="True">
|
||||
<shell:ApplicationBarIconButton x:Name="saveButton" Text="save"
|
||||
IconUri="Assets/Icons/save.png" Click="saveButton_Click"/>
|
||||
</shell:ApplicationBar>
|
||||
</phone:PhoneApplicationPage.ApplicationBar>
|
||||
|
||||
</phone:PhoneApplicationPage>
|
|
@ -7,6 +7,8 @@ using System.Windows.Controls;
|
|||
using System.Windows.Navigation;
|
||||
using Microsoft.Phone.Controls;
|
||||
using Microsoft.Phone.Shell;
|
||||
using Microsoft.Xna.Framework.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace CameraExplorer
|
||||
{
|
||||
|
@ -14,6 +16,8 @@ namespace CameraExplorer
|
|||
{
|
||||
CameraExplorer.DataContext _dataContext = CameraExplorer.DataContext.Singleton;
|
||||
|
||||
BitmapImage _bitmap = new BitmapImage();
|
||||
|
||||
public PreviewPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
@ -23,9 +27,27 @@ namespace CameraExplorer
|
|||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
image.Source = _dataContext.Image;
|
||||
_bitmap.SetSource(_dataContext.ImageStream);
|
||||
|
||||
image.Source = _bitmap;
|
||||
|
||||
base.OnNavigatedTo(e);
|
||||
}
|
||||
|
||||
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
|
||||
{
|
||||
_dataContext.ImageStream = null;
|
||||
|
||||
base.OnNavigatingFrom(e);
|
||||
}
|
||||
|
||||
private void saveButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
MediaLibrary library = new MediaLibrary();
|
||||
|
||||
library.SavePictureToCameraRoll("CameraExplorer", _dataContext.ImageStream);
|
||||
|
||||
NavigationService.GoBack();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -27,15 +27,14 @@
|
|||
</BackBackgroundImageURI>
|
||||
<BackTitle>
|
||||
</BackTitle>
|
||||
<LargeBackgroundImageURI IsRelative="true" IsResource="false">
|
||||
</LargeBackgroundImageURI>
|
||||
<LargeBackgroundImageURI IsRelative="true" IsResource="false">Assets\Tiles\FlipCycleTileLarge.png</LargeBackgroundImageURI>
|
||||
<LargeBackContent>
|
||||
</LargeBackContent>
|
||||
<LargeBackBackgroundImageURI>
|
||||
</LargeBackBackgroundImageURI>
|
||||
<DeviceLockImageURI>
|
||||
</DeviceLockImageURI>
|
||||
<HasLarge>False</HasLarge>
|
||||
<HasLarge>True</HasLarge>
|
||||
</TemplateFlip>
|
||||
</PrimaryToken>
|
||||
</Tokens>
|
||||
|
|
Двоичные данные
Documentation/CameraExplorer.mdzip
Двоичные данные
Documentation/architecture.png
До Ширина: | Высота: | Размер: 111 KiB После Ширина: | Высота: | Размер: 114 KiB |