mountainictbka57 1 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. Share this post Link to post Share on other sites
TheAutomator 15 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 Share this post Link to post Share on other sites
mountainictbka57 1 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? Share this post Link to post Share on other sites
TheAutomator 15 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. 1 mountainictbka57 reacted to this Retro Console, NestedArrayDisplay UDF Share this post Link to post Share on other sites
JohnOne 1,603 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. Share this post Link to post Share on other sites
mountainictbka57 1 Posted March 23, 2014 ok, I will try. Thanks you very much, The Automator. 1 TheAutomator reacted to this Share this post Link to post Share on other sites
Richard Robertson 187 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. 1 mountainictbka57 reacted to this Share this post Link to post Share on other sites
Muzaiyan 9 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.) Share this post Link to post Share on other sites