【问题标题】:iOS 5 and interpolatedColorAtLocation. Get the color in a gradient at a specific locationiOS 5 和 interpolatedColorAtLocation。获取特定位置的渐变颜色
【发布时间】:2012-01-21 21:49:21
【问题描述】:

如何在 iOS 5 中的特定位置获取渐变颜色? 我有一个从红色到绿色渐变的垂直条,左侧是一个三角形,显示了条中的位置。如何用该位置的条形颜色填充三角形? 我认为在 Mac OS X 中它是“interpolatedColorAtLocation”,但 iOS 5 呢?

感谢您的帮助。

【问题讨论】:

    标签: ios5 gradient


    【解决方案1】:

    iOS 中没有用于此的 API。您必须自己进行渐变插值,或者将渐变绘制成CGBitmapContext,然后在位图的原始数据中找到像素值。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-03-17
      • 1970-01-01
      • 2016-11-02
      • 2017-08-19
      • 1970-01-01
      • 2012-12-07
      • 1970-01-01
      • 2020-05-25
      相关资源
      最近更新 更多