Changeset 115
- Timestamp:
- 02/07/08 01:12:55 (10 months ago)
- Files:
-
- trunk/QDocument/QDocument.m (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/QDocument/QDocument.m
r114 r115 775 775 Q_DEBUG(@"screenshot"); 776 776 777 // generate Screenshot 778 [screenView lockFocus]; 779 NSBitmapImageRep *bitmapImageRep = [[NSBitmapImageRep alloc] initWithFocusedViewRect:[screenView bounds]]; 780 [screenView unlockFocus]; 781 NSData *data = [bitmapImageRep representationUsingType: NSPNGFileType properties: nil]; 782 777 int i; 778 NSBitmapImageRep *bitmapImageRep; 779 NSData *data; 780 NSFileManager *fileManager; 781 782 bitmapImageRep = [NSBitmapImageRep imageRepWithData:[[screenView screenshot:NSMakeSize(0.0, 0.0)] TIFFRepresentation]]; 783 data =[bitmapImageRep representationUsingType: NSPNGFileType properties: nil]; 784 783 785 // find next free number for name and save it to the desktop 784 NSFileManager *fileManager = [NSFileManager defaultManager];785 i nt i= 1;786 fileManager = [NSFileManager defaultManager]; 787 i = 1; 786 788 while ([fileManager fileExistsAtPath:[NSString stringWithFormat:@"%@/Q Screenshot %D.png", [@"~/Desktop" stringByExpandingTildeInPath], i]]) 787 789 i++;