0

我想要这个程序,当用户点击应用程序中或之外的东西时,制作屏幕截图并将其作为 jpeg 保存到文件夹

这是我想要将这些选项放入其中的代码:

Imports System.Net.Mail

Public Class Form1

Private Function TakeImage()
    Return TakeImage(0, 0, Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height)
End Function

   Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    PictureBox1.Image = CType(TakeImage(), Image)
End Sub
End Class

顺便说一句,我是 VB.NET 的初学者

4

1 回答 1

0

我猜它是一个桌面应用程序,并且 TakeImage(,,,) 有效。在您的表单中,添加一个按钮,双击它,然后从那里调用 TakeImage。
然后是另存为 jpeg - 只是谷歌如何将位图(?)格式从 TakeImage 转换为 jpeg 和谷歌如何保存它。在 VB.Net 中处理文件应该相当容易。

但首先在 TakeImage 函数上设置返回类型。大概喜欢as Image。它不会改变您的程序,而是一种很好的做法,并且会帮助您学习,因为编辑器会不断地为您提供帮助反馈。

快乐黑客!

于 2013-08-07T11:02:39.610 回答