ライブカメラで描くアプリケーションを作ろうとしています。その中で、xibPaintView
を使用して、ペイント関連のすべての機能が実行されているクラスを作成しました。
ビューにを追加しpaintview
ていcameraoverlay
ます。ビューが正しく追加されます。しかし、デバイスの画面に触れていると、アプリケーションは何も描画できず、ログには次のエラーが表示されます
<エラー>:CGContextSetLineWidth:無効なコンテキスト0x11b540
<エラー>:CGContextSetRGBStrokeColor:無効なコンテキスト0x11b540
サブビューを追加するための私のコードは
// Insert the overlay
overlay = [[PaintView alloc] initWithNibName:@"PaintView" bundle:nil];
//overlay.pickerReference = self.imagePicker;
[self.imagePicker.cameraOverlayView addSubview:overlay.view];
[self.imagePicker.cameraOverlayView bringSubviewToFront:overlay.view];
[self.imagePicker.cameraOverlayView setBackgroundColor:[UIColor clearColor]];
//self.imagePicker.delegate = overlay;
[self presentModalViewController:self.imagePicker animated:YES];
ライブカメラで描く方法を教えてください!!!
前もって感謝します。
編集:ペイントビューで、次のように初期化される画像ビューを作成しています
drawImage = [[UIImageView alloc] init];
drawImage.frame = CGRectMake(20、20、320、440);
[self.view addSubview:drawImage];
[self.view bringSubviewToFront:drawImage];