Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-23-2011, 04:36 AM   #1 (permalink)
Nos
Registered Member
 
Join Date: Aug 2008
Posts: 132
Nos is on a distinguished road
Default How to realize an intermediate view to crop a UIImage

I would like to realize an intermediate view that allow the user to define a specific area to crop an image.

I would like to realize it the same view as in the attached image.
The user can interact with 4 corners and define a square on the uiimage.

Is there any tutorial to realize it anywhere ?

Is there anyone can help me ?

Best regards,

Nos
Nos is offline   Reply With Quote
Old 11-23-2011, 04:40 AM   #2 (permalink)
Nos
Registered Member
 
Join Date: Aug 2008
Posts: 132
Nos is on a distinguished road
Default

It's better with the attached image :

Last edited by Nos; 11-23-2011 at 04:42 AM.
Nos is offline   Reply With Quote
Old 11-23-2011, 11:37 AM   #3 (permalink)
almostfunnydev
iPhone Dev SDK Supporter
 
rocotilos's Avatar
 
Join Date: Oct 2009
Age: 34
Posts: 3,015
rocotilos is on a distinguished road
Default

This is way above my capability. But you might wanna search around for "Augmented Reality".
rocotilos is offline   Reply With Quote
Old 11-23-2011, 01:41 PM   #4 (permalink)
Nos
Registered Member
 
Join Date: Aug 2008
Posts: 132
Nos is on a distinguished road
Default

I just want to realize a view to select a specific area on uiimage to crop after, not use augmented reality
Nos is offline   Reply With Quote
Old 12-01-2011, 08:31 AM   #5 (permalink)
Nos
Registered Member
 
Join Date: Aug 2008
Posts: 132
Nos is on a distinguished road
Default

I found a solution by myself

Best regards
Nos is offline   Reply With Quote
Old 12-01-2011, 09:25 AM   #6 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by Nos View Post
I found a solution by myself

Best regards
Cool. I'm glad you found a solution. Why not describe what you did for others to use?

Were you able to do the crop yourself? That's actually pretty easy.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is online now   Reply With Quote
Old 12-01-2011, 11:04 AM   #7 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

however you can start from something like that

https://github.com/barrettj/BJImageCropper
__________________
dany_dev is offline   Reply With Quote
Old 12-02-2011, 03:39 AM   #8 (permalink)
Nos
Registered Member
 
Join Date: Aug 2008
Posts: 132
Nos is on a distinguished road
Default

The code given isn't perfect but it works.
To realize an intermediate view to select a zone in a UIImageView, i created a class named CanVasView as a subview of UIView that you can see in the attach file (the image of the 4 buttons must have a size of 60x60 pixels in HD mode).
To use it for example, you can declare a UIViewController with a UIImage, a UIImageView with a black background color and alpha to 0.5 and add as subview CanVasView with the same frame as the view of the UIViewController. To crop the UIImage, you must use the canVasFrame of the CanVasView and the function croppedImage of the UIImage+Resize class in the attach file. If you use the camera of the iPhone to take photo and initialize your UIImage of your UIImageView with the photo taken, don't forget to resize to the exactly size of your UIImageView before cropping because the photo given by the camera is HD.

Best regards,
Attached Files
File Type: zip CanVasView+Cropping.zip (7.3 KB, 45 views)
Nos is offline   Reply With Quote
Old 01-02-2012, 06:30 AM   #9 (permalink)
Registered Member
 
Join Date: Jan 2012
Posts: 1
lilly12346 is on a distinguished road
Default

Can you please upload a sample project.
I don't get it started.
lilly12346 is offline   Reply With Quote
Reply

Bookmarks

Tags
iphone

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 408
14 members and 394 guests
7twenty7, chiataytuday, Clouds, dedeys78, Duncan C, e2applets, EvilElf, iekei, ipodphone, leostc, Murphy, QuantumDoja, sacha1996, Sami Gh
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,125
Posts: 402,910
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:36 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0