Results 1 to 4 of 4
Like Tree2Likes
  • 1 Post By doWhile
  • 1 Post By JavaIsChallenging

Thread: Freehand curve smoothing using Bezier Curve

  1. #1
    Join Date
    Sep 2011
    Posts
    3
    Rep Power
    0

    Question Freehand curve smoothing using Bezier Curve

    Hi,

    Anyone knows how the code to convert freehand drawing curve to bezier curve so as to smooth the lines when drawn? Or is there any other method that can be used to smooth the freehand drawing so as not to have any jagged points. Any help is greatly appreciated. Thanks!

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default Re: Freehand curve smoothing using Bezier Curve

    Check out java.awt.geom.Path2D#curveTo(...)

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    7

    Default Re: Freehand curve smoothing using Bezier Curve

    Set the anti-alias flag for the rendering hints (google for exact code) if you want them to be anti-aliased (which will smooth the curves). In addition to DarrylBurke's advice, take a look at the QuadCurve2D and CubicCurve2D classes for rendering
    Geometric Primitives (The Java™ Tutorials > 2D Graphics > Overview of the Java 2D API Concepts)
    DarrylBurke likes this.

  4. #4
    Join Date
    Sep 2011
    Posts
    3
    Rep Power
    0

    Default Re: Freehand curve smoothing using Bezier Curve

    Thanks, guys. I will go and understand how to use first. (:
    DarrylBurke likes this.

Similar Threads

  1. Drawing the sine curve
    By bumblyb33 in forum Java 2D
    Replies: 7
    Last Post: 03-26-2009, 11:29 PM
  2. Java Learning Curve
    By mwildam in forum New To Java
    Replies: 13
    Last Post: 10-17-2008, 12:09 PM
  3. How to draw text along a curve
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-25-2008, 11:31 AM
  4. How to draw Curve using QuadCurve2D
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-24-2008, 12:20 AM
  5. How to Draw Curve with mouse
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-24-2008, 12:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •