Nasurudeen Yasu

Nasurudeen Yasu

  • NA
  • 85
  • 20.9k

The handle is invalid

Nov 15 2012 1:46 AM
i am try to capture the scree by using following coding..

Dim gr As Graphics
        bm =
New Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, Drawing.Imaging.PixelFormat.Format32bppArgb)
        gr = Graphics.FromImage(bm)
        gr.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0,
New Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height))but


"The handle is invalid" error occoured..