如何制作屏幕录像机 [英] How to make screen recorder behind form
本文介绍了如何制作屏幕录像机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在项目中遇到屏幕录制问题。我在prnt.sc上截了问题
这个链接
这是我的完整代码
I have problem with screen recording in project. I have screenshot the problem at prnt.sc
This link
And This is my full codes
Public Class frmMain
Private g As Graphics
Private bmp As Bitmap
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
bmp = New Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height)
g = Me.CreateGraphics()
g = Graphics.FromImage(bmp)
g.CopyFromScreen(MousePosition.X + 1, MousePosition.Y + 1, 0, 0, New Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height))
PictureBox1.Image = bmp
End Sub
End Class
>
我尝试了什么:
我希望我的代码记录我的屏幕而不是捕获我的表单(Form1)
感谢提前,Sammy
What I have tried:
I want my code record my screen and not capture my form (Form1)
Thanks for advance, Sammy
推荐答案
参见 Graphics.CopyFromScreen Method(System.Drawing) [ ^ ]。此方法复制当时显示的内容,因此如果您的表单正在显示,那么您将捕获该内容。
See Graphics.CopyFromScreen Method (System.Drawing)[^]. This method copies what is on display at that moment, so if your form is showing then that is what you will capture.
这篇关于如何制作屏幕录像机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文