Click here to Skip to main content
13,005,991 members (69,660 online)
Rate this:
Please Sign up or sign in to vote.
I'm writing a custom control that contains some text that I want to put an outline on it using this code:
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[^]
Posted 10-Jul-12 18:59pm
Updated 10-Jul-12 19:01pm
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.
olivewarbler 11-Jul-12 1:36am
Dim TextPath As New GraphicsPath
TextPath.AddString(ControlText, ControlFont.FontFamily, ControlFont.Style, ControlFont.Size, TextRectangle, StringFormat)

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I found an answer! If I set the pen's linejoin property to round, they disappear!
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,

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170628.1 | Last Updated 11 Jul 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100