本文整理汇总了C#中PhotoChooserTask.Show方法的典型用法代码示例。如果您正苦于以下问题:C# PhotoChooserTask.Show方法的具体用法?C# PhotoChooserTask.Show怎么用?C# PhotoChooserTask.Show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhotoChooserTask
的用法示例。
在下文中一共展示了PhotoChooserTask.Show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例2: GetImageFromGallery
private void GetImageFromGallery(object obj)
{
PhotoChooserTask photoChooserTask = new PhotoChooserTask();
photoChooserTask.Show();
photoChooserTask.Completed += new EventHandler<PhotoResult>(photoChooserTask_Completed);
}
示例3: 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();
}
示例4: 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;
}
示例5: 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();
}
示例6: Choose_Click
private void Choose_Click(object sender, EventArgs e)
{
var task = new PhotoChooserTask();
task.ShowCamera = true;
task.Completed += chooserTask_Completed;
task.Show();
}
示例7: 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);
}
示例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();
}
示例9: 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;
}
示例10: SelectPhoto
/// <summary>
/// select photo
/// </summary>
public void SelectPhoto()
{
PhotoChooserTask photoChooserTask = new PhotoChooserTask();
photoChooserTask.Completed += SelectPictureComplete;
photoChooserTask.ShowCamera = true;
photoChooserTask.Show();
}
示例11: upload_Click
private void upload_Click(object sender, EventArgs e)
{
PhotoChooserTask pct = new PhotoChooserTask();
pct.ShowCamera = true;
pct.Completed += pct_Completed;
pct.Show();
}
示例12: Button_Click_1
private void Button_Click_1(object sender, RoutedEventArgs e)
{
try
{
PhotoChooserTask photoChooserTask = new PhotoChooserTask();
photoChooserTask.Completed += (ee,s)=>
{
//DirectX context should be recreate before cereate the texture
Dispatcher.BeginInvoke(() =>
{
WriteableBitmap bmp = new WriteableBitmap(1,1);
bmp.SetSource(s.ChosenPhoto);
m_d3dInterop.CreateTexture(bmp.Pixels, bmp.PixelWidth, bmp.PixelHeight);
MessageBox.Show("Picture loaded with c#");
});
};
photoChooserTask.Show();
}
catch(Exception exp)
{
}
}
示例13: LibraryButtonClick
private void LibraryButtonClick(object sender, EventArgs e)
{
var task = new PhotoChooserTask();
task.Completed += OnPhotoChooserTaskCompleted;
task.ShowCamera = true;
task.Show();
}
示例14: Button_Click_1
private void Button_Click_1(object sender, RoutedEventArgs e)
{
PhotoChooserTask photoChooserTask = new PhotoChooserTask();
photoChooserTask.PixelHeight = 400;
photoChooserTask.PixelWidth = 200;
photoChooserTask.Completed += photoChooserTask_Completed;
photoChooserTask.Show();
}
示例15: Button_Click_2
private void Button_Click_2(object sender, RoutedEventArgs e)
{
var photoChooser = new PhotoChooserTask();
photoChooser.PixelHeight = 170;
photoChooser.PixelWidth = 170;
photoChooser.Completed += photoChooser_Completed;
photoChooser.Show();
}