MRXTO09 Posted April 10, 2014 Posted April 10, 2014 (edited) in windows 8 the games in windowed mode when you do the screenshot the image is black ho i can detect the black screen? i've found this and i 've tried to change with the screen capture but don't work expandcollapse popupFunc _isBlackScreen() Local $hImage, $iW, $iH, $tBitmapData, $iStride, $iScan0, $sRet Local $hBmp, $hBitmap, $hGraphic, $tCodeBuffer, $bytecode, $tPixelData _GDIPlus_Startup() $hBitmap = _ScreenCapture_Capture() $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap) $iW = _GDIPlus_ImageGetWidth($hImage) $iH = _GDIPlus_ImageGetHeight($hImage) ;=> Start Work around For XP, GDIPBitmapLockBits() seem to hard crash autoit When using images that are less then 24bpp ; If your using Vista or Newer OS then this won't be called or needed. ; http://www.autoitscript.com/forum/index.php?showtopic=102626&view=findpost&p=728034 If StringInStr("WIN_2003,WIN_XP,WIN_2000", @OSVersion) Then Local $aRet, $hBmp, $hBitmap, $hGraphic $aRet = _GDIPlus_ImageGetPixelFormat($hImage) If Int(StringRegExpReplace($aRet[1], "\D+", "")) < 24 Then $hBmp = _WinAPI_CreateBitmap($iW, $iH, 1, 32) $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBmp) _WinAPI_DeleteObject($hBmp) $hGraphic = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0) _GDIPlus_ImageDispose($hImage) _GDIPlus_GraphicsDispose($hGraphic) $hImage = _GDIPlus_BitmapCloneArea($hBitmap, 0, 0, $iW, $iH, $GDIP_PXF32ARGB) _GDIPlus_BitmapDispose($hBitmap) EndIf EndIf ;=> End Work around $tBitmapData = _GDIPlus_BitmapLockBits($hImage, 0, 0, $iW, $iH, $GDIP_ILMWRITE, $GDIP_PXF32ARGB) $iStride = DllStructGetData($tBitmapData, "stride") $iScan0 = DllStructGetData($tBitmapData, "Scan0") $tPixelData = DllStructCreate("dword[" & (Abs($iStride * $iH)) & "]", $iScan0) $bytecode = "0x8B7424048B4C24088B0638E0750EC1E80838E0750783C604E2EE31C0C3" $tCodeBuffer = DllStructCreate("byte[" & StringLen($bytecode) / 2 - 1 & "]") ;alloc some memory DllStructSetData($tCodeBuffer, 1, $bytecode) ;write bytecode into struct $sRet = DllCall("user32.dll", "ptr", "CallWindowProcW", "ptr", DllStructGetPtr($tCodeBuffer), "ptr", DllStructGetPtr($tPixelData), "int", $iW * $iH, "int", 0, "int", 0);returns eax in ret[0] _GDIPlus_BitmapUnlockBits($hImage, $tBitmapData) _GDIPlus_ImageDispose($hImage) _GDIPlus_Shutdown() Return ($sRet[0] = 0) EndFunc ;==>_IsImageGrayScale Edited April 10, 2014 by MRXTO09
Palestinian Posted April 10, 2014 Posted April 10, 2014 Please read the Forum Rules, Specially this part: 1. Do not ask for help with AutoIt scripts, post links to, or start discussion topics on the following subjects: .... Launching, automation or script interaction with games or game servers, regardless of the game. ...
Unc3nZureD Posted April 10, 2014 Posted April 10, 2014 I don't think it's related to games only. Taking screenshots isn't automating any way the game and in my opinion it's not against the rules, but who knows. Moderators will decide Anyways: MRXTO09 - I can't really understand what's the question? Do you want to bypass the limitation and make a screenshot even if such software is running? Or you just want to detect if the screenshot failed?(since you told the second, but it doesn't seem to be logical).
MRXTO09 Posted April 10, 2014 Author Posted April 10, 2014 I don't think it's related to games only. Taking screenshots isn't automating any way the game and in my opinion it's not against the rules, but who knows. Moderators will decide Anyways: MRXTO09 - I can't really understand what's the question? Do you want to bypass the limitation and make a screenshot even if such software is running? Or you just want to detect if the screenshot failed?(since you told the second, but it doesn't seem to be logical). Please read the Forum Rules, Specially this part: you have misunderstood! I wanted to do a program like fraps to take screenshots and if he saw a screenshot black not save it. here as
Moderators Melba23 Posted April 10, 2014 Moderators Posted April 10, 2014 MRXTO09,I wanted to do a program like fraps to take screenshotsAre these screenshots specifically of the game window as a record of its current state? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Unc3nZureD Posted April 10, 2014 Posted April 10, 2014 I'm not sure, but you could use this UDF: '?do=embed' frameborder='0' data-embedContent>> You can search for black pixels, if there are X amount of the next to each other, than it's possibly a black screenshot.
Moderators Melba23 Posted April 10, 2014 Moderators Posted April 10, 2014 MRXTO09,Then that counts as "game interaction" - thread locked. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Recommended Posts