Click here to Skip to main content
15,881,424 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
The method DrawString() gives out a very nice result, the text/string is drawn clearly as you type it into a textbox. However I tried another way (a by-way) but it showed a bad appearance. I need to do this way because I want to apply some transformations to the string first (such as rotating). The way I did is creating a GraphicsPath, using AddString() method to add some string to that GraphicsPath, then using DrawPath() to draw that string. The drawn string looked very ugly (I didn't specify a bold font but it seemed to be affected by bold style, the string was like as blurred, ... it was really not what I want.

Do you know any options to change for this to work better (like DrawString() can do)?

Thank you!

VipHaLong.
Posted

1 solution

You don't really need to represent a string as a graphic path for proper transform. Transformations are done using System.Drawing.Graphics.Transform:
http://msdn.microsoft.com/en-us/library/system.drawing.graphics.transform.aspx[^],
http://msdn.microsoft.com/en-us/library/system.drawing.drawing2d.matrix.aspx[^].

—SA
 
Share this answer
 
Comments
supernorb 18-Mar-13 4:52am    
Thank you, I have known of this before but really don't know why I could overlook it. Thanks.
Sergey Alexandrovich Kryukov 18-Mar-13 10:09am    
You are welcome,
—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