Taking Screenshot via vb.Net

Hi all,

i want to taking screenshots specific locations via vb.net using invoke code.

So anyone how can i use or how can do that??

I have to use code :frowning:


Please use the below code in invoke code activity

Private Function cc() As Bitmap
Dim s As Screen = Screen.PrimaryScreen
Dim img As New Bitmap(s.Bounds.Width, s.Bounds.Height)
Dim gr As Graphics = Graphics.FromImage(img)
gr.CopyFromScreen(s.Bounds.Location, Point.Empty, s.Bounds.Size)
Return img
End Function


when i write ‘Screen’ code, there is no screen available in the invoke code. Should i implement imports smt??

Thank you.