
C#我用webbrowser的DrawToBitmap抓图为什么是空白的
2个回答
展开全部
web控件好像没有这方法,窗体的方法或许只拷贝窗体上的图形内容吧,还有个方法倒是行的。
拷贝屏幕:
Bitmap b =new Bitmap ( this.webBrowser1.ClientSize.Width ,this.webBrowser1 .ClientSize .Height );
Point sP = this.webBrowser1.PointToScreen(this.webBrowser1.Location );
Graphics.FromImage(b).CopyFromScreen( sP,new Point(0, 0), this.webBrowser1.ClientSize);
b.Save ("c:\\img.jpg");
拷贝屏幕:
Bitmap b =new Bitmap ( this.webBrowser1.ClientSize.Width ,this.webBrowser1 .ClientSize .Height );
Point sP = this.webBrowser1.PointToScreen(this.webBrowser1.Location );
Graphics.FromImage(b).CopyFromScreen( sP,new Point(0, 0), this.webBrowser1.ClientSize);
b.Save ("c:\\img.jpg");
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?

2023-05-10 广告
您好!建议咨 深圳市微测检测有限公司,已建立起十余个专业实验室,企业通过微测检测就可以获得一站式的测试与认 证解决方案;(EMC、RF、MFi、BQB、QI、USB、安全、锂电池、快充、汽车电子EMC、汽车手机互 联、语音通话质量),认证遇...
点击进入详情页
本回答由微测检测5.10提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询