Some time ago I mentioned a nice article on how to use quadratic curves and OpenGL ES to enable the user to draw really smooth lines with variable stroke width.
Here’s an example project from Levi Nunnink called Smooth Line View that shows to create a UIView that allows the user to draw lines that are smoothed very quickly.
Quartz is used to smooth out lines, and the smoothing algorithm utilizes CGContext quadratic curves, and in testing the smoothing effect appears to be pretty much instantaneous. While this view does not have varying width like in the previously mentioned example the overall smoothing effect appears to be quite nice.
Here are some smoothed out lines drawn in a Smooth Line View:
You can find Smooth Line View on Github here.
A nice example of how to create a smoothed line effect without the need to use OpenGL ES.
- Tutorial: Drawing Really Smooth Lines Paper App Style Using UIKit
- Tutorial: How To Create An iOS Drawing App With Image Sharing And Saving
- UIView Category Adding Simple Frame Changes And Command Chaining
- Tutorial: How To Make Jagged Drawn Lines Smooth In Cocos2D
- Custom UIView Tutorial – 5-Star Ratings View
Original article: Example: Creating A UIView Drawing View With Rapidly Smoothed Lines Using Quartz
©2014 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.