2012-05-29 402 views
0

是否有可能在MPMovieplayercontroller中添加點線.. 如果是,那麼how..Becoz因爲可以在視圖上繪製線條。然後MPMovieplayerconteoler也是僅用於視圖..是否有可能在MPMoviePlayerController上繪製任何圖案

- (void)drawSquiggle:(Squiggle *)squiggle inContext:(CGContextRef)context 
{ 
    // set the drawing color to the squiggle's color 
    UIColor *squiggleColor = squiggle.strokeColor; // get squiggle's color 
    CGColorRef colorRef = [squiggleColor CGColor]; // get the CGColor 
    CGContextSetStrokeColorWithColor(context, colorRef); 

    // set the line width to the squiggle's line width 
    CGContextSetLineWidth(context, squiggle.lineWidth); 

    NSMutableArray *points = [squiggle points]; // get points from squiggle 

    // retrieve the NSValue object and store the value in firstPoint 
    CGPoint firstPoint; // declare a CGPoint 
    [[points objectAtIndex:0] getValue:&firstPoint]; 

    // move to the point 
    CGContextMoveToPoint(context, firstPoint.x, firstPoint.y); 

    // draw a line from each point to the next in order 
    for (int i = 1; i < [points count]; i++) 
    { 
     NSValue *value = [points objectAtIndex:i]; // get the next value 
     CGPoint point; // declare a new point 
     [value getValue:&point]; // store the value in point 

     // draw a line to the new point 
     CGContextAddLineToPoint(context, point.x, point.y); 
    } // end for 

    CGContextStrokePath(context); 
} // end method drawSquiggle:inContext: 

端方法的touchesBegan:withEvent:方法

這是我已經使用的代碼.. mpPlayer是mpvideoplayer對象

但它不是能夠得出指向mpvideoplayer .. 有沒有任何出路。請幫助我..

回答

相關問題