0

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

Emon
  • 33
  • 4

1 Answers1

0

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

Community
  • 1
  • 1
dreamzor
  • 5,795
  • 4
  • 41
  • 61
  • thank you for your answer. 'attached' mean concatenate/merge/blend 3 UIImageView.because after import all image in each UIImageView i will make it one imageview and will save in the photo gallery again. – Emon Oct 04 '12 at 06:08
  • Thanks for the link..let me check.if it is sufficient for me then i will accept your answer. – Emon Oct 04 '12 at 07:51