AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Screen Capture with Transparent Windows and Mouse Cursor
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Erwin
Guest





PostPosted: Fri Feb 08, 2008 12:00 am    Post subject: capture also screens with video running (WMV, AVI, etc) Reply with quote

Hello!

Nice piece of code!

Is it also possible to capture running wmv (avi and other video) files on the screen? Now I just get a transparent hole in my bmp.

Would be great, cause even ready made software (free) which can do that is very scarce!

Thanks!
Back to top
AHK Guest
Guest





PostPosted: Wed Feb 13, 2008 9:11 pm    Post subject: Unsupported parameter default Reply with quote

How do I use variables for the filename? I have tried
Code:
CaptureScreen(aRect = 0, bCursor = False, sFile = A_Now . ".png" )
but it says
Quote:
---------------------------
ScreenCapture.ahk
---------------------------
Error at line 26.

Line Text: CaptureScreen(aRect = 0, bCursor = False, sFile = A_Now . ".png" )
Error: Unsupported parameter default.

The program will exit.
---------------------------
OK
---------------------------

and
Code:
CaptureScreen(aRect = 0, bCursor = False, sFile = "%A_Now%.png" )
but it saves the file as %A_Now%.png without the variable converted. What is wrong?
Back to top
tic



Joined: 22 Apr 2007
Posts: 1336

PostPosted: Wed Feb 13, 2008 9:23 pm    Post subject: Reply with quote

Code:
CaptureScreen(0, 0, A_Now ".png")


read about functions in the documentation.
Back to top
View user's profile Send private message
BioBrain



Joined: 13 Feb 2008
Posts: 5
Location: Jakarta-Indonesia

PostPosted: Sat Feb 16, 2008 1:46 am    Post subject: Reply with quote

Hi Sean, that's a great script. I've using it for a while to search what kind of cursor is active right now coz it can capture mouse cursor.

I've been thinking, do U thing it's possible to search is image in clipboard is the same with image I want 2 search. kinda like ImageSearch but not on screen, but search in the Clipboard.

because b4 i use to to save it Hd 1st & show it 2 GUI 2 search it using imagesearch. And I think it'll be more efficient 2 search in clipboard.

Can U tell me how? tx b4.
Back to top
View user's profile Send private message Yahoo Messenger
krfiii
Guest





PostPosted: Thu Feb 28, 2008 5:50 am    Post subject: dont understand Reply with quote

I am trying to use Sean's syntax, and all I seem to get is the full screen (1920x1200) not sure what i am doing wrong here... even tried to comment out everything and just do the screen capture portion... same result. Running XPSP2... current AHK, just dled the screencapture.ahk

Code:

IfWinNotActive, EVE,
WinActivate, EVE,
WinWaitActive, EVE,

#Persistent
;#SingleInstance force
;SetKeyDelay, 11
;SetDefaultMouseSpeed, 11

#include ScreenCapture.ahk

;Process, Priority, MMine, H
;Process, Priority, MMine, A






;MsgBox, 4,, Would you like to continue? (press Yes or No)

;Gosub, Start

;Start:
Sleep, 2000

;KeyWait, LButton, D
;MouseGetPos, XPos, Ypos,
;X1:=XPos
;Y1:=YPos
;X2:=XPos+150
;Y2:=YPos+150
;Size=%X1%, %Y1%, %X2%, %Y2%
gosub, capscr


Return


Capscr:

sleep 1000
;CaptureScreen(Size, True, 0)
CaptureScreen("100,100,500,500", 0, 0)
return
Back to top
Guest






PostPosted: Thu Feb 28, 2008 12:41 pm    Post subject: Reply with quote

Your code will never run. If you'd like to use #include, remove from the head of ScreenCapture.ahk
Code:
CaptureScreen()
Return

And your current code will save it to the clipboard.
Back to top
Guest






PostPosted: Thu Feb 28, 2008 1:01 pm    Post subject: Reply with quote

BioBrain wrote:
I've been thinking, do U thing it's possible to search is image in clipboard is the same with image I want 2 search. kinda like ImageSearch but not on screen, but search in the Clipboard.

Sure it's possible. You can obtain, using GetClipboardData(), hbitmap (:DDB) or DIB. All necessary ones are ready by now. The remaining question is what procedure you're gonna use for the search, GetPixel through memory dc, where hbitmap is useful but maybe the slowest, or compare raw pixel, where DIB is handy, one by one, or may use hashes of the data.
Back to top
Guest






PostPosted: Thu Feb 28, 2008 4:00 pm    Post subject: Re: capture also screens with video running (WMV, AVI, etc) Reply with quote

Erwin wrote:
Is it also possible to capture running wmv (avi and other video) files on the screen? Now I just get a transparent hole in my bmp.

Would be great, cause even ready made software (free) which can do that is very scarce!

That's a whole lot different story. I don't think it's possible with the current AHK (alone) unless the DirectX surface is owned by AHK when the hardware acceleration is in effect.
Back to top
Shawn
Guest





PostPosted: Wed Mar 05, 2008 3:36 am    Post subject: Reply with quote

I'm new to AHK, and I'm wondering if this script can be modified to work on a minimized window without restoring it. Also, how exactly do I make it capture only a certain portion of the screen if I have the coords. Thanks.
Back to top
Guest






PostPosted: Wed Mar 05, 2008 4:22 pm    Post subject: Reply with quote

Shawn wrote:
I'm new to AHK, and I'm wondering if this script can be modified to work on a minimized window without restoring it. Also, how exactly do I make it capture only a certain portion of the screen if I have the coords. Thanks.

Use PrintWindow API, but you'll capture the extent of a minimized window.
Back to top
tinku99



Joined: 03 Aug 2007
Posts: 15

PostPosted: Mon Apr 07, 2008 3:50 pm    Post subject: multiple monitors Reply with quote

I am trying to screen capture from a second monitor, but I am having problems. It works fine on the first monitor:


aTest := scan_x_start . ", " . scan_x_start . ", " . scan_y_end . ", " . scan_y_end
CaptureScreen(aTest)
Back to top
View user's profile Send private message
heresy



Joined: 11 Mar 2008
Posts: 240

PostPosted: Fri Apr 18, 2008 7:31 pm    Post subject: Reply with quote

Does anybody know why this function doesn't work for me properly? Sad
I just simply tested it on my WinXP SP2
i can't handle it.
it only captures fullscreen, and saves to screen.bmp only whatever parameters were.

Code:
#Include ScreenShot.ahk

;Below are from the example
CaptureScreen(0)                                           ;Captures FullScreen and saves to screen.bmp
CaptureScreen(1)                                           ;same
CaptureScreen(2)                                           ;same
CaptureScreen("100, 100, 200, 200")                        ;same
CaptureScreen("100, 100, 200, 200, 400, 400")              ;same
CaptureScreen(1, 0,"test.png")                             ;same
CaptureScreen(2, False,"test.jpg")                         ;same
Back to top
View user's profile Send private message
Guest






PostPosted: Fri Apr 18, 2008 11:46 pm    Post subject: Reply with quote

The answer is a few post above.
Quote:
Your code will never run. If you'd like to use #include, remove from the head of ScreenCapture.ahk
Code:
CaptureScreen()
Return
Back to top
ZeosCentric
Guest





PostPosted: Thu May 29, 2008 5:29 am    Post subject: Reply with quote

Hello, thank you for this support group. Conversely, I have a simple question about this particular function, hopefully someone can take it seriously and see it for what it is. I have IP software I don't want people taking screenshots of.... this function seems to tap into windows dll calls to accomplish the task.

I am wondering, is there any anti-protection code I can implement, that would defeat this general function from working on my systems? Please let me know if anyone knows! Smile

Have the best day and thank you.
Back to top
tank



Joined: 21 Dec 2007
Posts: 473

PostPosted: Thu May 29, 2008 10:30 pm    Post subject: Reply with quote

Perfect for capturing errors when someone is running my scripts
thanks
_________________
Read this
Com
Automate IE7 with Tabs
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4  Next
Page 3 of 4

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group