G
Guest
I need to put a bunch of characters in a grid like control, and am using
DrawString method to put the character. The problem is:
1. The size of drawing rect is fixed, 32x32
2. For some fonts, 14 points if perfect for this size of rect. However, for
others, it is too small.
Is there a way to know in advance what is the widest and highest character
in terms of pixels so that I can choose the font size appropriately?
The function I am used to draw the text:
g.DrawString(m_chars[index++].ToString(), this.Font, b, rect, format);
DrawString method to put the character. The problem is:
1. The size of drawing rect is fixed, 32x32
2. For some fonts, 14 points if perfect for this size of rect. However, for
others, it is too small.
Is there a way to know in advance what is the widest and highest character
in terms of pixels so that I can choose the font size appropriately?
The function I am used to draw the text:
g.DrawString(m_chars[index++].ToString(), this.Font, b, rect, format);