Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I'm writing a custom control that contains some text that I want to put an outline on it using this code:
VB
e.Graphics.DrawPath(New Pen(New SolidBrush(OutlineColor), OutlineSize), TextPath)

But when the outline is rendered, it has lines jutting out some of the letters and I don't know how to remove them. Is there any way to remove them?

Like this
http://i46.tinypic.com/23k2no.jpg[^]
Posted
Updated 10-Jul-12 19:01pm
v2
Comments
Sergey Alexandrovich Kryukov 11-Jul-12 1:34am    
Looks strange. Could you show the code where you get TextPath?
One bug you have here (probably unrelated to your problem) is: you don't Dispose your pen and brush.
--SA
olivewarbler 11-Jul-12 1:36am    
Dim TextPath As New GraphicsPath
TextPath.AddString(ControlText, ControlFont.FontFamily, ControlFont.Style, ControlFont.Size, TextRectangle, StringFormat)

1 solution

I found an answer! If I set the pen's linejoin property to round, they disappear!
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 11-Jul-12 14:55pm    
Ah, that was a join! Sure, it's quite clear how it caused the problem. Look, usually answering one's own answer is not good, but this one was interesting and good to know. So, the whole post could be useful for others -- and I would like to keep this page accessible. Therefore, I voted 5 for both question and answer.

Thanks for sharing. Good luck,
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900