Jump to content

screen capture


Recommended Posts

mountainictbka57,

There are a few other com dll's you can use maybe? like JSdraw.dll.

autoitx3.dll does not include this function but you can easily do this in AutoIT:

#include <ScreenCapture.au3>

; Capture full screen
_ScreenCapture_Capture(@MyDocumentsDir & "\GDIPlus_Image1.jpg")

ShellExecute(@MyDocumentsDir & "\GDIPlus_Image1.jpg")

; Capture region
_ScreenCapture_Capture(@MyDocumentsDir & "\GDIPlus_Image2.jpg", 0, 0, 796, 596)

ShellExecute(@MyDocumentsDir & "\GDIPlus_Image2.jpg")

Best regards,

TheAutomator.

Link to comment
Share on other sites

mountainictbka57,

 

I write a c# program, I use autoit on it. but I not found a function like _ScreenCapture_Capture in c#. can you help me?

 

There is no function like _ScreenCapture_Capture in c#

so i guess you have to use a 3rd party dll or make some autoit script and compile it to exe, then call it with your arguments..

but that will be a serious workaround..

I'm not a C# programmer but you can always use a popular search engine to find an answer...

Your making a C# program and you want to implement some autoit functions right?

The autoit activeX dll ha's no screen capture functions in it, but the dll "JSdraw" does, so why can't you use that?

Regards,

TheAutomator.

Link to comment
Share on other sites

  • 3 months later...

if you know less about Dll call then you can use command line option.
.

Compile this code and run it with desired arguments.

#cs ----------------------------------------------------------------------------
    
    AutoIt Version: 3.3.10.2
    Author:         Muzaiyan
    
    Script Function:
    Screen Capture using command lines.
    
#ce ----------------------------------------------------------------------------


#include <ScreenCapture.au3>
If $cmdline[0] < 1 Then Exit -1

; capture whole screen
If $cmdline[0] = 1 Then
    _ScreenCapture_Capture($cmdline[1])
    If FileExists($cmdline[1]) Then Exit 1
EndIf

; capture region
If $cmdline[0] = 5 Then
    _ScreenCapture_Capture($cmdline[1], $cmdline[2], $cmdline[3], $cmdline[4], $cmdline[5])
    If FileExists($cmdline[1]) Then Exit 1
EndIf
Exit -1

It will return exit code 1 on success.

Exit code will be -1 on error.

(Convert this code into Executable to make it accept arguments.)  :)  :P 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...