Allow Image Rotation in ImageCropper Control #3965
Replies: 24 comments
-
Hello Hakobyan888, thank you for your interest in Windows Community Toolkit! 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 answer the question and provide feedback 🙌 |
Beta Was this translation helpful? Give feedback.
-
@michael-hawker is the image rotation feature feasible in ImageCropper control? |
Beta Was this translation helpful? Give feedback.
-
@Hakobyan888 could you give a bit more details for your scenario? The ImageCropper's original design intent was to allow for creating circular or rectangular crops for profile images or other image reductions. Are you wanting to be able to rotate the rectangular crop area and then get that area with like solid/transparent pixels outside of the crop area? Where would you use the resulting image? Thanks! |
Beta Was this translation helpful? Give feedback.
-
@michael-hawker my goal is to rotate image and the cropping rect will maximally fit init and the rect could not get out of rotated image bounds. Is it possible to integrate this scenario to ImageCropper control. Thanks!! |
Beta Was this translation helpful? Give feedback.
-
Thanks @Hakobyan888, I saw your question on stackoverflow when searching for an example image. That level of detail with the images like this helps with these types of requests: @HHChaos you know the insides and out of this control - think you could give some pointers here? I could see a property like |
Beta Was this translation helpful? Give feedback.
-
Please let me know if there are any solutions. |
Beta Was this translation helpful? Give feedback.
-
I think this is outside the scope of a cropping control. When editing photos you take a multi-step approach. One step is rotating, one step for cropping, one step for filters, etc. Rotating an image while cropping it would create rotated images when one isn't wanted. Or cropped areas when trying to rotate. |
Beta Was this translation helpful? Give feedback.
-
If the crop and rotate would work like the image above I don't think that there would be any problems you mentioned. So I would like to know is it possible to add rotation feature to ImageCropper Control. |
Beta Was this translation helpful? Give feedback.
-
I going we're going to have to disagree here. Users will find a way to get themselves into trouble. You'd have to turn rotation on/off or cropping on/off and then it's no different than what I described above having a multi-step approach. |
Beta Was this translation helpful? Give feedback.
-
https://drive.google.com/file/d/1LhVEq9bLJqr8gisbTLfVFs_J4z0EStAn/view?usp=sharing Here is the video of what I'm trying to get. |
Beta Was this translation helpful? Give feedback.
-
@skendrot it may well be something beyond what we want to have natively supported by the control. I agree in most scenarios the UX is tricky and generally broken up into different 'modes', so we probably don't want to define any of that behavior and functionality as part of the control (which I think is your main point). However, this scenario from @Hakobyan888 of cropping a rectangle out of a polygonal type surface (in this case the rotated image) is still valid, we should at least figure out how to better support keeping the bounds of the cropped region within the confines of a polygon vs. a traditional 90-deg only rectangle. How the image gets rotated by the user and manipulated by them can still be out of scope and be left to the developer (e.g. combining with a slider in the video above). @HHChaos how much work do you think it'd be in order to confine the thumbs to be within any general polygon vs. the rectangle it uses today? |
Beta Was this translation helpful? Give feedback.
-
@michael-hawker I don't see any requests to rotate the rectangle. Only rotate the image.
|
Beta Was this translation helpful? Give feedback.
-
@skendrot yes the image should be rotated only. The rectangle should be like the presented image or video. |
Beta Was this translation helpful? Give feedback.
-
@skendrot yes, sorry I meant to refer to the image there not the thumb selector, I'll update my comment. |
Beta Was this translation helpful? Give feedback.
-
I'm sorry when the feature will be added approximately? |
Beta Was this translation helpful? Give feedback.
-
Sorry, the reply is a bit late. I understand that this ability should be very useful in some cases, and it is also available in the image editor of most platforms. I have considered this problem before and have planned to increase this ability. But for other reasons, I didn't have time to do it. I will try it if I have time on the following weekend, but I can't guarantee when it will be completed. Of course, contributions from other developers are very welcome. |
Beta Was this translation helpful? Give feedback.
-
Thanks @HHChaos understand that you're busy, no problem at all. When you have a minute though if you had any pointers on where someone might get started working on this type of scenario within the control (like where the bounds for the thumbs are restricted), that could be handy. @Hakobyan888 would you be interested in trying to solve this problem and contribute a PR to the Toolkit to allow the control to optionally track a different bounding box than the image? (Again, we wouldn't want the control itself to do the rotation aspect, just be able to support clipping to it afterwards.) |
Beta Was this translation helpful? Give feedback.
-
Yes, of course, I would like to solve this problem but as you said I need some pointers to start doing it. So I'll wait for some help. |
Beta Was this translation helpful? Give feedback.
-
@HHChaos could you give me some tips for adding rotation functionality to ImageCropper, please. |
Beta Was this translation helpful? Give feedback.
-
Hi @Hakobyan888, I have a few useful tips here:
I think it is difficult to calculate the _restrictedCropRect of the rotated image, and moving the image should also change this value. |
Beta Was this translation helpful? Give feedback.
-
@Hakobyan888 did you try utilizing the tips @HHChaos provided above ? and if that solved the issue please let us know. |
Beta Was this translation helpful? Give feedback.
-
@Hakobyan888 can you please provide an update on this issue? Did the tips provided by @HHChaos help you pave the way for the feature? |
Beta Was this translation helpful? Give feedback.
-
@Kyaa-dost Actually I tried but I couldn't do it |
Beta Was this translation helpful? Give feedback.
-
@StepanHokobyan I will leave this open for now and see if anyone wants to pick this up. |
Beta Was this translation helpful? Give feedback.
-
Hello.
I'm using ImageCropper Control but I would like to add image rotation to can you tell me what I should do to add that.
Example:
Beta Was this translation helpful? Give feedback.
All reactions