Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# GDI+ graphics WinForm
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 17-Mar-13 18:56pm
supernorb2.6K

1 solution

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

Solution 1

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
  Permalink  
Comments
supernorb at 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 at 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)

  Print Answers RSS
0 OriginalGriff 7,903
1 Sergey Alexandrovich Kryukov 7,142
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,820


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 18 Mar 2013
Copyright © CodeProject, 1999-2014
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