NSImage:imageDidNotDraw:inRect:
Home 目次>ApplicationKit>NSImage

imageDidNotDraw:inRect:

何かの理由で画像が読み込めなかったときに呼び出されます


-(NSImage *) imageDidNotDraw:(id)sender
   inRect:(NSRect)aRect


【返り値】
   NSImage *画像
【パラメータ】
   sender送信オブジェクト
   aRect範囲


【解説】

何かの理由で画像が読み込めなかったときに呼び出されます。
デリゲートで実装します。



【例文】


#import "MyImage.h"

@implementation MyImage
- (NSImage *)imageDidNotDraw:(id)sender inRect:(NSRect)aRect
{
NSImage *img = [NSImage imageNamed: @"NSApplicationIcon" ];//読み込めなかったときの代替画像
NSLog(@"imageDidNotDraw");

return img;
}
@end


(C) 2000-2007 Satoshi Oomori.
[Apple]

Google
Webwww.oomori.com
Apple_Store_40x120

[ad:Usual day in Japan]

この記事を評価してください。 

良い 

間違いがある 説明がわかりにくい 例文がわかりにくい  

Home 目次>ApplicationKit>NSImage
修正日2006.12.26