Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. NSBundle *thisBundle = [NSBundle mainBundle];
  2. NSString *imagePath = [thisBundle pathForImageResource:@"testimage.png"];
  3. image = [[NSImage alloc] initWithContentsOfFile:imagePath];
  4. NSRect imageRect;
  5. imageRect.origin = NSZeroPoint;
  6. imageRect.size = [image size];
  7.  
  8. CGFloat zoom = 3.0;
  9. imageRect.size.width = imageRect.size.width * zoom;
  10. imageRect.size.height = imageRect.size.height * zoom;
  11.  
  12. NSLog(@"%@", image);
  13. [imageView setFrame:imageRect];
  14. [imageView setImageScaling:NSScaleProportionally];
  15. [imageView setImage:image];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement