Stack Overflow中文网

文章正文
发布时间:2025-10-02 20:42

您可以以编程方式提取图像:

//: Playground - noun: a place where people can play import Cocoa let cursor = NSCursor.arrowCursor().image.TIFFRepresentation let searchPaths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, NSSearchPathDomainMask.UserDomainMask, true) let documentsPath = searchPaths[0] as! String let savePath = documentsPath.stringByAppendingPathComponent("cursor.tiff") cursor?.writeToFile(savePath, atomically: true)

结果是具有 4 个不同版本的光标的 tiff,范围从 20x24 像素(非视网膜默认)到 200x240 像素。使用 Preview.app,您可以抓取每个单独的尺寸并将其复制/粘贴到新文档中,并将每个尺寸保存为 png。

或者只是抓住我之前准备的一个:https ://dl.dropboxusercontent.com/u/147461/mac-cursor/mac-cursor.zip