VB.NET监视桌面活动。 [英] VB.NET monitor a desktop activity.

查看:84
本文介绍了VB.NET监视桌面活动。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有一个程序,每秒自动打印一个屏幕,使用计时器保存图像。它运作良好,我的问题是它吃的可能是磁盘空间1文件= 120KB。有没有办法做到这一点,不需要太多磁盘空间...也许是视频,gif任何东西。



请帮助..提前致谢



REVISION

我使用此功能获取桌面图像(在互联网上找到)

Hello everyone,

I have a program that automatically print screen every second an save the image using a timer. Its working well, my problem is that its eating may disk space 1 file = 120KB. Is there a way to do this which will not require much disk space... maybe a video, gif anything.

Please help.. Thanks in advance

REVISION
I use this function to get the desktop image (found this on the Internet)

Private Function CaptureScreen(ByVal locX As Integer, ByVal locY As Integer, ByVal width As Integer, ByVal height As Integer) As Bitmap
    Dim NewImage As New Bitmap(width, height)
    Dim g As Graphics = Graphics.FromImage(NewImage)
    g.CopyFromScreen(locX, locY, 0, 0, NewImage.Size)
    Return NewImage
End Function



在我的计时器中(1000秒间隔)


In my Timer (1000 second interval)

If Not IO.Directory.Exists("C:\Folder\") Then IO.Directory.CreateDirectory("C:\Folder\")
Dim bit As Bitmap = CaptureScreen(0, 0, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height)
bit.Save("C:\Folder\" & Format(Now, "yyyyMMdd hhmmss") & ".jpg", Imaging.ImageFormat.Jpeg)

推荐答案

不,上面的评论指向了完全错误的方向。压缩文件格式几乎无关紧要,只占百分之几。

真正有所作为的是概念:不是每次都存储整个屏幕,只是将差异存储在前一个屏幕上。也就是说,第一张图片是全屏,后来通常几乎没有任何需要存储的图片。找到一种方法来检测差异,并对它们进行编码,这样就可以恢复当前屏幕。对于长期录制,可能不时保存全屏,从而调整基线。
No, the comments above point into the totally wrong direction. The compressed file format does hardly matter, that can make up just a few percent.
What really makes a difference is the concept: instead of storing the whole screen everytime, store the difference to the previous screen only. That is, first picture is full screen, and later on it is most often almost nothing which needs to be stored. Find a way to detect the difference, and to encode them such taht you can restore the current screen. For long-term recordings, it could be appropriate to save the full screen from time to time, thus adjusting the base line.


这篇关于VB.NET监视桌面活动。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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