private void button1_Click(object sender, RoutedEventArgs e) { CameraCaptureTask task = new CameraCaptureTask(); task.Completed += (s, evt) => { if (evt.Error == null && evt.TaskResult == TaskResult.OK) { bmpImage.SetSource(evt.ChosenPhoto); image1.Source = bmpImage; } }; task.Show(); }
// Create an Image element. Image croppedImage = new Image(); croppedImage.Width = 200; croppedImage.Margin = new Thickness(5); // Create a CroppedBitmap based off of a xaml defined resource. CroppedBitmapcb = new CroppedBitmap( (BitmapSource)this.Resources["masterImage"], new Int32Rect(30, 20, 105, 50)); //select region rect croppedImage.Source = cb; //set image source to cropped
using System.Windows.Media.Imaging;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)