Как я могу создать эффект глюка в GIF из обычного изображения

Создавать изображения с различным фоновым изображением

   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();

я создал 40 созданных изображений с image_1 по image_40 и поместил в 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];

введите описание изображения здесь

Я использовал несколько изображений, чтобы создать этот анимированный эффект, чтобы просмотреть его на AnimatedImageView Controller. Но то, что я хочу, выглядит примерно так

Но как создать одиночный face_image с эффектом сбоя типа Gif

введите описание изображения здесь

0 ответов

Другие вопросы по тегам