I was previosuly using WriteableBitmapEX library for cropping images whereever my mouse moves. It seems to be a bit slow.
I want to crop the image at any random pixels and I want to asssign that cropped region to another image control .
My problem is when I am using the clip property , I am only getting the clipped region left and the whole image is going. I want the image completely to be in the background but the cropped region should be assigned to the image control .
Here's the code .
private void Image1_Tapped(object sender, TappedRoutedEventArgs e)
{
int CropArea = 50;
int PointShift = CropArea / 2;
var _rect = new RectangleGeometry();
Point pt;
pt = e.GetPosition(Image1);
_rect.Rect = new Rect(pt.X - PointShift, pt.Y - PointShift, 100, 100);
Image1.Clip = _rect;
MagnifyTip.Image1.Source=Image1.clip; //This is what I want to do . Its not happenning.
}
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Image x:Name="Image1" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Center" Tapped="Image1_Tapped" >
<Image.Source >
<BitmapImage UriSource="Assets/Jellyfish.png" />
</Image.Source>
</Image>
</Grid>
Any better solutions are welcomed becuase I have to keep on moving my finger around the image and get the updated pixel by pixel cropped image in my imagebox in my user control