Changeset 115

Show
Ignore:
Timestamp:
02/07/08 01:12:55 (10 months ago)
Author:
mike
Message:

[fix] QDocument takeScreenShot adapted to QDocumentOpenGLView

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/QDocument/QDocument.m

    r114 r115  
    775775        Q_DEBUG(@"screenshot"); 
    776776 
    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 
    783785    // find next free number for name and save it to the desktop 
    784     NSFileManager *fileManager = [NSFileManager defaultManager]; 
    785     int i = 1; 
     786    fileManager = [NSFileManager defaultManager]; 
     787    i = 1; 
    786788    while ([fileManager fileExistsAtPath:[NSString stringWithFormat:@"%@/Q Screenshot %D.png", [@"~/Desktop" stringByExpandingTildeInPath], i]]) 
    787789        i++;