Bild in Kacheln mit Animation gespleißt - iOS

Ich versuche ein Bild zu verbinden und habe dann einen Übergang zum nächsten. Irgendwelche Vorschläge, wo ich anfangen soll? Können die Bilder in kleine Kacheln aufgeteilt und mit UIView-Animationen animiert werden? Hier ist einProbe.

BEARBEITEN:

 '#define DESIRED_WIDTH 40

 '#define DESIRED_HEIGHT 60


 - (void)viewDidLoad
{
[super viewDidLoad];

  UIImage *bigImage = [UIImage imageNamed:@"background_for_Manager_App.png"];
  CGRect frame = CGRectMake(0.0, 0.0, DESIRED_WIDTH, DESIRED_HEIGHT);
  int widthCount = (bigImage.size.width / DESIRED_WIDTH);
  int heightCount = (bigImage.size.height / DESIRED_HEIGHT);
  NSLog(@"height width %i %i",heightCount,widthCount);
  for (int i = 0; i <heightCount; i++) {
    for (int j = 0; j < widthCount; j++) {
        UIImage *piece = [self imageCroppedWithRect:frame];
        UIImageView *view = [[UIImageView alloc] initWithImage:piece];
        view.frame = frame;
        [self.view addSubview:view];

        frame.origin.x += frame.size.width;
        NSLog(@"x value %f",frame.origin.x);

       }
    frame.origin.x = 0.0;

    frame.origin.y += frame.size.height;
     NSLog(@"y value %f",frame.origin.y);
   }

//[UIView beginAnimations:nil context:12    // Do any additional setup after loading the view, typically from a nib.

}

- (UIImage *)imageCroppedWithRect:(CGRect)rect
  {
    CGFloat scale = [UIImage imageNamed:@"background_for_Manager_App.png"].scale;
    NSLog(@"scale value%f",scale);
    if (scale > 1.0f) 
    {    // this is for Retina display capability
         rect = CGRectMake(rect.origin.x * scale,
                      rect.origin.y * scale,
                      rect.size.width * scale,
                      rect.size.height * scale);

    }

    CGImageRef imageRef = CGImageCreateWithImageInRect([UIImage imageNamed:@"background_for_Manager_App.png"].CGImage, rect);
    UIImage *result = [UIImage imageWithCGImage:imageRef scale:scale orientation:self.splicedImageView.image.imageOrientation];
    CGImageRelease(imageRef);
    return result;
}

Antworten auf die Frage(1)

Ihre Antwort auf die Frage