create images with different different background image
UIImage *face_image = [UIImage imageNamed:@"face.png"];
UIImage *bg_1 = [UIImage imageNamed:@"bg_1.png"];
[bg_1 drawInRect:CGRectMake(0,0,Width_Img, Height_Img)];
[face_image drawInRect:CGRectMake(0,0,Width_Img, Height_Img)];
UIImage *image_1 = UIGraphicsGetImageFromCurrentImageContext();
UIImage *bg_2 = [UIImage imageNamed:@"bg_2.png"];
[bg_2 drawInRect:CGRectMake(0,0,Width_Img, Height_Img)];
[face_image drawInRect:CGRectMake(0,0,Width_Img, Height_Img)];
UIImage *image_2 = UIGraphicsGetImageFromCurrentImageContext();
UIImage *bg_3 = [UIImage imageNamed:@"bg_3.png"];
[bg_3 drawInRect:CGRectMake(0,0,Width_Img, Height_Img)];
[face_image drawInRect:CGRectMake(0,0,Width_Img, Height_Img)];
UIImage *image_3 = UIGraphicsGetImageFromCurrentImageContext();
UIImage *bg_4 = [UIImage imageNamed:@"bg_4.png"];
[bg_4 drawInRect:CGRectMake(0,0,Width_Img, Height_Img)];
[face_image drawInRect:CGRectMake(0,0,Width_Img, Height_Img)];
UIImage *image_4 = UIGraphicsGetImageFromCurrentImageContext();
UIImage *bg_5 = [UIImage imageNamed:@"bg_5.png"];
[bg_5 drawInRect:CGRectMake(0,0,Width_Img, Height_Img)];
[face_image drawInRect:CGRectMake(0,0,Width_Img, Height_Img)];
UIImage *image_5 = UIGraphicsGetImageFromCurrentImageContext();
UIImage *bg_6 = [UIImage imageNamed:@"bg_6.png"];
[bg_6 drawInRect:CGRectMake(0,0,Width_Img, Height_Img)];
[face_image drawInRect:CGRectMake(0,0,Width_Img, Height_Img)];
UIImage *image_6 = UIGraphicsGetImageFromCurrentImageContext();
UIImage *bg_7 = [UIImage imageNamed:@"bg_7.png"];
[bg_7 drawInRect:CGRectMake(0,0,Width_Img, Height_Img)];
[face_image drawInRect:CGRectMake(0,0,Width_Img, Height_Img)];
UIImage *image_7 = UIGraphicsGetImageFromCurrentImageContext();
UIImage *bg_8 = [UIImage imageNamed:@"bg_8.png"];
[bg_8 drawInRect:CGRectMake(0,0,Width_Img, Height_Img)];
[face_image drawInRect:CGRectMake(0,0,Width_Img, Height_Img)];
UIImage *image_8 = UIGraphicsGetImageFromCurrentImageContext();
i have create 40 effected images image_1 to image_40 and put in animatedImageView
animatedImageView =[[UIImageView alloc]initWithFrame:CGRectMake(0,0, 768, 1024)];
animatedImageView.animationImages=[NSArray arrayWithObjects:
Image_1,
Image_1,
Image_2,
Image_2,
bg_1,
bg_1,
Image_3,
Image_3,
Image_4,
Image_4,
Image_8,
Image_8,
.
.
.
nil];
animatedImageView.animationDuration = 8.0f;
animatedImageView.animationRepeatCount = 0;
[animatedImageView startAnimating];
[self.view addSubview: animatedImageView];
I have used multiple images to create this animated effect to view it on AnimatedImageView Controller. But What exactly I want is somewhat like this
But How to Create single face_image to glitch effect like Gif