【发布时间】:2019-04-12 11:09:49
【问题描述】:
我正在像这样在彼此之上绘制两个字符串:
gfx.DrawString("Complete Total (Ex VAT) £" + string.Format("{0:0.00}", totalCompletePrice), new XFont(roboto, 10 * 4, XFontStyle.Regular), XBrushes.Black, new XPoint(2445, 2225));
gfx.DrawString(header + " Total (Ex VAT) £" + string.Format("{0:0.00}", totalCompletePrice), new XFont(roboto, 10 * 4, XFontStyle.Regular), XBrushes.Black, new XPoint(2445, 2295));
但我的问题是它们不符合文档的结尾。我想不出一种从头开始绘制这些字符串的方法。所以 1,000.55 英镑总是相互对齐。
例子:
This is a really long header total £999.99
Complete Total (Ex VAT) £9999.99
我想得到它,以便价格彼此一致。有没有办法指定字符串放置的结束坐标并将其向后绘制?所以它从字符串的末尾开始并从该点绘制其余部分。我尝试了测量字符串功能,但它似乎无法正常工作。
我试过End X co-ord - text length,但没有正确对齐。
【问题讨论】: