A valid image not being returned from CoreImage in MonoTouch for a valid Asset

独自空忆成欢 提交于 2019-12-14 03:59:27

问题


I am trying to get an image using this.

img = new UIImage(new MonoTouch.CoreImage.CIImage(validAssetObject),1.0f, UIImageOrientation.Up);

A CIImage is returned from the CIImage call. The new UIImage has the CIImage property = null.

Seems like the constructor for UIImage is not working as expected?

Any ideas from the MonoTouch community?


回答1:


I wrote a quick test and this seems to work fine.

string file = Path.Combine (NSBundle.MainBundle.ResourcePath, "image.png");
using (var url = NSUrl.FromFilename (file))
using (var ci = CIImage.FromUrl (url))
using (var ui = new UIImage (ci, 1.0f, UIImageOrientation.Up)) {
    Assert.IsNotNull (ui.CIImage, "CIImage");
}

Something else must differ but you have not shared enough source code to compare. Could you create a small test case, with your image, and file a bug report ?



来源:https://stackoverflow.com/questions/14464154/a-valid-image-not-being-returned-from-coreimage-in-monotouch-for-a-valid-asset

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!