十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
问题:引用原文:“要是换个思路,先截全屏,然后将窗体全屏,让Picturebox占满全屏幕,但是无论利用什么方法(最大化,boderstyle设为none)都遮挡不了任务栏。”
成都创新互联成立于2013年,是专业互联网技术服务公司,拥有项目成都做网站、成都网站建设网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元崂山做网站,已为上家服务,为崂山各地企业和个人服务,联系电话:13518219792
解决方法:经测试,代码可以实现你得要求,即能遮挡任务栏。
设置:在窗体上添加一个PictureBox1,,dock属性设置为Fill。随便导入一张图片用于显示。
代码如下:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
Me.WindowState = FormWindowState.Maximized
End Sub
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
Me.Close()
End Sub
End Class
程序截图:
'没办法,需的把窗口隐藏一下,还的隐藏后延迟一下再截图。
Dim WithEvents Timer1 As New Timer With {.Interval = 30, .Enabled = False}
Dim Imgrect As Rectangle
Dim img As Bitmap
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Imgrect = Me.RectangleToScreen(Me.ClientRectangle)
img = New Bitmap(Imgrect.Width, Imgrect.Height)
Me.Hide()
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Timer1.Stop()
Graphics.FromImage(img).CopyFromScreen(Imgrect.X, Imgrect.Y, 0, 0, Imgrect.Size)
Me.BackgroundImage = img
Me.Show()
End Sub
INTOUCH自带的就有,打印屏幕的命令
自己写个时间条件运行那命令就可以了
PRINTSCREEN这个命令 具体怎么用 看下帮助
希望我的回答对你有所帮助
如有其他问题,可以继续追问,您的采纳是我前进的动力!
Me.Refresh()
Dim memory As Image = New Bitmap(Me.Width, Me.Height)
Dim g As Graphics = Graphics.FromImage(memory)
g.CopyFromScreen(Me.Left, Me.Top, 0, 0, New Size(Me.Width, Me.Height)) '这里是截屏核心代码
Dim FilePath As String = ""
Dim d As New SaveFileDialog
d.Filter = "JPEG图像|*.JPEG"
If d.ShowDialog = Windows.Forms.DialogResult.OK Then
FilePath = d.FileName
If FilePath = "" Then Exit Sub
'If FilePath.Substring(FilePath.Length - 1, 1) "\" Then FilePath = FilePath "\"
Else
Exit Sub
End If
d.Dispose()
memory.Save(FilePath)
MessageBox.Show("图像已经保存到: " FilePath, "截图成功", MessageBoxButtons.OK, MessageBoxIcon.Information)