CommunityToolkit / WindowsCommunityToolkit

The Windows Community Toolkit is a collection of helpers, extensions, and custom controls. It simplifies and demonstrates common developer tasks building .NET apps with UWP and the Windows App SDK / WinUI 3 for Windows 10 and Windows 11. The toolkit is part of the .NET Foundation.
https://docs.microsoft.com/windows/communitytoolkit/
Other
5.89k stars 1.38k forks source link

ImageCropper creates artifacts when switching between images #3708

Open jhwheuer opened 3 years ago

jhwheuer commented 3 years ago

I am using ImageCropper in an app that allows the user to crop multiple bitmaps before submitting the changes in one batch. The user needs to switch between bitmaps.

I let her select bitmaps through a ListView. Every time the ListView has a new SelectedItem, I grab the current CroppedRegion off the ImageCropper and store it with the bitmap instance. Then I load the newly selected bitmap into ImageCropper and try to set the cropped rect. The bitmap initializes the stored Crop to 0/0/Width/Height...

When switching between bitmaps I notice that the ImageCropper produces wrong crop rectangles and sometimes even artifacts of underlying canvas pixels... Do I need to wait for the load and process to finish???

Anything I am not getting?

Maybe it would be a good idea to make two changes:

  1. Give LoadImageFromFile() an optional parameter Rect? that identifies a desired cropped region
  2. Raise an event every time the user changes the Crop so that the app can track changes by the user

This was posted as a bug in https://github.com/MicrosoftDocs/WindowsCommunityToolkitDocs/issues/400 and was suggested to be posted here as well...

ghost commented 3 years ago

Hello jhwheuer, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

Kyaa-dost commented 3 years ago

Thanks, @jhwheuer for bringing this here. Looping in @HHChaos to provide insight on this scenario 🤔

ghost commented 3 years ago

This issue has been marked as "needs attention 👋" due to no activity for 15 days. Please triage the issue so the fix can be established.

michael-hawker commented 3 years ago

@HHChaos any thoughts on what might be going on here?