Using screenshot in vb Invoke Code

Hi all,

i need to use take screenshot via v.b invoke code. How can i use it? or write?

  • Cannot use activity, write a code (obligation) :frowning:

Thank you.

HI,

How about the following?

 img = UiPath.Core.Image.CreateFromScreen(New Rectangle(0,0,1024,768),Nothing,Nothing,Nothing)

Sequence.xaml (5.6 KB)

Regards,

1 Like

Hi,

Thanks for response. The code is worked well.

I need to write a note here about this code.

Sometimes usage of rectangle can be conflicting a library that’s why program can give the error.

NOT : if you get this error code : "rectangle is ambiguous imported from the namespaces or types ‘System.Drawing, Microsoft.Office.Interop.Excel’ "

You can write this => img = UiPath.Core.Image.CreateFromScreen(New System.Drawing.Rectangle(0,0,1024,768),Nothing,Nothing,Nothing)

or short answer => Instead of using rectangle, use this System.Drawing.Rectangle

Regards.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.