Attention :-Ying-Shen Yu

G

Guest

Please refer to my post titled "GDI TextOut - Challenging Problem

If we use DrawSting, then it will not draw the string exactly fitting into the rectangle but a few px space is appended at the end. But since I want to leave a exact space of 8px to left and right irrespective of whatever is the font type ans size, i have to go for GDI TextOut

Why is it that the GDI+ DrawString appends few px to the string and doesn't draws it exactly fitting to a rectangle? Do u think it is a bug in DrawSting method of GDI+? There is no other method which I can use to draw a strinf which will fit to my reuirements, but it is in GDI. Why is it so

What is the difference between DrawText and DrawTextEx in GDI apart for the formatting options

Please suggest
 
A

Andrew S \(Infragistics\)

You can answer your first question by reading this article:
http://support.microsoft.com/default.aspx?scid=kb;en-us;307208

As for the second, you can probably answer it by comparing the parameters of
the 2 methods:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_0odw.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_4pbs.asp


Nilesh RAde said:
Please refer to my post titled "GDI TextOut - Challenging Problem"

If we use DrawSting, then it will not draw the string exactly fitting into
the rectangle but a few px space is appended at the end. But since I want to
leave a exact space of 8px to left and right irrespective of whatever is the
font type ans size, i have to go for GDI TextOut.
Why is it that the GDI+ DrawString appends few px to the string and
doesn't draws it exactly fitting to a rectangle? Do u think it is a bug in
DrawSting method of GDI+? There is no other method which I can use to draw a
strinf which will fit to my reuirements, but it is in GDI. Why is it so?
 
N

Nilesh Rade

Thanks Mr.Ying-Shen Yu,
I already know abt this article but it also says the same thing what I
said.
That means there no method in .NET which I can use to draw the string
exactly fitting into the rectangle. I will have to go for the unmanaged
code.......

I would appreciate if microsoft also wld have provided a methoed managed
method for drawinfg the string which exactly fits into the
rectangle.....
 
Top