Jump to content

A GUI camera


Achilles
 Share

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
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

Yeah and you can only have on thing on the clipboard at a time, this would allow very fast picture taking/saving. Great work!

EDIT: :P couldn't figure out why it wasn't working... hmmm maybe I should've downloaded the .dll... lol

Edited by dandymcgee

- Dan [Website]

Link to comment
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.

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
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
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...