三角形狀的點陣模糊效果iOS源碼,點陣模糊ios源碼

來源:互聯網
上載者:User

三角形狀的點陣模糊效果iOS源碼,點陣模糊ios源碼

 

源碼FFAngularPointilism,FFAngularPointilism能夠將UIImageView像添加濾波器一樣產生三角形狀的點陣模糊效果。可以通過動畫方式來模糊,也可以立刻模糊。另外並提供改模糊方式的動畫。動畫可以配置模糊程度及閃爍間隔。

  • <ignore_js_op> 

使用方法:


將Demo中的FFAngularPointilism檔案夾直接複製到項目當中,並且將Images.xcassets中的4個三角形圖案也要複製到項目中。 

映像模糊 
初始化: 
_imageView = [[FFDoubleTriangleView alloc] initWithImage:[UIImage imageNamed:@"ww"]]; 
    [self.view addSubview:self.imageView]; 

通過動畫方式: 
[self.imageView startAnimatedEffect:FFDoubleTriangleViewEffectMosaicFilter 
        withCompletion:^ 
        { 
        //完成模糊 
        }]; 
立刻模糊方式: 
[self.imageView applyFilter]; 
-------------------------------------------------------------------- 
模糊動畫: 
self.shutteringView.coordinateSquaresToOmit = @[@[@0, @0]]; 
    _shutteringView = [[FFShutteringView alloc] initWithFrame:self.view.bounds]; 
    [self.containerShutteringView addSubview:_shutteringView]; 

動畫啟動: 
[self.shutteringView sparkLife]; 

設定動畫的各種屬性: 
-self.shutteringView.maximumAllowedDeathTicks = 1.0/(sender.value) * 400; 
-self.shutteringView.frameRate = sender.value * 30; 

具體內容請參考demo.

詳細說明:http://ios.662p.com/thread-2325-1-1.html

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.