mountainictbka57 Posted March 21, 2014 Share Posted March 21, 2014 hi, I want to use screen capture in c# but autoitx3.dll not include this function. help me to solve my problem. thanks very much. Link to comment Share on other sites More sharing options...
TheAutomator Posted March 21, 2014 Share Posted March 21, 2014 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. Retro Console, NestedArrayDisplay UDF foldermaker-pro-clone Link to comment Share on other sites More sharing options...
mountainictbka57 Posted March 22, 2014 Author Share Posted March 22, 2014 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? Link to comment Share on other sites More sharing options...
TheAutomator Posted March 22, 2014 Share Posted March 22, 2014 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. mountainictbka57 1 Retro Console, NestedArrayDisplay UDF foldermaker-pro-clone Link to comment Share on other sites More sharing options...
JohnOne Posted March 22, 2014 Share Posted March 22, 2014 You know there is no screencapture in autoitx dll, so logic says code one in C#. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
mountainictbka57 Posted March 23, 2014 Author Share Posted March 23, 2014 ok, I will try. Thanks you very much, The Automator. TheAutomator 1 Link to comment Share on other sites More sharing options...
Richard Robertson Posted March 24, 2014 Share Posted March 24, 2014 A really cheap way to do it in C# is this. http://msdn.microsoft.com/en-us/library/system.windows.forms.clipboard.getimage%28v=vs.110%29.aspx If you just use AutoItX or anything else to send a PrintScreen keypress, you can get the image from the clipboard. mountainictbka57 1 Link to comment Share on other sites More sharing options...
Muzaiyan Posted July 2, 2014 Share Posted July 2, 2014 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.) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now