Jump to content
Sign in to follow this  
ashly

_ScreenCapture_Capture cannot capture the whole screen

Recommended Posts

ashly

i'm trying to use _ScreenCapture_Capture($sFileName) to cature full screen and save as a jpg file, but it always only capture the left-top about 3/4 area.

but the print screen keyboard woks fine.

and if i changed the display resolution from 150% to 100%, the jpg file is OK as well.

so the issue only occurred when resolution is 150%.

is there anybody know why or how to change resolution percentage by scripts?

Thanks.

Share this post


Link to post
Share on other sites
ashly

@AutoBert thanks for your reply. yes, i had tried with values but it is still the same.

Edited by ashly

Share this post


Link to post
Share on other sites
ashly

@RTFC Thank u very much! My problem is solved after seeing the article u mentioned. :D

Share this post


Link to post
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
Sign in to follow this  

  • Similar Content

    • sharkeye
      By sharkeye
      #include <ScreenCapture.au3> Local $hBmp ; Capture full screen $hBmp = _ScreenCapture_Capture("") _ScreenCapture_SaveImage("C:\Software\autoitscripts\scripts\images\prp\ocr\"&"ocr_01.PNG",$hBmp) Sleep(1000) _ScreenCapture_Capture("C:\Software\autoitscripts\scripts\images\prp\ocr\"&"ocr_02.PNG") Sleep(1000) ShellExecute("C:\Software\autoitscripts\scripts\images\prp\ocr\"&"ocr_01.PNG") Sleep(1000) ShellExecute("C:\Software\autoitscripts\scripts\images\prp\ocr\"&"ocr_02.PNG") Hi All,
      This is my first post and I have checked the forum.  If this question has been asked and answered I apologise.
      The code above is intended to save the whole screen to a directory; it doesn't work.
      I have downloaded and copied and renamed the files referenced in https://www.autoitscript.com/forum/topic/192254-33143-fixes/ to my includes directory.
      Clearly there is some step that I am missing; do I need to download and register a dll?
       
      I know that I am using two different methods above but neither works for me.
    • milos83
      By milos83
      If I set the transparency with WinSetTrans, screenshot can't be made.
      This is Windows 7 related.
      Win 10 works fine
      Run the attached file
      #include <ScreenCapture.au3> ;GUI1 $gui1 = GUICreate("gui1", 200, 200, 200, 200) GUICtrlCreateLabel("GUI 1 LABEL", 50, 50 ) GUISetState() ;GUI 2 with transparency is completely ignored by _ScreenCapture_Capture $gui2 = GUICreate("gui1", 200, 200, 200, 200, -1, -1, $gui1) GUICtrlCreateLabel("GUI 2 LABEL", 100, 100 ) GUISetState() WinSetTrans($gui2, "", 150) Sleep(2000) _ScreenCapture_Capture(@MyDocumentsDir & "\GDIPlus_Image1.jpg", 200, 200, 405, 410) ShellExecute(@MyDocumentsDir & "\GDIPlus_Image1.jpg") As you can see, the semi transparent window will not be visible in the screenshot.
      I noticed that a couple of screen recording tools are acting the same. (But there are those that do work)
      I tried different ways on getting the screenshot and none worked.
      Printscreen does work.
      Is there a way to solve this without using Printscreen?
      ScreenCaptureProblem.au3
    • odaylton
      By odaylton
      I would like to get a region of the screen but avoiding having to save to a file first.
      I believe it is a lack of knowledge on my part but the GUICtrlSetImage function does not allow you to define an image without being a file.
      How to do this:
      ;.... $Pic3 = GUICtrlCreatePic("", 8, 64, 84, 84, -1, _ $WS_EX_STATICEDGE) ;para ter borda em baixo relevo ;.... _ScreenCapture_Capture(@ScriptDir & "\areatemp.jpg", 10, 10, 200, 200) GUICtrlSetImage($Pic3, @ScriptDir & "\areatemp.jpg") ;....  
    • Xandy
      By Xandy
      Screenshot program that can upload/FTP to website/storage with hotkey.
      Features GUI to display programmable keys.

      Set the hotkeys with this function to use, and display hotkeys.
      ; hotkey_set() Parameters: ; ----------------------------------------------------------- ; $aHotkey -                The array hotkeys are stored in. This function sets the values of this array[hotkey_id][$hotkey_data] ; $dHotkey_id -             The enum for this hotkey index ; $sHotkey_description -     The label displayed to the user to represent function of hotkey ; $sHotkey_name -            The hotkey it'self.  Whatever name string you want to give the key ; $dHotkey_key -             The _IsPressed keycode ;    Keycodes AT: https://www.autoitscript.com/autoit3/docs/libfunctions/_IsPressed.htm ; $dHotkey_shift -             Shift flag 0 or 1 Default off ; $dHotkey_ctrl -             Ctrl flag 0 or 1 Default off ; $dHotkey_alt -             Alt flag 0 or 1 Default off Func hotkey_set(ByRef $aHotkey, $dHotkey_id, $sHotkey_description, $sHotkey_name, $dHotkey_key, $dHotkey_shift = 0, $dHotkey_ctrl = 0, $dHotkey_alt = 0)     $aHotkey[$dHotkey_id][$eHotkey_data_key_description] = $sHotkey_description     $aHotkey[$dHotkey_id][$eHotkey_data_key_name] = $sHotkey_name     $aHotkey[$dHotkey_id][$eHotkey_data_key] = $dHotkey_key     $aHotkey[$dHotkey_id][$eHotkey_data_shift] = $dHotkey_shift     $aHotkey[$dHotkey_id][$eHotkey_data_ctrl] = $dHotkey_ctrl     $aHotkey[$dHotkey_id][$eHotkey_data_alt] = $dHotkey_alt EndFunc   ;==>hotkey_set ; You can set your hotkeys here ; Please visit the hotkey_set() function for parameter information hotkey_set($aHotkey, $eHotkey_screenshot_ftp, "Selected Window to FTP", "F12", "7B", 0, 1, 0); F12 hotkey_set($aHotkey, $eHotkey_screenshot_disk, "Selected Window to Disk", "S", "53", 1, 1, 1); S hotkey_set($aHotkey, $eHotkey_clipboard_send, "Send Clipboard keystrokes", "F10", "79", 1, 1, 1); F10  
      Configure settings dialog:

      Screenshot Filename and Screenshot Counter, are used to create simple unique filenames that can cycle. Copy URL to clipboard option. - For linking your screenshots. The screenshot file type is for local copy only. App always uses .JPG for FTP right now, but I could add FTP screenshot file type specification.  
      Any suggestions?  Did I break anything, what did I miss?
      Package uses TTS.au3 by Beege: 
       
      FTP_Screen.zip
      File includes:
         - FTP_Screen.au3
         - FTPScreen.ico
         - TTS.au3 - by Beege
    • junkone
      By junkone
      I have a script that takes screenshots of the ninjatrader charting window. I have 2 issues that i need an idea for solution.
      1. i need to scroll the window fully to right? the title of the window =$EURUSD  and the class of the scrollbar =WindowsForms10.SCROLLBAR.app.0.378734a
      i am already having the handle of the window using $hWnd = WinGetHandle($Title5) 
      how can i click the scrollbar all the way to right?Fixed
      2. sometimes the chart scaling is invalid and so there will be a icon F that i have highlighted with arrow on the image. its in the top right hand corder of this window. All i have to do is to click on it to restore the scaling. How can i find that point and automate the click?

      #include <ScreenCapture.au3> Example() Func Example() Local $hWnd Local $Title5 ="$EURUSD" Local $FilePath="c:\temp\images" Local $FileName="Filename" Opt("WinTitleMatchMode", 2) if($CmdLine[0]>0) Then ; Contains the total number of items in the array. $FileName=$CmdLine[1] EndIf If WinExists($Title5) Then ; MsgBox($MB_SYSTEMMODAL, "", $CmdLine[0]) ; Retrieve the handle of the Notepad window using the classname of Notepad. $hWnd = WinGetHandle($Title5) ; Activate the Notepad window using the handle returned by WinWait. WinActivate($hWnd) ;scroll to the right EndFunc ; click on focus icon ; Capture window _ScreenCapture_CaptureWnd( $FilePath & $FileName & $Title5 &".jpg", $hWnd) Else MsgBox($MB_SYSTEMMODAL, "", "Window does not exist") EndIf #CS If WinExists($Title1) Then ### ; MsgBox($MB_SYSTEMMODAL, "", $CmdLine[0]) ### ; Retrieve the handle of the Notepad window using the classname of Notepad. ### $hWnd = WinGetHandle($Title1) ### ; Activate the Notepad window using the handle returned by WinWait. ### WinActivate($hWnd) ### ### ; Capture window ### _ScreenCapture_CaptureWnd( $FilePath & $FileName & $Title1 &".jpg", $hWnd) ### ### Else ### MsgBox($MB_SYSTEMMODAL, "", "Window does not exist") ### EndIf #CE ShellExecute($FilePath & $FileName & $Title5 &".jpg") ShellExecute($FilePath & $FileName & $Title1 &".jpg") EndFunc ;==>Example  
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.