Click here to Skip to main content
15,908,166 members
Home / Discussions / C#
   

C#

 
GeneralRe: Using lock statement inside overloaded methods Pin
Covean22-Oct-09 2:53
Covean22-Oct-09 2:53 
Questionhow to create multiple connections in a client application Pin
Ajithevn21-Oct-09 23:36
Ajithevn21-Oct-09 23:36 
QuestionRe: how to create multiple connections in a client application Pin
Björn T.J.M. Spruit22-Oct-09 0:00
Björn T.J.M. Spruit22-Oct-09 0:00 
AnswerRe: how to create multiple connections in a client application Pin
Ajithevn22-Oct-09 0:11
Ajithevn22-Oct-09 0:11 
AnswerRe: how to create multiple connections in a client application Pin
Abhishek Sur22-Oct-09 0:07
professionalAbhishek Sur22-Oct-09 0:07 
GeneralRe: how to create multiple connections in a client application Pin
Ajithevn22-Oct-09 0:17
Ajithevn22-Oct-09 0:17 
QuestionRe: how to create multiple connections in a client application Pin
Ajithevn22-Oct-09 1:04
Ajithevn22-Oct-09 1:04 
QuestionText blurring using Graphics.Drawstring Pin
Björn T.J.M. Spruit21-Oct-09 23:04
Björn T.J.M. Spruit21-Oct-09 23:04 
I'm writing strings at a pre-determined location to a bitmap.
Though, it seems that if the location isn't "snapped to the grid", blurring occurs.
Simple example:
public Bitmap WriteToBitmap(Bitmap bitmapToWriteTo, float X_Pos, float Y_Pos)
{
    Graphics g = Graphics.FromImage(bitmapToWriteTo);
    g.SmoothingMode = SmoothingMode.AntiAlias;
    g.TextRenderingHint = TextRenderingHint.AntiAlias;
    g.InterpolationMode = InterpolationMode.HighQualityBilinear;

    g.DrawString(this.text, this.font, new SolidBrush(Color.Black), X_Pos, Y_Pos, this.stringFormat);

    return bitmapToWriteTo;
}


Nothing else is being done to the bitmap object or any of the other objects involved.
So you may consider the code above as being used as is.
The problem is, however, that using it like this, causes blurring in the text when drawn.
There is a solution to stop the blurring and that is by changing the TextRenderingHint:
g.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;

Now, this causes the text being drawn to be "snapped to a grid".
However, this messes up my positioning, making it look chaotic.

My question is this, how can I get the result of TextRenderingHint.AntiAliasGridFit, without losing the positioning.
And, to what "grid" is the text being snapped to and am I able to manipulate it ?
AnswerRe: Text blurring using Graphics.Drawstring Pin
Björn T.J.M. Spruit22-Oct-09 1:54
Björn T.J.M. Spruit22-Oct-09 1:54 
GeneralRe: Text blurring using Graphics.Drawstring Pin
Covean22-Oct-09 2:15
Covean22-Oct-09 2:15 
GeneralRe: Text blurring using Graphics.Drawstring [modified] Pin
Björn T.J.M. Spruit22-Oct-09 2:54
Björn T.J.M. Spruit22-Oct-09 2:54 
GeneralRe: Text blurring using Graphics.Drawstring Pin
Covean22-Oct-09 3:18
Covean22-Oct-09 3:18 
GeneralRe: Text blurring using Graphics.Drawstring Pin
Björn T.J.M. Spruit22-Oct-09 3:27
Björn T.J.M. Spruit22-Oct-09 3:27 
NewsRe: Text blurring using Graphics.Drawstring Pin
Björn T.J.M. Spruit30-Oct-09 4:25
Björn T.J.M. Spruit30-Oct-09 4:25 
GeneralRe: Text blurring using Graphics.Drawstring Pin
User 680178026-Feb-10 8:05
User 680178026-Feb-10 8:05 
QuestionHow to pass any text value from form to Crystal Report ? Pin
E_Gold21-Oct-09 22:53
E_Gold21-Oct-09 22:53 
AnswerRe: How to pass any text value from form to Crystal Report ? Pin
Arun Kallingal22-Oct-09 18:24
Arun Kallingal22-Oct-09 18:24 
QuestionSort and get element Pin
abbd21-Oct-09 22:47
abbd21-Oct-09 22:47 
AnswerRe: Sort and get element Pin
nagendrathecoder21-Oct-09 22:53
nagendrathecoder21-Oct-09 22:53 
GeneralRe: Sort and get element Pin
abbd21-Oct-09 22:57
abbd21-Oct-09 22:57 
GeneralRe: Sort and get element Pin
nagendrathecoder21-Oct-09 23:24
nagendrathecoder21-Oct-09 23:24 
AnswerRe: Sort and get element Pin
stancrm21-Oct-09 23:29
stancrm21-Oct-09 23:29 
QuestionWindows programming in C# - API and All? Pin
CelestialCoder21-Oct-09 22:08
CelestialCoder21-Oct-09 22:08 
AnswerRe: Windows programming in C# - API and All? Pin
Richard MacCutchan21-Oct-09 22:49
mveRichard MacCutchan21-Oct-09 22:49 
QuestionClient Server Application C# Pin
Anjum12321-Oct-09 22:03
Anjum12321-Oct-09 22:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.