有没有办法将 ImageKit 的 IKSaveOptions 初始化为默认为 LZW 压缩的 TIFF?
我正在使用 Mac OS X 10.6 SDK ImageKit 的 IKSaveOptions 将文件格式附件添加到 NSSavePanel 使用:
- (id)initWithImageProperties:(NSDictionary *)imageProperties imageUTType:(NSString *)imageUTType;
并且
- (void)addSaveOptionsAccessoryViewToSavePanel:(NSSavePanel *)savePanel;
我尝试创建一个 NSDictionary 来指定 Compression = 5,但我似乎无法让 IKSaveOptions 显示 Format:TIFF, Compression :LZW 当 NSSavePanel 第一次出现时。我还尝试保存返回的 imageProperties 字典和 userSelection 字典,然后尝试下次将其返回,但 NSSavePanel 始终默认为 Format:TIFF 和 Compression:None。
有谁知道如何自定义附件视图中显示的默认格式/压缩?
我想将保存选项默认为 TIFF/LZW,并且希望下次恢复用户上次选择的文件格式。我可以使用 imageUTType(例如 kUTTypeJPEG、kUTTypePNG、kUTTypeTIFF 等)控制文件格式,但我仍然无法设置 TIFF 或 JPEG 格式的初始压缩选项。
谢谢,
-Rei
I'm using Mac OS X 10.6 SDK ImageKit's IKSaveOptions to add the file format accessory to an NSSavePanel using:
- (id)initWithImageProperties:(NSDictionary *)imageProperties imageUTType:(NSString *)imageUTType;
and
- (void)addSaveOptionsAccessoryViewToSavePanel:(NSSavePanel *)savePanel;
I have tried creating an NSDictionary to specify Compression = 5, but I cannot seem to get the IKSaveOptions to show Format:TIFF, Compression:LZW when the NSSavePanel first appears. I've also tried saving the returned imageProperties dictionary and the userSelection dictionary, and then tried feeding that back in for the next time, but the NSSavePanel always defaults to Format:TIFF with Compression:None.
Does anyone know how to customize the default format/compression that shows up in the accessory view?
I would like to default the save options to TIFF/LZW and furthermore would like to restore the user's last file format choice for next time. I am able to control the file format using the imageUTType (e.g. kUTTypeJPEG, kUTTypePNG, kUTTypeTIFF, etc) but I am still unable to set the initial compression option for TIFF or JPEG formats.
Thanks,
-Rei
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有公共 API 来控制这一点。但是,您可以通过 NSSavePanel 的附件视图对其进行修改。
例子:
There is no public API to control this. However, you can modify it through accessory view of the NSSavePanel.
Example: