How to implement a Photoshop Curves editor in UIKit

旧城冷巷雨未停 提交于 2019-12-23 04:04:28

问题


I'm familiar with UIBezierPath and the corresponding CG routines, but none of them appear to draw the same type of path as what I see in Photoshop, etc.

How would one go about this? I'm just talking about the UI--letting the user drag around points.

A java example I found is here: http://www.cse.unsw.edu.au/~lambert/splines/natcubic.html


回答1:


I would look into CGContextAddCurveToPoint and drag around curve's control points. If you require more control points to create a complex curve, just split a resulting curve into simple segments.

Take a look at this article It explains how to calculate the control points based on knots you have on your curve.



来源:https://stackoverflow.com/questions/8013717/how-to-implement-a-photoshop-curves-editor-in-uikit

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