まずは作成したOpenCV.frameworkを自分のプロジェクトへコピーします。
opencv-1.1.0 → build_i386 → OpenCV.framework をコピーする。
ビルド時にOpenCV.frameworkを読み込ませるための設定をします。
上のメニューから
プロジェクト → 新規ビルドフェーズ → 新規コピーファイル

デスティネーションをフレームワークにします。

設定ウィンドウを閉じる。
続きを読む
日 | 月 | 火 | 水 | 木 | 金 | 土 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
UIImage *img; CGImageRef cgImg; CGImageRef chipImg; CGRect cutRect; CGRect dispRect; CGContextRef context; img = [UIImage imageNamed:@"hoge.png"]; cgImg = CGImageRetain(img.CGImage); // 切り抜き座標、幅、高さ cutRect = CGRectMake(0, 0, 32, 32); chipImg = CGImageCreateWithImageInRect(cgImg, cutRect); // 表示座標 dispRect = CGRectMake(100, 100, 32, 32); context = UIGraphicsGetCurrentContext(); CGContextDrawImage(context, dispRect, chipImg); |
[application setStatusBarHidden:YES animated:YES]; |
const int height = 480; const int width = 320; CGContextRef context = NULL; CGColorSpaceRef imageColorSpace = CGColorSpaceCreateDeviceRGB(); context = CGBitmapContextCreate (NULL, width, height, 8, width * 4, imageColorSpace, kCGImageAlphaPremultipliedLast); CGContextSetRGBFillColor (context, 1.0, 0.8, 0.8, 1); CGContextFillRect (context, CGRectMake (0, 0, width, height )); CGContextSetRGBFillColor(context, 0, 0, 1, 1); CGContextFillRect (context, CGRectMake (80, 80, 40, 30)); CGImageRef image = CGBitmapContextCreateImage(context); [imageView setImage:image imageProperties:nil]; CGColorSpaceRelease(imageColorSpace); CGContextRelease(context); CGImageRelease(image); |