How to take Screenshot in windows 10 with visual basic . net

Asked

Viewed 93 times

0

Hello friends I am trying print strip in windows 10 it happens that the same tip with black screen, not taking print.I am using basic visual . net

Public Sub printar()

    Dim bounds As Rectangle
    Dim screenshot As System.Drawing.Bitmap
    Dim graph As Graphics

    System.Threading.Thread.Sleep(200)
    Bounds = Screen.PrimaryScreen.Bounds
    screenshot = New System.Drawing.Bitmap(Bounds.Width, Bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
    graph = Graphics.FromImage(screenshot)
    graph.CopyFromScreen(Bounds.X, Bounds.Y, 0, 0, Bounds.Size, CopyPixelOperation.SourceCopy)

    PictureBox1.Image = Tela.RetornaImagemControle(TextBox2.Text, bounds)


End Sub
  • Here for me it worked, I just had to change the last line to PictureBox1.Image = screenshot.

  • In windows 10 screen gets black, ie the print comes out black, I await help thanks...

  • My Windows is 10 too, and it just worked by changing that last line, as I said. What that function Tela.RetornaImagemControle() does? You don’t seem to be using the generated bitmap anywhere.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.