Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • How to print an NSImage

    • 0
    • 1
    • 1
    • 1
    • 0
    • 0
    • 0
    • 0
    • 1.33k
    Comment on it

    The following code prints an image stored in a file:

        NSImage *image = [[NSImage alloc]initWithContentsOfFile:[imageEdWindowController getImageLocation]];
        [image scalesWhenResized];
        NSImageView *_imageView = [[NSImageView alloc]init];
        [_imageView setFrame:NSMakeRect(0, 0,[image size].width, [image size].height)];
        [_imageView setImage:image];
        NSPrintInfo *printInfo = [NSPrintInfo sharedPrintInfo];
        [printInfo setHorizontalPagination: NSFitPagination];
        [printInfo setVerticalPagination: NSFitPagination];
          printOperationWithView:_imageView printInfo:printInfo]

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: