-1
사용자 정의 사각형에서 NSImage가있는 NSCustomView가 있습니다. mousedown 이벤트에서이 이미지 내에 포인트가 있는지 어떻게 확인할 수 있습니까? 이 같은이미지에 마우스 위치가 포함되어 있는지 확인
뭔가 : 귀하의 클릭 된 점이이 같은 NSPointInRect
와 이미지의 RECT에있는 경우
- (void)mouseDown:(NSEvent *)theEvent {
NSPoint point = [self convertPoint:[event locationInWindow] fromView:nil];
if ([myImage containspoint:point]) {
...do stuff...
을하지만 이미지가 투명있다 포인트를 포함해서는 안되는 영역 – RMaggi