1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| // **********************************************************************
// mBnd=MarginBound
private SizeF prCenter(string p, RectangleF mBnd, float y, Font cFont, Brush brA, Graphics curGraphics)
{
SizeF szf = curGraphics.MeasureString(p, cFont);
float x = mBnd.Left + (mBnd.Width - szf.Width) / 2;
curGraphics.DrawString(p, cFont, brA, x, y);
return szf;
}
// **********************************************************************
private SizeF prPos(string p, float posX, float y, Font cFont, Brush brA, Graphics curGraphics)
{
SizeF szf = curGraphics.MeasureString(p, cFont);
curGraphics.DrawString(p, cFont, brA, posX, y);
return szf;
}
// **********************************************************************
private SizeF prPosBottom(string p, float posX, float y, Font cFont, Brush brA, Graphics curGraphics)
{
SizeF szf = curGraphics.MeasureString(p, cFont);
curGraphics.DrawString(p, cFont, brA, posX, y - szf.Height);
return szf;
}
// **********************************************************************
private SizeF prRight(string p, float posX, float y, Font cFont, Brush brA, Graphics curGraphics)
{
SizeF szf = curGraphics.MeasureString(p, cFont);
curGraphics.DrawString(p, cFont, brA, posX - szf.Width, y);
return szf;
} |
Partager