C
charsh
Hi,
I using the code below to draw a text in a pictureBox1.
//Start---------------------------------------------------------------
private void button1_Click(object sender, System.EventArgs e)
{
Graphics g;
g = pictureBox1.CreateGraphics();
g.FillRectangle(Brushes.White,0,0,160,160);
Font f = new Font("Arial", 14);
StringFormat format = new StringFormat (StringFormatFlags.NoClip);
format.Alignment = StringAlignment.Center;
format.LineAlignment = StringAlignment.Center;
g.DrawString("Hello",f,Brushes.Red,40,40,format);
}
//End-------------------------------------------------------------------
My question is how to save the result(it is a "hello" in the pictureBox1) to
a bitmap file.
I mean the bitmap file will contain the "Hello" which i drawed.
thx.
I using the code below to draw a text in a pictureBox1.
//Start---------------------------------------------------------------
private void button1_Click(object sender, System.EventArgs e)
{
Graphics g;
g = pictureBox1.CreateGraphics();
g.FillRectangle(Brushes.White,0,0,160,160);
Font f = new Font("Arial", 14);
StringFormat format = new StringFormat (StringFormatFlags.NoClip);
format.Alignment = StringAlignment.Center;
format.LineAlignment = StringAlignment.Center;
g.DrawString("Hello",f,Brushes.Red,40,40,format);
}
//End-------------------------------------------------------------------
My question is how to save the result(it is a "hello" in the pictureBox1) to
a bitmap file.
I mean the bitmap file will contain the "Hello" which i drawed.
thx.