import cv2 # For OpenCV modules (For Image I/O and Contour Finding) import numpy as np # For general purpose array manipulation import scipy . fftpack # For FFT2 #### imclearborder definition def imclearborder ( imgBW , radius ): # Given a black and white image, first find all of its contours imgBWcopy = imgBW . copy () contours , hierarchy = cv2 . findContours ( imgBWcopy . copy (), cv2 . RETR_LIST , cv2 . CHAIN_APPROX_SIMPLE ) # Get dimensions of image imgRows = imgBW . shape [ 0 ] imgCols = imgBW . shape [ 1 ] contourList = [] # ID list of contours that touch the border # For each contour... for idx in np . arange ( len ( contours )): # Get the i'th contour cnt = contours [ idx ] # Look at each point in the contour for pt in cnt : rowCnt = pt [ 0 ][ 1 ] colCnt = pt [ 0 ][ 0 ] # If this is within the radius of th...
// 호출 메써드
답글삭제-(void)hoge:(id)sender{
// 처리
}
UIControlEventTouchDown タッチダウン
답글삭제UIControlEventTouchDownRepeat 複数回のタッチダウン
UIControlEventTouchUpInside コントロール内でのタッチアップ
UIControlEventTouchUpOutside コントロール外でのタッチアップ
UIControlEventTouchDownRepeat 複数回のタッチダウン
UIControlEventTouchDragInside コントロール内でのドラッグ
UIControlEventTouchDragOutside コントロール内から外へのドラッグ
UIControlEventDragEnter コントロール外から内へのドラッグ
UIControlEventValueChanged コントロールのvalue値が変化した
UIControlEventEditingDidBegin 編集開始
UIControlEventEditingChanged 編集により値が変化した
UIControlEventEditingDidEnd 編集終了
UIControlEventEditingDidEndOnExit 編集終了後フォーカスが外れた
UIControlEventAllTouchEvents タッチイベント発生時(種類問わず)
UIControlEventAllEditingEvents 編集イベント発生時(種類問わず)
UIControlEventAllEvents
// 표준 버튼 예문
답글삭제UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
btn.frame = CGRectMake(10, 10, 100, 30);
[btn setTitle:@"누르셈" forState:UIControlStateNormal];
[btn setTitle:@"여기" forState:UIControlStateHighlighted];
[btn setTitle:@"누르지마셈" forState:UIControlStateDisabled];
// ボタンがタッチダウンされた時にhogeメソッドを呼び出す
[btn addTarget:self action:@selector(hoge:)
forControlEvents:UIControlEventTouchDown];
[self.view addSubview:btn];
// 이미지 지정 예문
답글삭제UIImage *img = [UIImage imageNamed:@"hoge.png"]; // 버튼화상
UIButton *btn = [[[UIButton alloc]
initWithFrame:CGRectMake(0, 0, 60, 30)] autorelease]; //
[btn setBackgroundImage:img forState:UIControlStateNormal]; //
// 메써드 호출
[btn addTarget:self
action:@selector(hoge:) forControlEvents:UIControlEventTouchUpInside];