0

I have two images, the first one is a foreground and the second one is the background. I want to merge both of them into a single Image.I want to be able to drag and drop the frontImage into only the background is it possible ?

Lebyrt
  • 1,376
  • 1
  • 9
  • 18
user2858284
  • 71
  • 1
  • 9

1 Answers1

0

This can be super easy.

For example - You have a parent UIView and two image views:

UIView *_baseView; //as big as the screen.

UIImageView *_backgroundImageView; //as a subview on _baseView

UIImageView *_frontImageView; //as a subview on _baseView

Then You implement some kind of UIImageView movement by finger (for example How do you make an image follow your finger in objective-c? or search for something similar to know how to move UIView objects around if You don't know yet how).

And - once You release Your finger - You can take a screenshot from _baseView and get the image, where two subview ImageViews are combined in a way.

(How Do I Take a Screen Shot of a UIView? or search something similar).

If You don't like, that You have to take screenshot of _baseView, You could also add frontImageView as a subview to background image view and get the screenshot from backgroundImageView.

Hope this idea helps.

Community
  • 1
  • 1
Guntis Treulands
  • 4,764
  • 2
  • 50
  • 72