-1
我有一個NSCustomView NSImage放置在它的自定義矩形。如何檢查我的mousedown事件中的某個點是否位於此圖像內?檢查圖像是否包含鼠標位置
事情是這樣的:
- (void)mouseDown:(NSEvent *)theEvent {
NSPoint point = [self convertPoint:[event locationInWindow] fromView:nil];
if ([myImage containspoint:point]) {
...do stuff...
我知道我可以使用一個矩形,但圖像具有透明不應包含這一觀點的領域 – RMaggi