请教C#中GDI+画的图怎样才能保存为bmp或jpg格式呢
请教C#中GDI+画的图怎样才能保存为bmp或jpg格式呢!我看过一些C++中保存为bmp格式的例子,其中用到了设备上下文DC。那么在C#中该用什么呢,有没有不调用api函数的方法?
------解决方案--------------------Bitmap bmp = new Bitmap(300, 400); 
             Graphics g = Graphics.FromImage(bmp); 
             g.Clear(Color.White); 
             g.DrawString( "测试的文本 ", this.Font, new SolidBrush(Color.Black), new Point(100, 25)); 
             g.Dispose(); 
             SaveFileDialog dlg = new SaveFileDialog(); 
             if (dlg.ShowDialog() == DialogResult.OK) 
             { 
                 bmp.Save(dlg.FileName,System.Drawing.Imaging.ImageFormat.Bmp); 
             } 
             bmp.Dispose();