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, 5, 6, 7, 8  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Sean



Joined: 12 Feb 2007
Posts: 2208

PostPosted: Fri Jan 02, 2009 2:33 pm    Post subject: Reply with quote

adamrgolf wrote:
Irfanview offers an option to capture just the active window.

You can do this
Code:
CaptureScreen(1, false, "c:\active_window.bmp")


Quote:
Code:
CaptureScreen(3,false,"c:\active_screen.bmp")

That can be done.
Code:
Else If aRect = 3
{
   DllCall("GetCursorPos", "int64P", pt)
   DllCall("GetMonitorInfo", "Uint", DllCall("MonitorFromPoint", "int64", pt, "Uint", 2), "Uint", NumPut(VarSetCapacity(mi,40,0),mi)-4)
   nL := NumGet(mi, 4, "int")
   nT := NumGet(mi, 8, "int")
   nW := NumGet(mi,12, "int") - nL
   nH := NumGet(mi,16, "int") - nT
}
Back to top
View user's profile Send private message
adamrgolf



Joined: 28 Dec 2006
Posts: 427

PostPosted: Fri Jan 02, 2009 3:03 pm    Post subject: Reply with quote

Sean wrote:
adamrgolf wrote:
Irfanview offers an option to capture just the active window.

You can do this
Code:
CaptureScreen(1, false, "c:\active_window.bmp")



Sorry, I meant to type active screen, not active window - I've edited my previous post. Also thanks for the code! I'll try it out when i get back to multi mon setup (at work).
Back to top
View user's profile Send private message
ifckladyluck



Joined: 20 Jan 2009
Posts: 16

PostPosted: Tue Jan 20, 2009 10:41 pm    Post subject: Reply with quote

if a window is semi-transparent, is there a way to make this take a screenshot of it as if it had 0 transparency?
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 2208

PostPosted: Wed Jan 21, 2009 12:38 am    Post subject: Reply with quote

ifckladyluck wrote:
if a window is semi-transparent, is there a way to make this take a screenshot of it as if it had 0 transparency?

Sure. Just use the window handle of a window instead of 0 when executing Get(Window)DC in the script. Or you can use PrintWindow API.
Back to top
View user's profile Send private message
ifckladyluck



Joined: 20 Jan 2009
Posts: 16

PostPosted: Wed Jan 21, 2009 12:57 am    Post subject: Reply with quote

Sean wrote:
ifckladyluck wrote:
if a window is semi-transparent, is there a way to make this take a screenshot of it as if it had 0 transparency?

Sure. Just use the window handle of a window instead of 0 when executing Get(Window)DC in the script. Or you can use PrintWindow API.


thank you sean this worked. the only problem is that it removes the border around it (taskbar and all)
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 2208

PostPosted: Wed Jan 21, 2009 1:10 am    Post subject: Reply with quote

ifckladyluck wrote:
thank you sean this worked. the only problem is that it removes the border around it (taskbar and all)

Use GetWindowDC instead of GetDC.
Back to top
View user's profile Send private message
WarmBeer
Guest





PostPosted: Fri Jan 30, 2009 8:28 pm    Post subject: ScreenCapture for Screen updates Reply with quote

All the input for AHK is greatly appreciated. It has saved me hours of time. This function gets me most of the way to a solution to my problem, I am looking for help with the remainder.

I access a database where there is a hierarchy of data elements. By double clicking on a parent element the list of child elements expands down, much like expanding a file list in Windows
Explorer. The child elements can range from 1 to several thousands. I need to extract how many children there are for each of 32,000 parents.

I have an AHK script that expands the list. Depending on the number of children, the database can take from seconds to several minutes to expand the list. Once the list is expanded the number of elements appears in the "fake" status bar. Unfortunately this information cannot be read by StatusBarGetText (it returns an errorlevel 1). So my script uses CaptureScreen to copy the section of the 'fake' status bar that holds the number of child elements and pastes it into Excel in the cell next to the parent element.

I need help with:
I would like a routine that reads the screen segment into the clipboard, as it does now, but then takes another snapshot and compares the 2. This way I can tell when children have dropped down, showing the number of children for that parent and proceed without having to sleep the maximum amount of time between each reading, which is the only way I know to do it now.

Once I have all the screen segments pasted in Excel I would like some way to compare them, so that say I can find all the parents that have 1, 2 or 3 children.

Can CaptureScreen be modified so that the rectangle coordinates refer to the active window, not the whole screen?

Thanks in advance for any help you are able to provide.
ed
Back to top
Sean



Joined: 12 Feb 2007
Posts: 2208

PostPosted: Sat Jan 31, 2009 1:49 am    Post subject: Reply with quote

WarmBeer wrote:
Can CaptureScreen be modified so that the rectangle coordinates refer to the active window, not the whole screen?

I don't think that's difficult, but, definitely I won't do that to the official one. You can change it however you like, though.
Back to top
View user's profile Send private message
SytnerIT



Joined: 01 Aug 2008
Posts: 16

PostPosted: Thu Feb 12, 2009 1:15 pm    Post subject: ScreenCapture Reply with quote

Hi

I have downloaded the ScreenCapture.ahk. But am confused to how to run it i.e. where do I set the values (file path etc.).

Cheers
Rob
Back to top
View user's profile Send private message
Precise



Joined: 30 Dec 2007
Posts: 25
Location: East Coast

PostPosted: Thu Feb 19, 2009 2:12 am    Post subject: Reply with quote

Thanks for this, especially the transparent window screening with location. I needed this to add a requested feature to a project I'm working on. You should consider including an option in the main function code that's posted to screen transparent windows. I'm sure many people have missed where you mentioned how to do it in this topic. Thanks again Sean for another great contribution.
_________________
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 2208

PostPosted: Fri Feb 20, 2009 2:48 am    Post subject: Reply with quote

Precise wrote:
You should consider including an option in the main function code that's posted to screen transparent windows.
I'm not sure if I understood you here. You mean option to enable/disable capturing the transparent windows?
Back to top
View user's profile Send private message
reneke



Joined: 22 Feb 2009
Posts: 2

PostPosted: Sun Feb 22, 2009 11:32 am    Post subject: Reply with quote

Great program, I'm getting more and more impressed of the possibilities of autohotkey each day!

1) does anyone have the code to capture a rectangle? (not complete screen/window)
2) what is the fastest way to add a watermark? Or can CaptureScreen automatic overlay a second picture in the result?

Thanks,
rene
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 2208

PostPosted: Sun Feb 22, 2009 2:50 pm    Post subject: Reply with quote

reneke wrote:
does anyone have the code to capture a rectangle? (not complete screen/window)
Code:
CaptureScreen("10,10,200,200") ; "left, top, right, bottom"

Quote:
Or can CaptureScreen automatic overlay a second picture in the result?
No. However, you can mimic the function CaptureCursor in the script.
Back to top
View user's profile Send private message
reneke



Joined: 22 Feb 2009
Posts: 2

PostPosted: Sun Feb 22, 2009 9:16 pm    Post subject: Reply with quote

[quote="Sean"]
reneke wrote:
does anyone have the code to capture a rectangle? (not complete screen/window)
Code:
CaptureScreen("10,10,200,200") ; "left, top, right, bottom"



Sorry, that is not what I mean. I want to specify the rectangle by using the mouse and draw a rectangle.

Gr,
rene
Back to top
View user's profile Send private message
victor
Guest





PostPosted: Sat Mar 07, 2009 1:20 pm    Post subject: Reply with quote

uhm look, I'm not sure if I'm missing something, but i cannot use this script at all. whenever I double click the ahk file, the tray icon just flickers for a second and nothing happened
I thought I was missing the gdiplus.dll, so I downloaded it here and put it in the same folder of the script
I'm a newbie here guys, any help? what did I do wrong?
Back to top
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, 5, 6, 7, 8  Next
Page 6 of 8

 
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