How to merge two UIImages?

Hope this may help you, var bottomImage = UIImage(named: “bottom.png”) var topImage = UIImage(named: “top.png”) var size = CGSize(width: 300, height: 300) UIGraphicsBeginImageContext(size) let areaSize = CGRect(x: 0, y: 0, width: size.width, height: size.height) bottomImage!.draw(in: areaSize) topImage!.draw(in: areaSize, blendMode: .normal, alpha: 0.8) var newImage:UIImage = UIGraphicsGetImageFromCurrentImageContext()! UIGraphicsEndImageContext() All the Best 🙂

Replace a particular color inside an image with another color

You have to iterate through each pixel in the image and take its rgb values Check its rgb values matches your fromColor rgb values, if yes change the pixel value to your toColor rgb values.If not, just leave that pixel and go to next one.. Wrote a function from memory..errors possible..correct yourself -(UIImage*)changeColor:(UIImage*)myImage fromColor:(UIColor*)fromColor toColor:(UIColor*)toColor{ … Read more

How to attach Image with message via iPhone application?

This is not possible with the current MessageUI API: the MSMessageComposeViewController doesn’t accept attachments like the MFMailComposeViewController does. The only way to do this currently is to use an external service that allows you to send mms via a REST call for example. GSMA defines a REST specification for exactly this purpose: http://www.gsmworld.com/oneapi/reference_documentation-version_1.html (multiple pdf’s … Read more

How can I convert FBProfilePictureView to an UIImage?

FBProfilePictureView is a UIView, this UIView contains a UIImageView, that is your image, you can get the UIImage from that UIImageView: profilePictureView is a FBProfilePictureView UIImage *image = nil; for (NSObject *obj in [profilePictureView subviews]) { if ([obj isMemberOfClass:[UIImageView class]]) { UIImageView *objImg = (UIImageView *)obj; image = objImg.image; break; } } EDIT: add another … Read more

Need to capture UIView into a UIImage, including all subviews

That’s the right way to go: + (UIImage *) imageWithView:(UIView *)view { UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, [[UIScreen mainScreen] scale]); [view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage * img = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return img; } This method is an extension method for UIImage class, and it will also take care of making the image looks good on any future high-resolution devices.

iPhone, “More than maximum 5 filtered album lists trying to register. This will fail.” Error

I think you are not checking the source type. You might be doing self.sourceType =UIImagePickerControllerSourceTypePhotoLibrary; If this is the case, then you have to check the source type before assigning it directly. like if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypePhotoLibrary]) { // Set source to the Photo Library self.sourceType =UIImagePickerControllerSourceTypePhotoLibrary; } I hope it helps