Android Question [Solved] Resize and Crop - Square Image

asales

Expert
Licensed User
Longtime User
I'm using this code from @klaus (thanks!):
https://www.b4x.com/android/forum/threads/resize-and-crop.82436/#post-522422
to crop an image and works fine (image1), but not if I use a square image (2):
(1) 1.jpg (2)2.jpg

If I use a square image (same width and height) I don't see the yellow markers to resize and crop the image in portrait mode.

I tried to change the code (MaxHeight, MaxWidth, etc.), but I don't figure out how to see the markers and crop the square image.

The original code with the square image is in attached.

Thanks in advance for any tip to fix this problem.
 

Attachments

  • ResizeAndCrop6a.zip
    102.4 KB · Views: 473

klaus

Expert
Licensed User
Longtime User
Here you have a new version which handles also square images.
The code has been improved managing images with any width/height ratio in both orientations.
You find it HERE.
 
Last edited:
Upvote 0
Top