• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# PhotoChooserTask类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中PhotoChooserTask的典型用法代码示例。如果您正苦于以下问题:C# PhotoChooserTask类的具体用法?C# PhotoChooserTask怎么用?C# PhotoChooserTask使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PhotoChooserTask类属于命名空间,在下文中一共展示了PhotoChooserTask类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: button1_Click

 private void button1_Click(object sender, RoutedEventArgs e)
 {
     image1.Source = null;
     PhotoChooserTask objPhotoChooser = new PhotoChooserTask();
     objPhotoChooser.Completed += new EventHandler<PhotoResult>(PhotoChooseCall);
     objPhotoChooser.Show();
 }
开发者ID:aabrohi,项目名称:kinect-kollage,代码行数:7,代码来源:UploadPage.xaml.cs


示例2: OnNavigatedTo

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            if (pixelatedImage.Source == null && e.IsNavigationInitiator)
            {
                var task = new PhotoChooserTask();
                task.Completed += OnPhotoChooserTaskCompleted;
                task.ShowCamera = true;
                task.Show();
            }

            if (pixelationListBox.Items.Count == 0)
            {
                pixelationListBox.Items.Add(3);
                pixelationListBox.Items.Add(4);
                pixelationListBox.Items.Add(5);
                pixelationListBox.Items.Add(6);
                pixelationListBox.Items.Add(7);
                pixelationListBox.Items.Add(8);
                pixelationListBox.Items.Add(9);
                pixelationListBox.Items.Add(10);
            }

            var pixelateSize = new PixelationSizeQuery().Get();
            pixelationListBox.SelectedItem = pixelateSize; // TODO: don't work
            pixelationListBox.SelectionChanged += OnPixelationListBoxSelectionChanged;
            _pixelator = new Pixelator(pixelateSize, false);

            sliderDebug.ValueChanged += OnSliderDebugValueChanged;
        }
开发者ID:petermorlion,项目名称:EightBitCamera,代码行数:30,代码来源:Existing.xaml.cs


示例3: PickPhoto

        public Task<byte[]> PickPhoto()
        {
            var taskCompletionSource = new TaskCompletionSource<byte[]>();
            var task = new PhotoChooserTask();
            task.ShowCamera = false;
            task.PixelWidth = 300;
            task.PixelHeight = 300;
            task.Completed += (s, e) =>
                {
                    if (e.TaskResult == TaskResult.OK && e.ChosenPhoto != null)
                    {
                        using (var ms = new MemoryStream())
                        {
                            e.ChosenPhoto.CopyTo(ms);
                            ms.Position = 0;
                            taskCompletionSource.TrySetResult(ms.ToArray());
                        }
                    }
                    else
                    {
                        taskCompletionSource.TrySetResult(null);
                    }
                };
            task.Show();

            return taskCompletionSource.Task;
        }
开发者ID:alancaetano,项目名称:AgendaOnline,代码行数:27,代码来源:PhotoPicker.cs


示例4: MovieDetailsPage

        public MovieDetailsPage()
        {
            InitializeComponent();

            photoTask = new PhotoChooserTask();
            photoTask.Completed += new EventHandler<PhotoResult>(photoTask_Completed);
        }
开发者ID:GregOnNet,项目名称:WP8BookSamples,代码行数:7,代码来源:MovieDetailsPage.xaml.cs


示例5: MainPage

 // Constructor
 public MainPage()
 {
     InitializeComponent();
     library = new MediaLibrary();
     photoChooser = new PhotoChooserTask();
     photoChooser.Completed += photoChooser_Completed;
 }
开发者ID:GregOnNet,项目名称:WP8BookSamples,代码行数:8,代码来源:MainPage.xaml.cs


示例6: OnSendImage

	    private void OnSendImage(object sender, RoutedEventArgs e)
	    {
            var task = new PhotoChooserTask();
            task.ShowCamera = true;
            task.Completed += async (s, r) =>
            {
                if (r.TaskResult == TaskResult.OK)
                {
                    try
                    {
                        var request = new HttpPostRequest("http://yourdomain.com/Upload");
                        request.ContentType = "multipart/form-data";
                        request.Data.Add("vve", "VvE Naam");                                
                        request.Files.Add(new HttpPostFile("image", "image", r.ChosenPhoto)); 
                        
                        //// TODO: Add pr
                        var response = await Http.PostAsync(request);
                        MessageBox.Show(response.Response);
                    }
                    catch (Exception exception)
                    {
                        MessageBox.Show(exception.Message);
                    }
                }
            };
            task.Show();
	    }
开发者ID:RareNCool,项目名称:MyToolkit,代码行数:27,代码来源:SamplePage.xaml.cs


示例7: Foto

        public Foto()
        {
            InitializeComponent();

            photoChooserTask = new PhotoChooserTask();
            photoChooserTask.Completed += new EventHandler<PhotoResult>(photoChooserTask_Completed);
        }
开发者ID:andreloty,项目名称:wrumble,代码行数:7,代码来源:Foto.xaml.cs


示例8: btnLibrary_Tapped

 private void btnLibrary_Tapped(object sender, System.Windows.Input.GestureEventArgs e)
 {
     PhotoChooserTask photo = new PhotoChooserTask();
     photo.Completed += photo_Completed;
     photo.ShowCamera = true;
     photo.Show();
 }
开发者ID:serij10,项目名称:windows8_projects,代码行数:7,代码来源:MainPage.xaml.cs


示例9: photo_Click

 private void photo_Click(object sender, RoutedEventArgs e)
 {
     PhotoChooserTask ptsk = new PhotoChooserTask();
     ptsk.ShowCamera = true;
     ptsk.Show();
     ptsk.Completed += new EventHandler<PhotoResult>(ptsk_Completed);
 }
开发者ID:ahmeda8,项目名称:RodeDog,代码行数:7,代码来源:createpack.xaml.cs


示例10: upload_Click

 private void upload_Click(object sender, EventArgs e)
 {
     PhotoChooserTask pct = new PhotoChooserTask();
     pct.ShowCamera = true;
     pct.Completed += pct_Completed;
     pct.Show();
 }
开发者ID:bootlegrobot,项目名称:awful2,代码行数:7,代码来源:NewPrivateMessagePage.xaml.cs


示例11: btn_Camera_ManipulationCompleted

 private void btn_Camera_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
 {
     PhotoChooserTask pcTask = new PhotoChooserTask();
     pcTask.ShowCamera = true;
     pcTask.Completed += new EventHandler<PhotoResult>(pcTask_Completed);
     pcTask.Show();
 }
开发者ID:GhostSoar,项目名称:JigsawPuzzle,代码行数:7,代码来源:CameraOrPhotosLibrary.xaml.cs


示例12: GetImageFromGallery

 private void GetImageFromGallery(object obj)
 {
     PhotoChooserTask photoChooserTask = new PhotoChooserTask();
     photoChooserTask.Show();
     photoChooserTask.Completed += new EventHandler<PhotoResult>(photoChooserTask_Completed);
     
 }
开发者ID:Handika-GEMkey,项目名称:SolidareNew,代码行数:7,代码来源:ViewModelSetting.cs


示例13: LibraryButtonClick

 private void LibraryButtonClick(object sender, EventArgs e)
 {
     var task = new PhotoChooserTask();
     task.Completed += OnPhotoChooserTaskCompleted;
     task.ShowCamera = true;
     task.Show();
 }
开发者ID:petermorlion,项目名称:EightBitCamera,代码行数:7,代码来源:Existing.xaml.cs


示例14: Setting

        public Setting()
        {
            InitializeComponent();
            photoChooserTask = new PhotoChooserTask();
            photoChooserTask.Completed += photoChooserTask_Completed;
            photoChooserTask.ShowCamera = true;

            viewModel = this.DataContext as SettingViewModel;

            // Get the full collection of items:
            //List<CountdownType> allTypes = TypePicker.ItemsSource as List<CountdownType>;

            //int id;
            //if (viewModel.SelectedCountdownType.Name == "Countdown")
            //    id = 0;
            //else
            //    id = 1;

            //TypePicker.SelectedItems = new ObservableCollection<object>() {
            //    allTypes[id]
            //};

            //unitListPicker.SummaryForSelectedItemsDelegate = ViewModelLocator.SummerizeSelection;
            //unitListPicker.SelectionChanged += ViewModelLocator.UnitSelectionFilter;
            //TypePicker.SummaryForSelectedItemsDelegate = SummarizeTypes;
        }
开发者ID:nishchith,项目名称:CountdownWidgetMaster,代码行数:26,代码来源:Setting.xaml.cs


示例15: MainPage

      // Konstruktor
      public MainPage()
      {
         InitializeComponent();

         // prepare Photo Chooser Task for the open button
         photoChooserTask = new PhotoChooserTask();
         photoChooserTask.Completed += (s, e) => { if (e.TaskResult == TaskResult.OK) ProcessImage(e); };

         // prepare the backround worker thread for the image processing
         scannerWorker = new BackgroundWorker();
         scannerWorker.DoWork += scannerWorker_DoWork;
         scannerWorker.RunWorkerCompleted += scannerWorker_RunWorkerCompleted;

         foreach (var x in typeof(BarcodeFormat).GetFields())
         {
            if (x.IsLiteral)
            {
               BarcodeType.Items.Add(x.GetValue(null));
            }
         }

         // open the default barcode which should be displayed when the app starts
         var uri = new Uri("/images/35.png", UriKind.Relative);
         var imgSource = new BitmapImage(uri);
         BarcodeImage.Source = imgSource;
         imgSource.ImageOpened += (s, e) => scannerWorker.RunWorkerAsync(new WriteableBitmap((BitmapImage)s));
      }
开发者ID:Bogdan-p,项目名称:ZXing.Net,代码行数:28,代码来源:MainPage.xaml.cs


示例16: ChoosePictureFromLibrary

 public void ChoosePictureFromLibrary(int maxPixelDimension, int percentQuality, Action<Stream> pictureAvailable,
                                      Action assumeCancelled)
 {
     // note - do not set PixelHeight = maxPixelDimension, PixelWidth = maxPixelDimension here - as that would create square cropping
     var chooser = new PhotoChooserTask {ShowCamera = false};
     ChoosePictureCommon(chooser, maxPixelDimension, percentQuality, pictureAvailable, assumeCancelled);
 }
开发者ID:JoanMiro,项目名称:MvxMod,代码行数:7,代码来源:MvxPictureChooserTask.cs


示例17: EditParameters

 public EditParameters()
 {
     InitializeComponent();
     photoChooserTask = new PhotoChooserTask();
     photoChooserTask.Completed += photoChooserTask_Completed;
     foo();
 }
开发者ID:ITESO-Ulab,项目名称:EMT_WP,代码行数:7,代码来源:EditParameters.xaml.cs


示例18: Button_Click

        private  void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                PhotoChooserTask task = new PhotoChooserTask();
                task.Completed += async (s, res) =>
                {
                    if (res.TaskResult == TaskResult.OK)
                    {
                       

                       using( var source  = new StreamImageSource(res.ChosenPhoto))
                        using(var renderer = new BitmapRenderer(source,input))
                        {
                            await renderer.RenderAsync();
                        }
                        if(manager != null)
                        {
                            manager.Dispose();
                            manager = null;
                        }
                        manager = new PipelineManager.Manager.PipelineManager(picture);
                        GeneratePicture();
                    }

                };
                task.Show();
            }
            catch (Exception)
            {


            }
        }
开发者ID:Nokia-Developer-Community-Projects,项目名称:wp8-sample,代码行数:34,代码来源:MainPage.xaml.cs


示例19: Choose_Click

 private void Choose_Click(object sender, EventArgs e)
 {
    var task = new PhotoChooserTask();
    task.ShowCamera = true;
    task.Completed += chooserTask_Completed;
    task.Show();
 }
开发者ID:AdamBenoit,项目名称:Windows-Phone-8-In-Action,代码行数:7,代码来源:MainPage.xaml.cs


示例20: 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;
        }
开发者ID:kshark27,项目名称:ZuPix,代码行数:30,代码来源:PicEffect.xaml.cs



注:本文中的PhotoChooserTask类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PhotoPost类代码示例发布时间:2022-05-24
下一篇:
C# PhotoCamera类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap