将视图转换为UIImage的模糊图像 - Xamarin.ios

时间:2017-10-27 15:05:16

标签: ios xamarin xamarin.ios

我已将视图转换为UIImage,但图像质量不佳。有没有办法提高图像的质量或任何其他方式将视图转换为图像并保持质量。

将View转换为UIImage的代码

var Sharecell = ExplorertableView.CellAt(indexPath);
UIImage image;
UIGraphics.BeginImageContext(this.ContentView.Frame.Size);
Sharecell.ContentView.Layer.RenderInContext(UIGraphics.GetCurrentContext());
image = UIGraphics.GetImageFromCurrentImageContext();
UIGraphics.EndImageContext();
var items = new Foundation.NSObject[] { image };
UIActivityViewController activity = new UIActivityViewController(items, null);
this.PresentViewController(activity, true, null);

0 个答案:

没有答案