Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- An unhandled exception of type 'System.ArgumentException' occurred in PresentationCore.dll
- Additional information: Value does not fall within the expected range.
- Rect rect1 = new Rect(Canvas.GetLeft(selectionRectangle), Canvas.GetTop(selectionRectangle), selectionRectangle.Width, selectionRectangle.Height);
- System.Windows.Int32Rect rcFrom = new System.Windows.Int32Rect();
- rcFrom.X = (int)((rect1.X) * (image1.Source.Width) / (image1.Width));
- rcFrom.Y = (int)((rect1.Y) * (image1.Source.Height) / (image1.Height));
- rcFrom.Width = (int)((rect1.Width) * (image1.Source.Width) / (image1.Width));
- rcFrom.Height = (int)((rect1.Height) * (image1.Source.Height) / (image1.Height));
- **BitmapSource bs = new CroppedBitmap(image1.Source as BitmapSource, rcFrom);**
- image2.Source = bs;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement