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
 

contoystudio

Member
Licensed User
Longtime User
I'd like to do exactly what android (or apps like instagram) does when you pick an image from gallery and want set it as bg image (or want to share it in instagram): they force you to crop that image, for example instagram wants only square images.
Instagram screen shot: http://cdn.guidingtech.com/assets/postimages/2012/04/Instagram-for-Android-crop-image.png

I'm trying to do io manually with panel's touch event, but it's a little complex and I'd like to know if someone already done this job.

Thanks

[Edit: something like this https://github.com/lorensiuswlt/AndroidImageCrop]
 
Last edited:
Upvote 0

contoystudio

Member
Licensed User
Longtime User
Ok thank you.
The most complex part for me is to implement the dynamic crop rectangle. Im using a moveable panel and other 4 small panel on its borders for resizing it, with the touch event. Im on the right way?
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
I would probably do with a transparent panel on top, use it's touch event to move the edges of the crop rectangle doing all this graphicaly.
If you want you can post your code and I'll have a look at it.

Best regards.
 
Last edited:
Upvote 0

contoystudio

Member
Licensed User
Longtime User
Now i have a panel on top, but i have other 4 small panel for resize it, cause in the touch event of the panel i put coding for moving it, not resizing. The other 4 small panels have coding for resizing. Is there another way to do this without these 4 small panels? I will post my test code asap.

Sorry for bad english if you cant understand, im from italy. Thank you very much for your help.

[Edit: Project attached, is only a test for the dynamic crop/resize rect. There are still some bugs, i'm working on it.]
 

Attachments

  • resizeAndCropTest.zip
    7.2 KB · Views: 1,123
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
I have begun to look at your project but not finished yet.
This afternoon I'm leaving my home for a few days to the mountains for hiking till the end of the week.
I'll come back when I get home.

Best regards.
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
Hi,

I'm back home.

I joined a picture from my hike on Tuesday above the Aletsch glacier.

Attached you find my vision of resizing an image.
I haven't tested all possible configurations.
There is no graphics showing what function is active but could be added.

Best regards.
 

Attachments

  • ResizeAndCrop.zip
    52.3 KB · Views: 1,378
  • ResizeAndCrop.jpg
    ResizeAndCrop.jpg
    39.6 KB · Views: 1,167
  • AletschGlacier.jpg
    AletschGlacier.jpg
    70.7 KB · Views: 1,054
Upvote 0

contoystudio

Member
Licensed User
Longtime User
Hi,

I'm back home.

I joined a picture from my hike on Tuesday above the Aletsch glacier.

Attached you find my vision of resizing an image.
I haven't tested all possible configurations.
There is no graphics showing what function is active but could be added.

Best regards.

Thank you very much.
It's perfect, only one question:
How can i add a marker on angles?

Thanks.
 
Upvote 0

cmartins

Member
Licensed User
Longtime User
I am trying to change some things in the code but I cannot move the imageviews or change the size. How can I use the drawbitmap in different imageview sizes?
 

Attachments

  • resizeCrop.zip
    58.2 KB · Views: 762
Upvote 0
Top