Get Updates By E-mail 

Article Written By:
Johann Dowa

Example: Creating A UIView Drawing View With Rapidly Smoothed Lines Using Quartz

  •  
  •  
  •  
  •  
  •  

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:
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.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments