S
Satya
Hi,
I am new to GDI+ in C# and so excuse me if this sounds silly. I need
to draw text at different places on the form (mainly TopLeft, TopRight,
BottomLeft and BottomRight). I can use either DrawString or DrawText
methods to do this. My problem is how do I calculate the TopLeft point
that I need to supply to these methods? In case we need to pass a
Rectangle parameter how do I calculate the UpperLeft point, width and
height of the Rectangle?
Do I have to do this manually by calculating the width of the string
(which can be multiline) and then based on my desired location
calculate the point or are there any methods in the SDK that do this
for us? Also if anyone has done this before some sample code would be
very much appreciated.
thanks,
Satya.
I am new to GDI+ in C# and so excuse me if this sounds silly. I need
to draw text at different places on the form (mainly TopLeft, TopRight,
BottomLeft and BottomRight). I can use either DrawString or DrawText
methods to do this. My problem is how do I calculate the TopLeft point
that I need to supply to these methods? In case we need to pass a
Rectangle parameter how do I calculate the UpperLeft point, width and
height of the Rectangle?
Do I have to do this manually by calculating the width of the string
(which can be multiline) and then based on my desired location
calculate the point or are there any methods in the SDK that do this
for us? Also if anyone has done this before some sample code would be
very much appreciated.
thanks,
Satya.