Let's go

winfrom将控件保存为图片

案例:将panelEx2保存为png图片

string chartUrl = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + @"Chart_d\" + velocityId + ".png";
Bitmap bmp = new Bitmap(panelEx2.Width, panelEx2.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
panelEx2.DrawToBitmap(bmp, new Rectangle(0, 0, panelEx2.Width, panelEx2.Height));
bmp.Save(chartUrl, System.Drawing.Imaging.ImageFormat.Png);

 将 Steema.TeeChart.TChart 保存为图片

string chartUrl = @".\Chart_d\" + velocityId + ".png"; 
tChart1.Export.Image.PNG.Save(chartUrl); //保存为png格式;

....

posted @ 2021-08-09 11:36  chenze  阅读(34)  评论(0编辑  收藏  举报
有事您Q我