vb.net 如何保存当前页为图片
提供两个思路
用printscreen,将其保存到文件,再调用outlook发出去,但是您说的超出一屏,就麻烦了;
以下代码保存为文件,引用自MSDN,由于我的SD版本不支持我的outlook,所以暂时无法给发送邮件的例子,请参考吧!
system.Windows.Forms.SendKeys.Send("%{PRTSC}")
If Not System.Windows.Forms.Clipboard.GetDataObject() Is Nothing Then
Dim oDataObj As IDataObject = System.Windows.Forms.Clipboard.GetDataObject()
If oDataObj.GetDataPresent(System.Windows.Forms.DataFormats.Bitmap) Then
Dim oImgObj As System.Drawing.Image = oDataObj.GetData(DataFormats.Bitmap, True)
'To Save as Bitmap
oImgObj.Save("F:\Test.bmp", System.Drawing.Imaging.ImageFormat.Bmp)
'To Save as Jpeg
oImgObj.Save("D:\Test.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg)
'To Save as Gif
oImgObj.Save("d:\Test.gif", System.Drawing.Imaging.ImageFormat.Gif)
End If
End If
2.另外出出报表,再调用outlook发出去,只给出数据性报表,而不一定是窗体本身;
广告 您可能关注的内容 |