开发者

how to get images from other frameworks?

开发者 https://www.devze.com 2023-03-20 17:58 出处:网络
I would like to have a my cursor with the same shape as in Lion So Instead of having this: I would like to have this:

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

精彩评论

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