Results 1 to 4 of 4
Thread: draw smooth dash-ed line
- 02-28-2011, 01:34 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 2
- Rep Power
- 0
draw smooth dash-ed line
hi !!
i am working on a project that displays graph, a graph can be drawn as simple plain line , dash-ed line , dotted line or dash -dotted line. i don't have any problem with drawing all these of lines , but the problem is lines are not so smooth and if i zoom my graph they become very rough.
please suggest some dash-type for BasicStroke object such that line would be smoother(if possible please explain mechanism for drawing smooth line)
setStroke(new BasicStroke(nPathWidth, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 10.0f, fDashType, //<-- i want this value for dash-ed line , dotted line or dash -dotted line 0f));
Thanks,
Sarveshwar Singh.
- 02-28-2011, 10:53 PM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,604
- Rep Power
- 5
I presume you are working with Java2D and are drawing to a Graphics...have you tried to set the antialiasing to on? See Enabling Antialiasing | Example Depot
- 03-01-2011, 05:40 AM #3
Member
- Join Date
- Feb 2011
- Posts
- 2
- Rep Power
- 0
thanks it works !!!
- 03-01-2011, 07:23 AM #4
Similar Threads
-
How to draw line with animation
By hnchnc in forum Java 2DReplies: 1Last Post: 11-18-2010, 10:49 PM -
How to draw both line to smooth joining in png
By luoluo in forum Java 2DReplies: 7Last Post: 04-18-2010, 07:09 AM -
Draw line
By janes in forum Java 2DReplies: 6Last Post: 03-25-2010, 10:48 PM -
How to draw a Smooth Curve using jfreechart
By Manfizy in forum New To JavaReplies: 1Last Post: 07-07-2009, 09:01 AM -
How to Draw line in Java
By Java Tip in forum java.awtReplies: 0Last Post: 06-22-2008, 11:08 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks