initWithImage:hotSpot:
任意の画像でカーソルをつくって返します
-(id)initWithImage:(NSImage *)newImage: hotSpot:(NSPoint)aPoint:
解説
任意の画像でカーソルを作って返します。
hotSpot ホットスポットのポイント(左上が0×0,右下が15×15)
newImageは16×16ピクセルでないといけません(アルファがあっても良いです)(10.2まで)
返り値
( id )
カーソル
フレームワーク
ApplicationKit
クラス
NSCursor
Instance Methods
使用可能
10.0
参照
- hotSpot
- image
- initWithImage:foregroundColorHint:backgroundColorHint:hotSpot:
例文
//Imageを作る NSImage *img; static NSCursor *cur = nil; //NSImageを作ってファイルから読み込む img = [NSImage imageNamed: @"cuimage" ]; cur = [[NSCursor allocWithZone:[self zone]] initWithImage:img hotSpot:NSMakePoint(2.0,2.0)]; [cur set];