Iphone 如何在Monotouch中对UIImageView执行运动模糊效果?
在MonoTouch中进行实时运动模糊的方法是什么 当滚动惯性图片库时,我需要在UIImageView上应用运动模糊效果,强度和方向作为参数,就像在Photoshop中一样 我在CocoaTouch、CoreAnimation或iOS SDK的任何地方都找不到任何模糊或运动模糊过滤器 MonoTouch是否有适合iPhone的2D效果库,可以使用实时模糊过滤器Iphone 如何在Monotouch中对UIImageView执行运动模糊效果?,iphone,ios,uiimageview,xamarin.ios,blur,Iphone,Ios,Uiimageview,Xamarin.ios,Blur,在MonoTouch中进行实时运动模糊的方法是什么 当滚动惯性图片库时,我需要在UIImageView上应用运动模糊效果,强度和方向作为参数,就像在Photoshop中一样 我在CocoaTouch、CoreAnimation或iOS SDK的任何地方都找不到任何模糊或运动模糊过滤器 MonoTouch是否有适合iPhone的2D效果库,可以使用实时模糊过滤器 提前感谢。这篇文章介绍了一种可能的方法: 我找到了一个很好的开源库,可以对UIImage产生很多影响: 它还使用加速框架在iOS 4.
提前感谢。这篇文章介绍了一种可能的方法:
我找到了一个很好的开源库,可以对UIImage产生很多影响: 它还使用加速框架在iOS 4.0上稍微加快速度
现在,如果有这样一个MonoTouch包装器…如果你想使用在WWDC上演示的blur Apple(虽然不是实时的!),我为他们的UIImage类别制作了一个本机端口
// Helper method to create an image snapshot of the view hierarchy
UIImage SnapshotImageWithScale (UIView view, float scale)
{
UIGraphics.BeginImageContextWithOptions (view.Bounds.Size, false, scale);
view.DrawViewHierarchy (view.Bounds, true);
UIImage image = UIGraphics.GetImageFromCurrentImageContext ();
UIGraphics.EndImageContext ();
return image;
}
...
// Create snapshot of the parent view controller (this can be the superview or anything else)
UIImage snapshot = SnapshotImageWithScale (parentView, UIScreen.MainScreen.Scale);
// Blur the snapshot with the specified radius and tint color
snapshot = snapshot.ApplyBlur (6.0f, UIColor.FromWhiteAlpha (0.0f, 0.6f), 0.8f, null);
// Create an UIImageView to display the blurred snapshot
UIImageView snapshotView = new UIImageView {
Frame = new RectangleF (0, 0, View.Bounds.Width, View.Bounds.Height),
Image = snapshot,
};
View.AddSubview (snapshotView);
谢谢,但这是预先计算好的。在我的例子中,我不知道我要进行运动模糊的东西的图片内容是什么,所以我不能使用它。我需要实时运动模糊,就像flash画廊中使用的经典运动模糊效果:或者任何人?iPhone上有与MonoTouch兼容的2d特效库吗?