vb.net问题 [英] vb.net quesion

查看:85
本文介绍了vb.net问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想通过编码来获取表单的打印屏幕.

有可能吗?

如果是这样,请给我一些想法和示例代码.

Hi,

I want to take print screen of my forms through out coding.

Is that possible?

If so please give me some idea''s and sample coding.

推荐答案

这有帮助吗?

Does this help?

' Create a new Bitmap object with the screen bounds
Dim b As Bitmap = New Bitmap(My.Computer.Screen.Bounds.Width,My.Computer.Screen.Bounds.Height, Imaging.PixelFormat.Format32bppArgb)
' Create a Graphics object that will process the screen shot
Dim gfx As Graphics = Graphics.FromImage(b)
' Copy the screen contents
gfx.CopyFromScreen(My.Computer.Screen.Bounds.X,My.Computer.Screen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy)
' Save the resulting graphics
b.Save("my2.jpg", Imaging.ImageFormat.Jpeg)


这篇关于vb.net问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆