Click here to Skip to main content
12,405,303 members (65,085 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB GDI+ graphics VB.NET Text
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
http://i46.tinypic.com/23k2no.jpg[^]
Posted 10-Jul-12 18:59pm
Updated 10-Jul-12 19:01pm
v2
Comments
   
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

Rate this: bad
 
good
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!
  Permalink  
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 11 Jul 2012
Copyright © CodeProject, 1999-2016
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