VB.NET更改屏幕截图的图片分辨率

时间:2020-09-01 20:45:06

标签: vb.net

我正在使用此代码保存表单的屏幕截图。我需要设置更高的分辨率,因为在Windows 10中由于某种原因它看起来并不那么好。这是我用来尝试更改分辨率的方法(没有成功)。 bmp.setresolution不起作用。

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Dim myDate As String
    myDate = DateTime.Now.ToString("MM.dd.yyyy_HH.mm.ss")
    Button1.Visible = False
    Me.Text = SystemInformation.UserName
    Dim bmp As Bitmap = New Bitmap(Me.Width, Me.Height)
    ''>>>> bmp.SetResolution(600, 600)
    Me.DrawToBitmap(bmp, New Rectangle(New Point(0, 0), Me.Size))
    bmp.Save("C:\temp\4-946020-12_" & myDate & ".bmp") 'Set your path and your filename here
    Me.Dispose()
End Sub

0 个答案:

没有答案