sizeWithAttributes:
INDEX>AppKit>NSString Addtion
指定した属性でのレシーバのバウンディングボックスのサイズを返します
-(NSSize)sizeWithAttributes:(NSDictionary *)attributes
アイリスオーヤマ 家具転倒防止伸縮棒M KTB-40 ホワイト KTB-40
- 出版社/メーカー: アイリスオーヤマ(IRIS)
- 発売日: 2004/11/11
- メディア: ホーム&キッチン
- 購入: 10人 クリック: 63回
- この商品を含むブログ (8件) を見る
解説
指定した属性でのレシーバのバウンディングボックスのサイズを返します。
返り値
( NSSize )
サイズ
引数
( NSDictionary * )attributes
属性の辞書
フレームワーク
ApplicationKit
クラス
NSString Additions
Instance Methods
使用可能
10.0
参照
例文
#import "SetImage.h" @implementation SetImage - (IBAction)set:(id)sender { NSSize size; NSString *aString; aString = @"sssssss"; //imageを描画対象にする [image lockFocus]; //[fnt set]; //描画対象にimg2を合成する [aString drawInRect:NSMakeRect(0,0,100,100) withAttributes:nil]; //imgを描画から外す [image unlockFocus]; size = [aString sizeWithAttributes:nil]; NSLog([NSString stringWithFormat:@"%.1f,%.1f",size.width,size.height]); } @end