开发者

how to get images from other frameworks?

I would like to have a my cursor with the same shape as in Lion

So Instead of having this:

how to get images from other frameworks?

I would like to have this:

how to get images from other frameworks?

Which can be found at: System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/Resources/cursors/resizee开发者_如何学Goastwest/cursor.png in the new OSX 10.7 GM

Is there a way I can load that image using methods from NSBundle or so? I would like to have not the same image into my application (as a resource) if I can use the image from the system.


I ended up by copying the resources into my project and access them the usual way

NSImage *cursorImg = [NSImage imageNamed:@"cursor.png"];

This seem to be the safest way.


NSImage *image = [[NSImage alloc]initWithContentsOfFile:@"/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/Resources/cursors/resizeeastwest/cursor.png"];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜