2012-11-02 58 views

回答

2

在iOS 6中,我們終於有使圖像模糊字面上,使用CIFilter的能力。因此,如果您真的想要,可以將該區域的圖像變得模糊,使用CIFilter對其進行模糊處理,然後疊加該模糊的圖像。然後,您可以使用定時器或CADisplayLink來請求動畫的連續「幀」,並且每次您都會做同樣的事情,只創建一個較少和較少模糊的圖像並顯示它。

+0

感謝您的建議。但是,我們希望應用也可以在iOS 5下運行。 – reid55

+0

然後選擇iOS 5中存在的CIFilter。它不會像模糊一樣真實,但它可能會發生。 – matt

0

這是放大鏡的效果。

- (void)drawRect:(CGRect)rect { 
    // here we're just doing some transforms on the view we're magnifying, 
    // and rendering that view directly into this view, 
    // rather than the previous method of copying an image. 
    CGContextRef context = UIGraphicsGetCurrentContext(); 
    CGContextTranslateCTM(context,1*(self.frame.size.width*0.5),1*(self.frame.size.height*0.5)); 
    CGContextScaleCTM(context, 1.5, 1.5); 
    CGContextTranslateCTM(context,-1*(touchPoint.x),-1*(touchPoint.y)); 
    [self.viewToMagnify.layer renderInContext:context]; 
} 

參考:http://coffeeshopped.com/2010/03/a-simpler-magnifying-glass-loupe-view-for-the-iphone

+0

這在放大圖像方面做得很好,但這不是我需要做的。 – reid55