macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

graphicsContextWithWindow:

ウインドウに描画するためにコンテキストを作って返します
+(NSGraphicsContext *)graphicsContextWithWindow:(NSWindow *)aWindow:

解説

ウインドウに描画するためにコンテキストを作って返します。

返り値

( NSGraphicsContext * )

グラフィックス・コンテキスト

引数

( NSWindow * )aWindow

ウインドウ

フレームワーク

ApplicationKit

クラス

NSGraphicsContext

Class Methods

使用可能

10.0

参照

例文

#import "Controller.h"

@implementation Controller

- (IBAction)pushButton:(id)sender
{
NSGraphicsContext *gCon = 
        [NSGraphicsContext graphicsContextWithWindow:[sender window] ];
switch ([gCon imageInterpolation]){

    case NSImageInterpolationDefault:
        NSLog(@"NSImageInterpolationDefault");
        break;
    case NSImageInterpolationNone:
        NSLog(@"NSImageInterpolationNone");
        break;
    case NSImageInterpolationLow:
        NSLog(@"NSImageInterpolationLow");
        break;
    case NSImageInterpolationHigh:
        NSLog(@"NSImageInterpolationHigh");
        break;
        }

}


@end