Sign in to follow this  
Followers 0
ashley

screenshot taker and editor

4 posts in this topic

Ok here anoth program that im making for runescape it not 100% done...

I cant think of a way to get it to show the picture in the editor as soon as it loads.

Also i cant think of a way for crop maybe screencap with region but i dont know how to let people choses the region..

So if anybody can help make this better please do...

Code below

#include <GUIConstants.au3>
#include <A3LScreenCap.au3>
#include <IE.au3>
$counter = 000

global $filename, $opendir, $filenameopen, $filenameinput, $openfile
HotKeySet("{^}" & "{Alt}" & "t", "Cap")
#Region ### START Koda GUI section ### Form=c:\documents and settings\windows\desktop\koda\forms\rs\agrorsscreenshottaker.kxf
$AGRORSScreenshotTaker = GUICreate("AGRORS Screenshot Taker", 409, 140, 303, 219)
GUISetBkColor(0x000000)
GUICtrlCreateGroup("", 8, 8, 393, 121)
GUICtrlSetColor(-1, 0xFFFFFF)
$info = GUICtrlCreateLabel("AGRORS Screenshot Taker takes a picture of the whole screen", 16, 24, 307, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$info1 = GUICtrlCreateLabel("Then press open and select a picture and edit it to however you want it", 16, 40, 339, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$info2 = GUICtrlCreateLabel("Total pictures taken: 000", 16, 56, 122, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$Take = GUICtrlCreateButton("Take (Ctrl+Alt+T)", 304, 56, 91, 25, 0)
$open = GUICtrlCreateButton("Open (Ctrl+Alt+O)", 200, 56, 99, 25, 0)
$filenameinput = GUICtrlCreateInput(".png", 88, 96, 289, 21)
$savef = GUICtrlCreateLabel("Save file as:", 16, 96, 62, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Take
        cap()
        Case $open
        open()
    EndSwitch
WEnd

Func Cap()
; Capture full screen
$counter +=001
GUICtrlSetData($info2, "Total pictures taken: " & $counter)
GUICtrlSetColor(-1, 0xFFFFFF)
$filename = GUICtrlRead($filenameinput)
_ScreenCap_Capture($filename)
open()

Endfunc


Func open()
    
    #Region ### START Koda GUI section ### Form=
$oIE = _IECreateEmbedded()
$AGRORSScreenshotTakereditor = GUICreate("AGRORS Screenshot editor", 638, 461, -1, -1, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SYSMENU,$WS_CAPTION,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS))
GUISetBkColor(0x000000)
GUICtrlCreateObj($oIE,8, 8, 620, 412)
$save = GUICtrlCreateButton("Save", 192, 432, 75, 25, 0)
$Open = GUICtrlCreateButton("Open", 280, 432, 75, 25, 0)
$Crop = GUICtrlCreateButton("Crop", 368, 432, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
_IENavigate($oIE, "about:blank", 0)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $save
            
        Case $Open
        $opendir = FileOpenDialog("open pictures", @ScriptDir & "", "Common image files(*.bmp;*.jpg;*.jpeg;*.jpe;*.jfif;*.png)|Uncommon image files (*.pdn;*.tga;*.tif;*.tiff)", 1 + 4 )
        _IENavigate($oIE, $opendir, 0)
        Case $Crop
        
    EndSwitch
WEnd
EndFunc

Share this post


Link to post
Share on other sites



Take a look at my Windows Screener, have all the things you need.

Share this post


Link to post
Share on other sites

Not bad. You could make it hide the GUI to the tray and then take the screenshot.

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  
Followers 0