Reputation: 2275
I was trying to change the Windows phone Camera Brightness
I Have tried this code
private async Task StartCapture()
{
mediaCapture = new MediaCapture();
var _deviceInformation = await GetCameraDeviceInfoAsync(Windows.Devices.Enumeration.Panel.Back);
var settings = new MediaCaptureInitializationSettings();
settings.StreamingCaptureMode = StreamingCaptureMode.Video;
settings.PhotoCaptureSource = PhotoCaptureSource.VideoPreview;
settings.AudioDeviceId = "";
if (_deviceInformation != null)
settings.VideoDeviceId = _deviceInformation.Id;
await mediaCapture.InitializeAsync(settings);
mediaCapture.VideoDeviceController.Brightness.TrySetValue(50);
captureReceipt.Source = mediaCapture;
await mediaCapture.StartPreviewAsync();
}
private static async Task<DeviceInformation> GetCameraDeviceInfoAsync(Windows.Devices.Enumeration.Panel desiredPanel)
{
DeviceInformation device = (await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture))
.FirstOrDefault(d => d.EnclosureLocation != null && d.EnclosureLocation.Panel == desiredPanel);
return device;
}
And the Xaml is :
<Grid>
<CaptureElement x:Name="captureReceipt"/>
</Grid>
But i was not able to alter the brightness of the camera
Is there any way i could change the brightness of windows phone camera?
Upvotes: 2
Views: 275
Reputation: 2475
Check the values in mediaCapture.VideoDeviceController.Brightness.Capabilities.
Are Supported and AutoModeSupported set to true? What are the values for Min, Max and Default?
Upvotes: 1