Jump to content

_WinAPI_MarkScreenRegionAndCapture 0.92 build 2017-01-22


UEZ
 Share

Recommended Posts

UEZ,

Excellent resource !! Awesome as always...:D

Win 7 32 BIT

BTW: whatever happened to your old avatar? the guy rubbing sand in his own face...  that was kewl B)

Keep um coming!

Bill

 

Link to comment
Share on other sites

2 hours ago, wakillon said:

Hi UEZ :)

Tested on Win8.1 x64 without problem.

Nice work ;)

Thanks for testing. :thumbsup:

 

1 hour ago, l3ill said:

UEZ,

Excellent resource !! Awesome as always...:D

Win 7 32 BIT

BTW: whatever happened to your old avatar? the guy rubbing sand in his own face...  that was kewl B)

Keep um coming!

Bill

 

Thanks also to you for testing :thumbsup:. You mean that image probably:

 

Quote

Prep
Photograph by Sucheta Das / AP
A traditional Indian wrestler smears mud on his head during a March practice session in Calcutta, India.

http://img.timeinc.net/time/pictures_of_the_year/pictures_of_the_year_28.jpg

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

3 minutes ago, jguinch said:

Works perfectly with multiple monitors

 

I know. :D

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

@junkew: well, the GDI / GDI+ stuff might be outdated meanwhile but it works probably and "fast" enough for basic tasks such as screen capturing and moving some "objects" around -> old school.

I didn't try DirectX neither Windows Media API yet but thanks for the link. Time to explore the DirectX / D2D stuff...

 

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

1 minute ago, coffeeturtle said:

Always appreciate your work @UEZ ! Thank you for sharing!

*cough* would be nice to have same concept but with video recording too *cough*  :-D  just throwing that out there...

Well with AutoIt video recording is a tough stuff but I had it implemented already in  AutoIt Windows Screenshooter

Try it out. ;)

 

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

No need to change anything, but could you comment on why this function doesn't pick up any "always on top" windows or dialogs.

I mention this because the PC's Print Screen button always captures the current view ... but the screen capture utilities I've tried usually don't.

 

Link to comment
Share on other sites

46 minutes ago, qwert said:

No need to change anything, but could you comment on why this function doesn't pick up any "always on top" windows or dialogs.

I mention this because the PC's Print Screen button always captures the current view ... but the screen capture utilities I've tried usually don't.

 

For me on Win10 b1607 it works properly also for MsgBoxes / GUI with topmost flag.

I need to test it in my Win7 / Vista vm...

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Now that you mention Win10, I do recall there was some issue related to Win7 running "non-Aero" ... which is how I configure my PCs.

What would be great is a setting in the capture function that could specify Aero mode just for the capture ... or some other method, of course.

Thanks for looking at this.

Link to comment
Share on other sites

Well, I just tested in my Win7 vm and it works properly with / without Aero. The AutoIt test GUI with topmost attribute is captured.

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

I've traced it to layered windows.  I put together a very simple example.  If I compile the script below, launch it and then run your capture, the torus is not captured.

;
;       Layered GUI for screen capture test
;
#include <GDIPlus.au3>
#include <WindowsConstants.au3>

_GDIPlus_Startup()
$hImage = _GDIPlus_ImageLoadFromFile("C:\AutoIt3\Examples\GUI\Torus.png")

Global $GUI = GUICreate("Layered Test", 200, 200, -1, -1, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_LAYERED)) ; layered is necessary
SetBitmap($GUI, $hImage, 255)
GUISetState()

Sleep(20000)

_GDIPlus_Shutdown()

Func SetBitmap($hGUI, $hImage, $iOpacity)
    Local Const $AC_SRC_ALPHA = 1                   ; don't really understand why these are set
    Local Const $ULW_ALPHA = 2
    Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend

    $hScrDC = _WinAPI_GetDC(0)
    $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC)
    $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
    $hOld = _WinAPI_SelectObject($hMemDC, $hBitmap)

    $tSize = DllStructCreate($tagSIZE)
    $pSize = DllStructGetPtr($tSize)
    DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth($hImage))
    DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage))
    $tSource = DllStructCreate($tagPOINT)
    $pSource = DllStructGetPtr($tSource)
    $tBlend = DllStructCreate($tagBLENDFUNCTION)
    $pBlend = DllStructGetPtr($tBlend)
    DllStructSetData($tBlend, "Alpha", $iOpacity)
    DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA)

    _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
    _WinAPI_ReleaseDC(0, $hScrDC)
    _WinAPI_SelectObject($hMemDC, $hOld)
    _WinAPI_DeleteObject($hBitmap)
    _WinAPI_DeleteDC($hMemDC)
EndFunc   ;==>SetBitmap

Is there some setting I can adjust on Win7 ... other than enabling Areo?

Link to comment
Share on other sites

Got it now - torus is not visible only when Aero is enabled.

One quick and dirty solution is to enable Aero within the script using

_WinAPI_DwmEnableComposition(True)

and disable Aero again when finished.

Anyhow, I will try to find a workaround...

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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

×
×
  • Create New...