使用了无效参数,是什么原因?

softmse softmse 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

//打印预览
public void printerView(Panel mainpanel,PictureBox[] mypb,bool rst)
{
this.currentPage = 1;
getTableValue(mainpanel,mypb);
try
{
PrintDocument pd = new PrintDocument();
pd.QueryPageSettings+= new QueryPageSettingsEventHandler(this.QueryPageSettingsEventHandler );
pd.PrintPage += new PrintPageEventHandler( this.PrintPageEventHandler);


Bitmap img=new Bitmap(mainpanel.AutoScrollMinSize.Width,mainpanel.AutoScrollMinSize.Height);
Graphics imgG=Graphics.FromImage(img);
imgG.Clear(mainpanel.BackColor);
if (rst)
{
printerp_Paint(mainpanel,new PaintEventArgs(imgG,mainpanel.ClientRectangle));
}
else
{
printer_Paint(mainpanel,new PaintEventArgs(imgG,mainpanel.ClientRectangle));
}
if ( this.storedPageSettings != null )
pd.DefaultPageSettings = this.storedPageSettings ;
PrintPreviewDialog dlg = new PrintPreviewDialog();
dlg.Document = pd;
dlg.ShowDialog();
}
运行到Bitmap img=new Bitmap(mainpanel.AutoScrollMinSize.Width,mainpanel.AutoScrollMinSize.Height);出错,是何原因?

...全文

相关推荐

评论 1
收藏 已收藏
分享
返回顶部
softmse
C# 111,128 成员 642,536 内容