【问题标题】:Pass MPMediaItemArtwork into Core Image将 MPMediaItemArtwork 传递到 Core Image
【发布时间】:2016-06-08 21:33:17
【问题描述】:

如果我想将MPMediaItemArtwork 图像传递给Core Image,我应该尝试使用什么方法?我似乎无法弄清楚这一点。

我知道如果它是 url,那么我会使用:

CIImage *image = [CIImage imageWithContentsOfURL:myURL];

但我不知道要为MPMediaItemArtwork 图像使用什么类方法。

【问题讨论】:

  • 我看不出有什么难度。您了解如何将艺术品作为图像获取吗?您了解如何从中派生 CIImage 吗?问题解决了。
  • @matt 是的,我使用UIImage *artworkImage = [artwork imageWithSize: CGSizeMake (44, 44)]; 将艺术品作为图像获取。我遇到问题的部分是“如何从中派生 CIImage”。具体来说,我没有看到可以将artworkImage 传递给的类方法。由于它不是url,我显然不能使用imageWithContentsOfURL,问题是我没有看到明显的类方法可以使用,或者我尝试过的方法有效。我以为我会看到imageWithUIImage: 类型的方法,但我没有看到,也不确定使用哪一个。这有意义吗?
  • @matt 我查看了这个页面试图弄清楚:developer.apple.com/library/mac/documentation/GraphicsImaging/…
  • 打算放那个,但我不确定你是否看到了我应该使用的方法?你有没有看到我应该使用的特别突出的东西?

标签: ios objective-c core-image


【解决方案1】:

正如@matt 所说,initWithImage: 是完美的解决方案。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-05-02
    • 2018-12-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多