resize an imageview with two fingers iPhone - iphone

In my application users can load/take a photo, put it into a frame and move, rotate and scale it as they want.I know how use a uiScrollView as a normal view and load inside of it an image, but in this case the image is large as the view, and i want it is large as i want. How can i do this?

for moving and scaling an image.you can just use the following default picker function in UIImagepicker.
picker.editing =YES;

Related

Swift: hot to pan and zomm in/out image inside imageView

In ViewController I have a big ImageView whose image is captured with a ImagePicker. I want the user to be allowed to zoom in/out the image and then pan it but always inside the ImageView dimensions which must not enlarge, move or dwindle. I have seen I could add a ScrollView to ImageView but I can't figure out how to do that.
Moreover: is it possible to zoom in/out more than one ImageView at a time? I mean I have some smaller imageViews floating upon a bigger imageView. Is it possible to zoom everything all together?
There are plenty of excellent scrollview demo's around.
These will show you where and how to add override functions to implement what you need...
If you have different UIImage Views you can set the zoom programmatically to match the image being "zoomed" ... try experimenting with [UIImage].zoomScale. and the image offset. Its going to get complicated if they are different sizes as you will have to take account of scale when mirroring offset and zoom changes.

How can i make multiple customized uiimageview frame in one view?

I have to make view where there will be multiple curved or irregular shaped imageview. Now when i will touch a UIImageview then it will import image from photo gallery.For example: Suppose
I have an UIView with background image.
On that view i have 3 irregular shaped UIImageview.every UIImageview is attached with each other.
Now suppose i have touch in the first UIImageview then it will take an image from photo gallery.
When i have imported the image then that image will be as the background image of the UIImageview.
I have to make sure that if my UIImageviewis smaller then its background image then i will able to move the image or rotate the image or scale or zoom the image to adjust the image according to the size of UIImageview.
How can i do that whole process??? any help by link,source code,tutorial or anything else will be cordially appreciable.
Basically my first priority is that how can i make those irregular shaped UIImageView pro-grammatically.
IF ANY FURTHER QUERY TO ASK THEN PLEASE DON'T HESITATE.
Thanks In Advance
The one way of doing this is as follows:
Subclass from UIImageView set touchesBegan methods for each UIImageView for import image, setting on background and whatever you want to do on touch.
What does 'attached' mean? If all of them should move together, then, again, you have to deal with it in touchesBegan methods, sending messages like 'Hey views, i've moved on this vector:[vector], please do it too'.
In pt. 3.2 i didn't get your point. :( You can set in UIImageView subclass self.contentMode = UIViewContentModeScaleAspectFit or UIViewContentModeScaleToFill, so its image will always fit the view.
About irregular shape, did you read links below? I suppose there's not an super easy way to do it :(
http://www.iphonedevsdk.com/forum/iphone-sdk-development/76923-hittest-collision-for-irregular-shaped-uiviews.html
Draggable UIImageView Partially Transparent & Irregular Shaped
Simple way of using irregular shaped buttons

Possible to Limit Zooming / Panning Area in UIScrollView?

I have a UIViewController that implements a UIScrollView with the UIScrollViewDelegate. Attached to it is an UIImageView for which the user must crop the photo via zooming it and panning to fill the entire length of the screen. After the user has finished cropping and they hit done, the original UIImage gets sent to the next UIViewController.
I'm wondering, is there anyway, using the original image, to display it in a UIScrollView and allow the user to zoom and pan it so ONLY the cropped area gets shown? IE none of the image that was outside of the cropped area gets shown in zooming and panning? Is there a way to do this without explicitly cropping the image?
This might head you in the right direction: Displaying part of an image
Not to sure if this will work with the way you are displaying it. But if it does it could be a simple solution. You can also read through UIScrollviews and maybe use panGestureRecognizer and pinchGestureRecognizer to limit the area they can zoom and pan.
Set the content size of the UIScrollView to the rect of the cropped area.

Combining two UIImageView to an UIImage with respect to their current size, rotation and positions

In one of my apps I am trying to combine two UIImageViews into a single UIImage. Bottom one is from the camera and the top one is something like a badge. The user can drag, rotate and scale the one at the top.
My question is, how can i save these two UIImageViews into a single UIImage at the end of all drag, rotate and scale operations?
Edit: I want to keep the original size of the bottom image.
This post : Saving UIView contents in iOS 4 with real size of the images inside (i.e. scale contentes up for save) shows how you can get a UIImage from any UIView.
Basically, you can adapt its solution, using a UIView container for your 2 UIImageViews.

UIImageView, UIView, taking a segment of a picture

I want to take an image from the UIImagePickerController and put it on a UIImageView that can move based on touch. I'm not sure how to get the picture onto the UIImageView. I thought the UIImageView automatically resizes the picture, so I couldn't grab just the top half of the picture and put that on the UIImageView. Is there an easy way to do this? thanks!
Use CGImageCreateWithImageInRect to crop (take a segment of?) a picture. Put a UIImageView inside a UIScrollView to let the user scroll through (move based on touch) a large image.
if you want to move and zoom your picture in a view, you need to use a UIScrollView. See Apple's ScrollViewSuite example. If you simply want to position the picture within a UIImageView, set the contentMode of the UIImageView to the setting you want e.g. scale, top, left, etc. See the UIImageView documentation for all options.