2013-02-22 24 views

回答

0

由於您要求x,y,寬度,高度和不是我假設你想要旋轉圖像的邊界框的四個角落。你可以使用CGPath來計算。

// Your rotation transform 
CGAffineTransform rotation = CGAffineTransformMakeRotation(angle); 

// Create a path from the transformed frame 
CGPathRef rotatedImageRectPath = 
    CGPathCreateWithRect(
         imageView.frame, // rect to get the path from 
         &rotation   // transform to apply to rect 
         ); 
// Get the bounding box from the path 
CGRect boundingBox = CGPathGetBoundingBox(rotatedImageRectPath); 
相關問題