本文整理汇总了C#中CameraCaptureTask类的典型用法代码示例。如果您正苦于以下问题:C# CameraCaptureTask类的具体用法?C# CameraCaptureTask怎么用?C# CameraCaptureTask使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CameraCaptureTask类属于命名空间,在下文中一共展示了CameraCaptureTask类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainPage
// Constructor
public MainPage()
{
InitializeComponent();
cameraCapture = new CameraCaptureTask();
cameraCapture.Completed += cameraCapture_Completed;
}
示例2: RecipeDetailPage
public RecipeDetailPage()
{
InitializeComponent();
camera = new CameraCaptureTask();
camera.Completed += camera_Completed;
}
开发者ID:WindowsPhone-8-TrainingKit,项目名称:HOL-InAppPurchaseAndTrialConversion,代码行数:7,代码来源:RecipeDetailPage.xaml.cs
示例3: PicEffect
//DateTime lastTouchUpdate;
public PicEffect()
{
InitializeComponent();
// Init vars
oldViewportSize = new Size(Viewport.ActualWidth, Viewport.ActualHeight);
wasResized = false;
// Attach touch event handler
Touch.FrameReported += Touch_FrameReported;
// Init tasks
cameraCaptureTask = new CameraCaptureTask();
cameraCaptureTask.Completed += PhotoProviderTaskCompleted;
photoChooserTask = new PhotoChooserTask();
photoChooserTask.Completed += PhotoProviderTaskCompleted;
// Disable the camera button if the app runs in the emulator
// Todo: The BtnCamera reference returns null in WP7 v1
// BtnCamera.IsEnabled = Microsoft.Devices.Environment.DeviceType != DeviceType.Emulator;
// That's why we have to use this more hacky trick:
var buttons = ApplicationBar.Buttons.Cast<Microsoft.Phone.Shell.ApplicationBarIconButton>();
var btn = buttons.Where(b => b.IconUri.ToString().ToLower().Contains("camera")).FirstOrDefault();
//if (btn != null)
//{
//btn.IsEnabled = Microsoft.Devices.Environment.DeviceType != DeviceType.Emulator;
//}
BackKeyPress += OnBackKeyPressed;
}
示例4: MainPage
// Constructor
public MainPage()
{
InitializeComponent();
_cameraTask = new CameraCaptureTask();
_cameraTask.Completed += cameraTask_Completed;
}
示例5: MainPage
// Constructor
public MainPage()
{
InitializeComponent();
camera = new CameraCaptureTask();
camera.Completed += new EventHandler<PhotoResult>(camera_Completed);
}
示例6: MainPage
public MainPage()
{
InitializeComponent();
_captureCamera = new CameraCaptureTask();
_captureCamera.Completed += _captureCamera_Completed;
}
示例7: BtnTakePictureClick
private void BtnTakePictureClick(object sender, RoutedEventArgs e)
{
var captureTask = new CameraCaptureTask();
_geoLocationManager.RetrieveCurrentLocation();
captureTask.Completed += (s, a) =>
{
try
{
if (a.Error == null && a.TaskResult == TaskResult.OK && a.ChosenPhoto != null)
{
var photo = new Photo
{
Latitude = _geoLocationManager.Latitude,
Longitude = _geoLocationManager.Longitude
};
var bytes = new byte[a.ChosenPhoto.Length];
a.ChosenPhoto.Read(bytes, 0, bytes.Length);
a.ChosenPhoto.Close();
photo.ImageBytes = bytes;
_persistenceManager.Add(photo);
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
};
captureTask.Show();
}
示例8: Scan
public Scan()
{
InitializeComponent();
cameraCaptureTask = new CameraCaptureTask();
Loaded += new RoutedEventHandler(SearchView_Loaded);
}
示例9: CameraCaptureCommand
public CameraCaptureCommand(object parameter)
{
_captureTask = new CameraCaptureTask();
_captureTask.Completed += CaptureTaskOnCompleted;
_viewModel = (MainViewModel) parameter;
}
示例10: Save_the_captured_image
//Save the captured image to isolated storage
private void Save_the_captured_image(object sender, RoutedEventArgs e)
{
CameraCaptureTask photoCameraCapture = new CameraCaptureTask();
photoCameraCapture = new CameraCaptureTask();
photoCameraCapture.Completed += new EventHandler<PhotoResult>(photoCameraCapture_Completed);
photoCameraCapture.Show();
}
示例11: CreateLevel
public CreateLevel()
{
InitializeComponent();
cameraTask = new CameraCaptureTask();
cameraTask.Completed += new EventHandler<PhotoResult>(cameraTask_Completed);
}
示例12: StartLoop
public static void StartLoop()
{
CameraCaptureTask cameraCaptureTask = new CameraCaptureTask();
cameraCaptureTask.Completed += new EventHandler<PhotoResult>(cameraCaptureTask_Completed);
cameraCaptureTask.Show();
}
示例13: MessageBoxUserControl
public MessageBoxUserControl()
{
InitializeComponent();
_cameraCaptureTask = new CameraCaptureTask();
_cameraCaptureTask.Completed += cameraCaptureTask_Completed;
StatusTextCount.Text = string.Format("{0}/{1}", StatusUpdateBox.Text.Length, Constants.STATUS_LIMIT);
}
示例14: captureImage
/// <summary>
/// Launches default camera application to capture image
/// </summary>
/// <param name="options">may contains limit or mode parameters</param>
public void captureImage(string options)
{
try
{
try
{
this.captureImageOptions = String.IsNullOrEmpty(options) ?
CaptureImageOptions.Default : JSON.JsonHelper.Deserialize<CaptureImageOptions>(options);
}
catch (Exception ex)
{
this.DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION, ex.Message));
return;
}
cameraTask = new CameraCaptureTask();
cameraTask.Completed += this.cameraTask_Completed;
cameraTask.Show();
}
catch (Exception e)
{
DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
}
}
示例15: NewImageVM
public NewImageVM(IMessageBus Messenger,
IStoreImages ImageStore) {
Messenger.Listen<IElementVM<MultimediaObject>>(MessageContracts.EDIT)
.Where(vm => vm.Model.MediaType == MediaType.Image && vm.Model.IsNew())
.SelectMany(mmo => {
var capture = new CameraCaptureTask();
var results =
Observable.FromEventPattern<PhotoResult>(h => capture.Completed += h, h => capture.Completed -= h)
.Select(ev => ev.EventArgs)
.Catch(Observable.Empty<PhotoResult>())
.Select(res => new { VM = mmo, Result = res })
.Take(1)
.Replay(1);
results.Connect();
try {
capture.Show();
}
catch (InvalidOperationException) {
}
return results;
})
.Where(tuple => tuple.VM != null
&& tuple.Result != null
&& tuple.Result.TaskResult == TaskResult.OK)
.Do(tuple => {
tuple.VM.Model.Uri = ImageStore.StoreImage(tuple.VM.Model.NewFileName(), tuple.Result);
})
.Select(t => t.VM as IElementVM<MultimediaObject>)
.ToMessage(Messenger, MessageContracts.SAVE);
}