本文整理汇总了C#中CameraOperationCompletedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# CameraOperationCompletedEventArgs类的具体用法?C# CameraOperationCompletedEventArgs怎么用?C# CameraOperationCompletedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CameraOperationCompletedEventArgs类属于命名空间,在下文中一共展示了CameraOperationCompletedEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CameraInitialized
/// <summary>
/// Called when device camera initialized.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="CameraOperationCompletedEventArgs"/> instance containing the event data.</param>
private void CameraInitialized(object sender, CameraOperationCompletedEventArgs e)
{
if (e.Succeeded)
{
// Start scan process in separate thread
Deployment.Current.Dispatcher.BeginInvoke(
() =>
{
while (result == null)
{
var cameraBuffer = new WriteableBitmap(
(int)camera.PreviewResolution.Width,
(int)camera.PreviewResolution.Height);
camera.GetPreviewBufferArgb32(cameraBuffer.Pixels);
cameraBuffer.Invalidate();
reader.Decode(cameraBuffer);
}
});
}
else
{
this.result = new BarcodeScannerTask.ScanResult(TaskResult.None);
NavigationService.GoBack();
}
}
示例2: cam_Initialized
private void cam_Initialized(object sender, CameraOperationCompletedEventArgs e)
{
if (!e.Succeeded)
{
cam = null;
return;
}
try
{
cam = (PhotoCamera)sender;
cam.Resolution = cam.AvailableResolutions.First();
}
catch (Exception)
{
cam = null;
return;
}
this.Dispatcher.BeginInvoke(delegate()
{
if (cam == null)
return;
WriteableBitmap bitmap = new WriteableBitmap((int)cam.PreviewResolution.Width,
(int)cam.PreviewResolution.Height);
frameStart = DateTime.Now;
cam.GetPreviewBufferArgb32(bitmap.Pixels);
detectFaces(bitmap);
});
}
示例3: _phoneCamera_AutoFocusCompleted
void _phoneCamera_AutoFocusCompleted(object sender, CameraOperationCompletedEventArgs e)
{
Deployment.Current.Dispatcher.BeginInvoke(delegate()
{
focusBrackets.Visibility = Visibility.Collapsed;
});
}
示例4: OnCameraInitialized
private void OnCameraInitialized(object sender, CameraOperationCompletedEventArgs e)
{
if (e.Succeeded)
{
this.Dispatcher.BeginInvoke(() =>
{
this.phoneCamera.FlashMode = FlashMode.Auto;
this.phoneCamera.Focus();
this.previewBuffer = new WriteableBitmap((int)this.phoneCamera.PreviewResolution.Width, (int)this.phoneCamera.PreviewResolution.Height);
this.barcodeReader = new BarcodeReader();
// By default, BarcodeReader will scan every supported barcode type
// If we want to limit the type of barcodes our app can read,
// we can do it by adding each format to this list object
//var supportedBarcodeFormats = new List<BarcodeFormat>();
//supportedBarcodeFormats.Add(BarcodeFormat.QR_CODE);
//supportedBarcodeFormats.Add(BarcodeFormat.DATA_MATRIX);
//_bcReader.PossibleFormats = supportedBarcodeFormats;
this.barcodeReader.Options.TryHarder = true;
this.barcodeReader.ResultFound += this.OnBarcodeResultFound;
this.scanTimer.Start();
});
}
else
{
this.Dispatcher.BeginInvoke(() =>
{
this.BarcodeScannerPlugin.OnScanFailed("Unable to initialize the camera");
});
}
}
示例5: camera_CaptureCompleted
void camera_CaptureCompleted(object sender, CameraOperationCompletedEventArgs e)
{
if (!e.Succeeded)
{
photoContainer.Fill = new SolidColorBrush(Colors.Gray);
imageDetails.Text = "Camera capture failed.\n" + e.Exception.Message;
}
CleanUpCamera();
}
示例6: cam_Initialized
void cam_Initialized(object sender, CameraOperationCompletedEventArgs e)
{
Dictionary<object, object> zxingHints
= new Dictionary<object, object>() { { DecodeHintType.TRY_HARDER, true } };
_cam.FlashMode = FlashMode.Auto;
_reader = new MultiFormatUPCEANReader(zxingHints);
_cam.Focus();
}
示例7: OnPhotoCameraInitialized
private void OnPhotoCameraInitialized(object sender, CameraOperationCompletedEventArgs e)
{
int width = Convert.ToInt32(PhotoCamera.PreviewResolution.Width);
int height = Convert.ToInt32(PhotoCamera.PreviewResolution.Height);
luminance = new PhotoCameraLuminanceSource(width, height);
qrReader = new QRCodeReader();
ean13Reader = new EAN13Reader();
code39Reader = new Code39Reader();
timer = new Timer((s) => ScanPreviewBuffer(), null, 0, 250);
}
示例8: camera_Initialised
//------------QR CODE -----------------
private void camera_Initialised(object sender, CameraOperationCompletedEventArgs e)
{
// set the camera resolution
if (e.Succeeded)
{
var res = from resolution in camera.AvailableResolutions
where resolution.Width == 640
select resolution;
camera.Resolution = res.First();
}
}
示例9: CameraAutoFocusCompleted
private void CameraAutoFocusCompleted(object sender, CameraOperationCompletedEventArgs e)
{
Action action = () => {
lock (this) {
try {
camera.CaptureImage();
} catch (Exception exception) {
Deployment.Current.Dispatcher.BeginInvoke(() => MessageBox.Show(exception.ToString()));
}
}
};
Deployment.Current.Dispatcher.BeginInvoke(action);
}
示例10: OnPhotoCameraInitialized
private void OnPhotoCameraInitialized(object sender, CameraOperationCompletedEventArgs e)
{
int width = Convert.ToInt32(_photoCamera.PreviewResolution.Width);
int height = Convert.ToInt32(_photoCamera.PreviewResolution.Height);
_luminance = new PhotoCameraLuminanceSource(width, height);
_reader = new QRCodeReader();
Dispatcher.BeginInvoke(() => {
_previewTransform.Rotation = _photoCamera.Orientation;
_timer.Start();
});
}
示例11: _camera_Initialized
void _camera_Initialized(object sender, CameraOperationCompletedEventArgs e)
{
if (e.Succeeded == true)
{
Dispatcher.BeginInvoke(() =>
{
VisualStateManager.GoToState(this, StartCaptureState.Name, false);
});
}
else
{
//TODO : 카메라 초기화 실패시에 재시도 처리가 필요함.
}
}
示例12: OnPhotoCameraInitialized
private void OnPhotoCameraInitialized(object sender, CameraOperationCompletedEventArgs e)
{
int width = Convert.ToInt32(_photoCamera.PreviewResolution.Width);
int height = Convert.ToInt32(_photoCamera.PreviewResolution.Height);
this._luminance = new PhotoCameraLuminanceSource(width, height);
this._reader = new BarcodeReader();
_reader.Options.TryHarder = true;
Dispatcher.BeginInvoke(() => _previewTransform.Rotation = _photoCamera.Orientation);
_photoCamera.Resolution = _photoCamera.AvailableResolutions.First();
_isInitialized = true;
}
示例13: cam_Initialized
void cam_Initialized(object sender, CameraOperationCompletedEventArgs e)
{
//int width = Convert.ToInt32(_photoCamera.PreviewResolution.Width);
//int height = Convert.ToInt32(_photoCamera.PreviewResolution.Height);
int width = 640;
int height = 480;
_luminance = new PhotoCameraLuminanceSource(width, height);
Dispatcher.BeginInvoke(() =>
{
_previewTransform.Rotation = _photoCamera.Orientation;
_timer.Start();
});
_photoCamera.FlashMode = FlashMode.Auto;
_photoCamera.Focus();
}
示例14: CollectCameraCaps
void CollectCameraCaps(object sender, CameraOperationCompletedEventArgs e)
{
var camera = sender as PhotoCamera;
if (camera == null)
return;
if (camera.CameraType == CameraType.Primary)
{
CurrentCameraResolution = camera.Resolution;
HasFocusAtPoint = camera.IsFocusAtPointSupported;
HasFocus = camera.IsFocusSupported;
PhotoPixelLayout = camera.YCbCrPixelLayout;
SupportedResolutions = camera.AvailableResolutions;
}
UninitializeCamera(camera);
}
示例15: cam_Initialized
private void cam_Initialized(object sender, CameraOperationCompletedEventArgs e)
{
if (e.Succeeded)
{
Dispatcher.BeginInvoke(delegate
{
_phoneCamera.FlashMode = FlashMode.Off;
_previewBuffer = new WriteableBitmap((int)_phoneCamera.PreviewResolution.Width,
(int)_phoneCamera.PreviewResolution.Height);
_barcodeReader = new BarcodeReader { Options = { TryHarder = true } };
_barcodeReader.ResultFound += _bcReader_ResultFound;
_scanTimer.Start();
});
}
else
Dispatcher.BeginInvoke(() => MessageBox.Show("No se ha podido inicializar la cámara!"));
}