C# 生成BMP图片

for(int i=1;i<34;i++)
{
   Bitmap bmp=new Bitmap(this.pictureBox1.Image);
   Graphics g=Graphics.FromImage((Image)bmp);
   g.SmoothingMode=System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
   g.InterpolationMode=InterpolationMode.HighQualityBicubic;
   g.CompositingQuality= CompositingQuality.HighQuality;
   g.FillEllipse(new SolidBrush(Color.Red),0,0,19,19);
   g.DrawString(Getstr((t.ToString)),new Font("Tahoma",10,FontStyle.Regular),new SolidBrush(Color.Black),2,2);
   pictureBox1.Image=(Image)bmp;
   //--保存
   Bitmap formBitmap=new Bitmap(this.pictureBox1.Width,this.pictureBox1.Height);
  pictureBox1.DrawToBitmap(formBitmap,new Rectangle(0,0,this.pictureBox1.Width,this.pictureBox1.Height));
  formBitmap.Save(@"C:\Image\B"+Getstr(i.ToString())+".bmp");
}

 

posted @ 2014-11-14 15:57  Jara  阅读(2323)  评论(0编辑  收藏  举报