gpt4 book ai didi

objective-c - 获取文件的 QuickLook 预览图像

转载 作者:IT王子 更新时间:2023-10-29 05:51:40 29 4
gpt4 key购买 nike

有什么方法可以快速查看文件的预览图像?

我正在寻找这样的东西:

NSImage *image = [QuickLookPreviewer quickLookPreviewForFile:path];

最佳答案

请参阅文档中的 QLThumbnailRequest:https://developer.apple.com/library/mac/#documentation/UserExperience/Reference/QLThumbnailRequest_Ref/Reference/reference.html

NSURL *path = aFileUrl;

NSDictionary *options = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:(NSString *)kQLThumbnailOptionIconModeKey];

CGImageRef ref = QLThumbnailImageCreate(kCFAllocatorDefault, (CFURLRef)path, CGSizeMake(600, 800 /* Or whatever size you want */), (CFDictionaryRef)options);

关于objective-c - 获取文件的 QuickLook 预览图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8815458/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com