Jump to content
Sign in to follow this  
Achilles

A GUI camera

Recommended Posts

This is a camera I made and it save you the trouble of cropping.

;Thanks to LazyCat for the .dll

#include <GUIConstants.au3>

$gui = GuiCreate('Camera', 400, 400, '', '', Bitand($WS_THICKFRAME, $WS_SIZEBOX))
WinSetTrans('Camera', '', 140)

$capture = GUICtrlCreateButton ("Capture Screen (within the 'camera' window)", 20, 340,250,30)
GUICtrlSetResizing ($capture,$GUI_DOCKBOTTOM+$GUI_DOCKSIZE+$GUI_DOCKHCENTER)
$exit = GUICtrlCreateButton ("Exit", 290, 340, 90, 30)
GUICtrlSetResizing ($exit,$GUI_DOCKBOTTOM+$GUI_DOCKSIZE+$GUI_DOCKHCENTER)
GuiSetState()

While 1 
    $msg = GuiGetMsg()
        If $msg = $GUI_EVENT_CLOSE or $msg = $exit then Exit                    
        If $msg = $capture then 
            $pos = WinGetPos('Camera')
            $time = @Hour & "-" & @MIN & "-" & @SEC
            DllCall("captdll.dll", "int", "CaptureRegion", "Str", "Picture" & $time & ".bmp", "int", $pos[0]+ 2 , "int", $pos[1] + 22, "int", $pos[2] - 2, "int", $pos[3] - 21, "int", -1)
        Endif
Wend

Let me know what you think

captdll.dll

Edited by Piano_Man

Share this post


Link to post
Share on other sites

you should make it completely transparent and make it set itself to the size of the currently active window and then when you press a hotkey itll save it to your desktop or wherever

Share this post


Link to post
Share on other sites

you should make it completely transparent and make it set itself to the size of the currently active window and then when you press a hotkey itll save it to your desktop or wherever

Well, the point of the program isn't really to just take a picture of a window, it's more for easier cropping or taking pictures of internet. But I think I'll try 'cause it could be useful too... I'll post the code if I get it working.

Share this post


Link to post
Share on other sites

Well then you could make it open paint and press ^V

That's one of the whole points of the program... It saves you from having to open paint and pasting and saving...

Helpful hint , WinGetClientSize, WinGetPos, and GuiSetCoord

Thanks, those look helpful... Edited by Piano_Man

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  

×
×
  • Create New...