从下往上画的文字

private void draw()
{
Bitmap bmap = new Bitmap(1650, 1850);
Graphics g = Graphics.FromImage(bmap);
g.Clear(Color.White);

g.DrawString(Convert.ToString("12.501"),
new Font("宋体", 10),
Brushes.Black,
200,
200,
new StringFormat(StringFormatFlags.DirectionVertical));

g.DrawString(Convert.ToString("600"),
new Font("宋体", 10),
Brushes.Black,
600,
600,
new StringFormat(StringFormatFlags.DirectionVertical));


//设置旋转中心点
g.TranslateTransform(Convert.ToSingle(textBox1.Text), Convert.ToSingle(textBox2.Text));
//设置旋转角度
g.RotateTransform(90 * 3);
//平移
//g.TranslateTransform(0, 0);
//画文字
g.DrawString(Convert.ToString("12.501"),
new Font("宋体", 10),
Brushes.Black,
Convert.ToSingle(textBox3.Text),
Convert.ToSingle(textBox4.Text) );
//恢复为默认场景
g.ResetTransform();

pictureBox1.Image = bmap;
}

private void button1_Click(object sender, EventArgs e)
{
draw();
}

posted @ 2020-09-08 18:01  惊蛰-  阅读(211)  评论(0编辑  收藏  举报