I'm requesting a QuickLook preview for an OmniGraffle file.  The size I'm 
asking for is 500x300.  The image I get back is much smaller, at 122x77, which 
looks terrible when I display it in my application.  When I use QuickLook to 
preview the same file in the Finder, it looks great.

Why would I get such a small image back?

Here's the code I'm using (courtesy of Matt Gemmell's handy extension on 
NSImage):

    NSDictionary *dict = 
[NSDictionary dictionaryWithObject:[NSNumbernumberWithBool:icon] 
                                                     
forKey:(NSString*)kQLThumbnailOptionIconModeKey];
    CGImageRef ref = QLThumbnailImageCreate(kCFAllocatorDefault, 
                                            (CFURLRef)fileURL, 
                                            CGSizeMake(size.width, size.height),
                                            (CFDictionaryRef)dict);
    NSLog(@"ref [%d, %d]", CGImageGetWidth(ref), CGImageGetHeight(ref));

The size passed to QLThumbnailImageCreate is documented as an upper bound.  I 
assume that means there's no promise the returned image will actually be that 
size.  But again, the Finder is able to get previews at any size I want.

--Andy


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to