Resize and Crop

contoystudio

Member
Licensed User
Longtime User
Hi,
I'd like to know if exist a library/class that permit to crop/resize an image through given proportions. Something like android does when we change background in the homescreen.

Thank you in advance
 

Douglas Farias

Expert
Licensed User
Longtime User
for example i can move the crop to negative sizes
have a way to set minimal value in % ?

for exemple if rect is 20%x cant move - 20% it
have a big bug when u make a small crop *-*

i need set minimal rect is
left 10%x
right 90%x
top 10%y
bottom 90%y

user can change this size to < value only to >
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
You must be more precise in your questions !
Again, what application are you refering to ?
Do you already have some code ?
General answer:
If you define the width or height of the crop rectangle anywhere in your program limit their values, max or min.
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
Attached you find a modified version with min width and height.
The original examples above croped to a square (the original request), the project below crops a rectangle.
A more recent version ResizeAndCrop5 includes get the croped image and save it.
 

Attachments

  • ResizeAndCrop4.zip
    52.6 KB · Views: 625
  • ResizeAndCrop5.zip
    53.2 KB · Views: 500
Last edited:
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
@klaus hi man
how its possible clean the canvas to save another image witout zoom?

when you press a button to save the image this save the image and make a zoom in the image its possible remove this zoom later file save?

what i need clean to remove this? canvas?
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Here you are.
The new version gets the croped image and can save it
Attached a modified version.

The latest version is HERE.
 

Attachments

  • ResizeAndCrop5.zip
    53.2 KB · Views: 597
Last edited:
Upvote 0
Top