NSImage:cacheDepthMatchesImageDepth
Home 目次>ApplicationKit>NSImage

cacheDepthMatchesImageDepth

アプリケーションのデフォルトの色深度でキャッシュされるかを返します


-(BOOL) cacheDepthMatchesImageDepth


【返り値】
   BOOLYES/NO


【解説】

アプリケーションのデフォルトの色深度でキャッシュされるかを返します。



【例文】


#import "SetImage.h"

@implementation SetImage

- (
IBAction )set:( id )sender
{
// 開けるファイル拡張子の配列
NSArray *imgTypes = [ NSArray arrayWithObject :
@"tiff" ];
//OpenPanel を作る
NSOpenPanel *opImage = [ NSOpenPanel openPanel ];

//OpenPanel の結果のボタン番号
int opRet;
NSImageRep *imgRep;
NSImage *img=[[NSImage allocWithZone:[
self zone]] initWithSize:NSMakeSize( 100 , 100 )];
//OpenPanel でファイル選択
opRet = [ opImage runModalForDirectory : NSHomeDirectory()
// どこのディレクトリを出すか
file :
@"Pictures" // どのどのファイルを選択しておくか
types : imgTypes ];
// 選べるファイルタイプ

if ( opRet == NSOKButton ) { // OPENPanel のボタンが OK なら
imgRep = [NSImageRep imageRepWithContentsOfFile:[ opImage filename ]];


[img addRepresentation:imgRep];
[img setCacheDepthMatchesImageDepth:
YES ];
if ([img cacheDepthMatchesImageDepth]){
NSLog(
@"cacheDepthMatchesImageDepth YES" );
}
else {
NSLog(
@"cacheDepthMatchesImageDepth NO" );
}

[image setImage: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