Guest User

Untitled

a guest
Jul 20th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. for (int i = 0; i < [fileArr count]; i++)
  2. {
  3. NSArray *fileNameArr = [[fileArr objectAtIndex:i] componentsSeparatedByString:@"."];
  4. check=line;
  5. NSString *msg = [textView.text stringByAppendingString:[NSString stringWithFormat:@"Opening image: %@n",[fileArr objectAtIndex:i]]];
  6.  
  7. [textView performSelectorOnMainThread:@selector(setText:) withObject:msg waitUntilDone:NO];
  8.  
  9. line=line+1;
  10.  
  11. [image removeFromSuperview];
  12. [image release];
  13. image = nil;
  14. //specify the image path, open the image file with UIImage library
  15. NSString *imagePath = [NSString stringWithFormat:@"%@/%@",jfn1,[fileArr objectAtIndex:i]];
  16. NSString *imageFile = [NSHomeDirectory() stringByAppendingPathComponent:imagePath];
  17. NSString *pathExtension = [imageFile pathExtension];
  18. NSLog(@"----------------------------");
  19. NSLog(@"ImageFile: %@n",imageFile);
  20. NSLog(@"File Extention: %@n", pathExtension);
  21. NSLog(@"Interger value: %in",i);
  22.  
  23. UIImage *myImage = [UIImage imageWithContentsOfFile:imageFile];
  24. NSLog(@"Image Width: %f", myImage.size.width);
  25. NSLog(@"Image height: %f", myImage.size.height);
  26.  
  27. image = [[UIImageView alloc] initWithImage:myImage];
  28. image.contentMode = UIViewContentModeScaleAspectFit;
  29. [scrollView addSubview:image];
  30.  
  31. [image removeFromSuperview];
  32.  
  33. [scrollView addSubview:image];
Add Comment
Please, Sign In to add comment