2009-07-31 11 views
0

il y a une image .png montrant le squelette de corps humain. Ma question est que comment choisir différentes parties du squelette comme la main, le pied, la tête etc. dans l'image et après que le contrôle de sélection se déplace dans une autre vue qui affiche des informations sur cette partie sélectionnée.comment sélectionner les différentes parties d'une image

Répondre

0

je serais probablement sous-classe UIImageView et écrasez touchesEnded: withEvent:

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event 
{ 
    // ignore if more than one finger 
    if ([touches count] != 1) { 
     [self.nextResponder touchesEnded:touches withEvent:event]; 
     return; 
    } 

    UITouch *touch = [touches anyObject]; // there's only one object in the set 

    // ignore unless the user lifted the finger off the screen 
    if (touch.phase != UITouchPhaseEnded) { 
     [self.nextResponder touchesEnded:touches withEvent:event]; 
     return; 
    } 

    // ignore if double-touch or more 
    if ([touch tapCount] != 1) { 
     [self.nextResponder touchesEnded:touches withEvent:event]; 
     return; 
    } 

    CGPoint locationOfTouch = [touch locationInView:self]; 

    // TODO: use locationOfTouch.x and locationOfTouch.y to determine which part has been selected 
} 
Questions connexes