一位好人帮我解决了排序问题,但是我还需要点东西。如下是代码: string str = "1233445ASDE65RED";
char[] result = str.ToCharArray();
string res = "";
for (int i = 0; i < result.Length; i++)
{
if (i == result.Length / 2)
res += "\n";
if (i % 2 == 0)
res += " ";
res += result[i];
}
Bitmap bitmap = new Bitmap(200, 200);
Graphics g = Graphics.FromImage(bitmap);
g.Clear(Color.Black);
Font f = new Font("arial", 14, FontStyle.Bold);
SizeF size = g.MeasureString(res,f);
g.DrawString(res, f, new SolidBrush(Color.White), bitmap.Width - size.Width, bitmap.Height - size.Height);
bitmap.Save(Response.OutputStream, ImageFormat.Jpeg);排序为2行2列,我想在他们的左侧和右侧方面添加AB和数字1234,如何将这些写入图片中?
图片的显示如何调整对齐?
char[] result = str.ToCharArray();
string res = "";
for (int i = 0; i < result.Length; i++)
{
if (i == result.Length / 2)
res += "\n";
if (i % 2 == 0)
res += " ";
res += result[i];
}
Bitmap bitmap = new Bitmap(200, 200);
Graphics g = Graphics.FromImage(bitmap);
g.Clear(Color.Black);
Font f = new Font("arial", 14, FontStyle.Bold);
SizeF size = g.MeasureString(res,f);
g.DrawString(res, f, new SolidBrush(Color.White), bitmap.Width - size.Width, bitmap.Height - size.Height);
bitmap.Save(Response.OutputStream, ImageFormat.Jpeg);排序为2行2列,我想在他们的左侧和右侧方面添加AB和数字1234,如何将这些写入图片中?
图片的显示如何调整对齐?
12 33 44 5A
AB 1234
SD E6 5R ED
还是
AB 12 33 44 5A
SD E6 5R Ed 1234?
DrawLine,DrawString画表格
需要高度g.MeasureString