basic image editor (paint, highlight, ellipse, rectangle, text and some graphic FX
watermark captured image
no 3rd party tools or DLLs used - pure AutoIt!
fully portable - no installation is needed
To do:
capture content of scrollable window/control
capture cascaded menus
Due to DllCall("User32.dll", "int", "PrintWindow", "hwnd", $hWnd, "handle", $hMemDC, "int", 0) limitation some windows cannot be captured properly (GDI+, ProgDVB, etc.) but can take screenshots of hidden windows. One workaround is to use full screen capturing (F11/F12) or "Grab Screen" function! Or try double click with rmb on listview items (beta).
It is designed for Vista+ operating systems with AERO enabled! E.g. on WinXP machines some functions are not working properly and might crash the application!
Be aware to deactivate DEP or add Windows Screenshooter exe to the exception list otherwise it will hard crash on some functions, e.g. About Intro, image editing functions. Further AV scanners may a negative impact the execution of compiled exe!
Numpad ↑ 8: Scroll preview window up Numpad ↓ 2: Scroll preview window down Numpad ← 4: Scroll preview window left Numpad → 6: Scroll preview window right Numpad +: zoom in preview window or mousewheel down Numpad -: zoom out preview window or mousewheel up
F5: refresh Windows Name list PRINTSCREEN: take screenshot from whole screen using PRINTSCREEN code ALT+PRINTSCREEN:take a screenshot from active window using ALT+PRINTSCREEN build-in code F10: Undo made changes with Image Editing function F11: take screenshot from whole screen incl mouse cursor F12: take screenshot from whole screen Ctrl+Alt+F12: take a screenshot of active window using alternative screenshot functionality (beta). should work also for some games !
Only available on Vista+ os: double click with rmb on list items to use alternative screenshot functionality (beta)!
When 'Grab Screen' is clicked you can hold down the ctrl key to switch to 'grab controls' mode. Control under mouse will be framed red. ctrl + shift will take the screenshot of appropriate control. To capture GUI menues you can press rmb which simulates the lmb. When a menu is opened press shift additionaly to capture it. Press and hold only the shift key to capture any region on the desktop using freehand capturing - release it so capture marked regions! Or just mark resizeable area which you want to grab. Press CTRL key to grab marked area or right mouse button to capture the marked area every x seconds for a duration of y seconds.
When saving the image just enter the extension you whish to use (*.jpg;*.png;*.bmp;*.gif;*.tif;*.pdf). Big thanks to taietel for his PDF UDF!
Maybe it is useful for someone...
Any kind of comment is welcome.
Br, UEZ
Change log:
Spoiler
2010-12-09: made some modifications to the code. GUIRegisterMsg($WM_PAINT, "Redraw") and GUIRegisterMsg($WM_NCPAINT, "Redraw") not working properly on os less than Vista, added About intro ;-), to test progDVB in progress, added clipboard button 2010-12-11: made some adjustments to some parts -> calling it now final 2010-12-15: added ♬ chip tune ♫ to About part. Now source code too large to post here in the window directly! 2010-12-16: switched from fmod.dll to bassmod.dll because bassmod.dll is much smaller. Also changed xm chip tune... 2010-12-18: made some adjustments to some parts 2010-12-20: removed GUIRegisterMsg($WM_PAINT, "Redraw") and added _GDIPlus_GraphicsDrawImageRect() do main While/Wend loop for a better GUICtrlCreateListView() selection (old one doing most time a drag'n'drop when selecting items in list view. 2011-01-07: added dancing gif animation to About intro part and changed selection code in ListView section (thanks Oscar for some help). 2011-01-12: added web screenshot feature which is working only on Vista+ os and fixed some bugs. To do: zooming of preview window. 2011-01-15: added zoom and scroll feature to preview screen. 2011-01-16: fixed a bug. 2011-01-17: forgot to reset movement of preview screen - should be ok now. 2011-01-18: added full screen capture feature, mousewheel functionality for zooming preview screen and some little changes in About intro part. I think I reached now the end of developing this tool. 2011-01-19: mouse wheel is not working properly with listviews when focus is set to an listview item. Changed code. 2011-01-22: added preview and JPG save quality settings, some minor code adjustments - thanks Raupi for the help of some GUI issues. 2011-01-23: fixed a bug when grabbing a region on screen (MouseCoordMode wrongly set) and added reset function to reset preview screen after zooming or/and moving. 2011-01-24: when taking a screenshot from a web site (e.g. chip.de) a new IE window will be opened for any reason. Should be fixed now. Some small adjustments made. 2011-01-25: fixed flickering with WinXP of preview screen. Added screenshot from whole screen incl. mouse cursor and a timeout when making a screenshot from websites. 2011-01-26: added feature to scroll preview screen with mouse and fixed some small bugs. 2011-01-28: fixed "Put to Clipboard" function, added image editing function (b/w & greyscale) and alternative windows capturing function (double rmb click on listview elements) 2011-01-29: added bitmap invert function 2011-02-06: added Undo Ctrl menu 2011-02-27: added a zoom preview window when selecting "Grab Screen" for a more precise screen grab possibility. Fixed memory leak issue. 2011-02-27: fixing the memory leak caused that the clipboard not worked when creating screenshots from web sites - should be fixed now. Made some small modifications to the zoom preview window. 2011-03-01: some small adjustments in intro section to display child gui properly. 2011-03-14: added sort functionality for listview control + pixel color display in tooltip when grabbing screen area 2011-03-22: limited web screenshot max. height to 8192 pixel when IE9 is used otherwise screen will be white only; added time stamp feature to saved images (right buttom corner the current date and time will be added) 2011-04-16: added zoom level control with mouse wheel when capturing desktop region + some small modifications 2011-05-09: small adjustments on ToolTip when grabbing area on desktop (clever positioning of ToolTip window still needed to be done) and added ctrl+alt+F12 key to take screenshot from active window (should work also for some games in fullscreen) 2011-05-19: modified tooltip position when capturing desktop not to leave visible area 2011-07-27: fixed the crash bug on WinXP os when selecting program's handle + added function to send image to printer and execute saved image with default app. 2011-07-28: added DllClose() for opened dlls via DLLOpen() functions 2011-07-31: integrated windows print and alt+print functionality 2011-08-05: added feature to grab controls directly 2011-08-11: added feature to capture GUI menues (little bit tricky to do it), added cross crosshair in zoom window for a more precise screen capture and added sound when capturing is done 2011-08-13: added export to PDF format (thanks to taietel for the PDF UDF), just save the image as filename.pdf 2011-08-15: added image rotate 90° to left and right and changed key to make screenhot of controls 2011-08-16: added online versions check 2011-08-26: some internal changes and bug fixes, added sound when capturing has finished, program update check, open default mail client to paste image and freehand capturing 2011-08-28: fixed some issues with WinXP display and non aero desktops 2011-08-30: memory leak bug fixed when doing freehand cpaturing 2011-09-05: GUI changed a little bit, added grab to AVI function (no compression available currently) and ruler, some bugs fixed 2011-09-06: fixed a bug when using ruler on multi monitor environment 2011-09-07: changed ruler function to work properly on WinXP and turned off blend effect when closing the tool for WinXP machines (maybe that is the reason for the crashes when pushing the X button 2011-09-09: some small adjustments to the ruler function 2011-09-12: fixed a bug when web page size is larger than 8192x8192, added option to recapture marked region 2011-09-17: added compression feature when grabbing to AVI. It will use only build-in codecs! 2011-09-27: some internal modifications and added URL string to the bottom of the image when Screenshot a Web Site is used! 2011-10-07: added DEP check to avoid hard crash 2011-10-11: fixed a bug when AVI compression window was canceled because AVI file handles weren't released. Embedded some icons instead loading them from a system DLL 2011-10-11: bug fixed for AVI creation (lenght wasn't correct) 2011-10-11: optimized avi capture loop for best performance (still slow because of AutoIt limitations!) and added manual screen area selection for creating avi file 2011-10-30: some internal changes 2011-11-04: added memory fonts to About intro ;-) 2011-11-09: forgot to disable context menu while playing About intro 2011-11-17: changed grab region code. Now you can mark an area and resize marked area to do a more precise capturing 2011-11-17: some bugs in Grab Screen function fixed 2011-11-18: fixed a lot of bugs in Grab Screen function 2011-11-20: still fixed some bugs in Grab Screen function (grrr) 2011-12-01: some bugs in Grab Screen function found and changed screen capture windows a little bit 2011-12-15: small modifications and some bugs fixed 2011-12-16: fixed clipboard bug after AVI movie has been taken 2012-02-09: fixed preview aspect ratio and some small changes 2012-02-16: fixed a bug when printscreen was pressed - program was closing on clipboard error 2012-04-18: fixed some bugs, memory leaks and added a Basic Image Editor 2012-04-19: made small modifications to the Basic Image Editor and some bugs fixed 2012-05-01: fixed some bugs in Basic Image Editor (e.g. scrollbar -> control positioning) and added some more feature to Basic Image Editor: some more gfx FX, text rotation, backbuffer for all painting apps to avoid flickering, changed code for highlighting 2012-05-03: fixed several compatibility issues with WindowsXP 2012-05-05: fixed several bugs in Basic Image Editor (probably there are still a lot of bugs) 2012-05-10: interim release until issue with asm codes are fixed 2012-05-18: speed up mark function and added option to put image to clipboard automatically which will suppress messagebox window. ASM functions still unstable 2012-05-20: forgot to close Basic Image Editor window when it has crashed unexpected after ASM gfx fx call 2012-05-21: forgot to release GDI+ handles when closing Basic Image Editor window and prepare bitmap from image editor to put to clipboard 2012-05-28: added Endless option to Grab Screen to Avi endless (ESC ends capturing), [i]Put image to clipboard automatically[i] option added, option to change width of captured web image (800, 1024, 1280 and width of desktop), web screenshot is working now properly also on Win8 and you can move marked screen now 2012-05-29: fixed small bug in About Intro, when intro ends automatically it will end after 2nd call immediately. Thanks to ISI360 for reporting it! 2012-06-01: add feature to abort video capturing with ESC key in each mode (thanks Tweaky for all your suggestions!) and removed 8190 pixel height limit for web screenshot 2012-06-02: activated again 8190 pixel height limit when IE9 is used for rendering the web site (web screenshot). Seems to be a problem with ActiveX control and IE9 2012-06-09: video capturing in endless mode didn't work (thanks Tweaky for all your testings and reports :-) !!!), removed ugly border for maximized windows, changed code for WinXP to draw in image editor when entered 2nd time the image editor, fixed a bug in grab screen mode (captured size and marked size differed), fixed a bug in function _WinAPI_SetWindowTitleIcon() 2012-06-21: changed bitmap undo function, fixed a bug in marking desktop area (grabbed size was not the same as marked area), pen size was not reset when entering image editor again, fix a bug when print or alt print was pressed and "Send current image via mail" was called (clipboard was overwritten with selected image from the listview), modified update check function 2012-07-04: some cosmetic changes only 2012-09-05: fixed a bug (crash) when 'Screenshot a Web Site' was started after the intro has been watched. Some more internal modifications 2012-10-05: changed describtion STRG to CTRL and fixed a bug in the clipboard function (thanks to wakillon for reporting it), small adjustment in alternative windows capturing function (double click the rmb in list view) and removed final from the name 2012-11-12: fixed some small bugs, added resize function to image editor and added watermark functionality as separate GUI (might be instable at the moment!) 2012-11-14: fixed some small bugs in Watermark sub functions, Watermark function should be more stable now 2012-11-16: fixed an issue in Watermark GUI when it is used on non aero desktops and moves the GUI off the screen and back the GUI got messed up 2012-12-07: added improved Watermark app which will be release soon as standalone tool, changed icons background in context menus (not transparent anymore) to avoid ugly behaviour when mouse is hovering it, small modifications to the clipboard and update check function 2012-12-08: fixed a bug in Watermark app (when enter key was pressed: executed last marked item although not actually selected) 2012-12-12: fixed a bug when screenshot was done via print key and bitmap was modified afterwards the clipboard button still stays disabled, added feature to rotate text in watermark app with right mouse button 2012-12-31: fixed some issues with WinXP (app crash) 2013-02-01: fixed a bug in undo function on main screen when returning from image editor / watermark app 2013-02-03: found and fixed a bug in watermark app when stamp image was loaded but the position on image was adjusted 2013-02-11: added donate menu item and button :-) 2013-02-22: added option to capture (Grab Screen) a marked area every x seconds for a duration of y seconds 2013-05-14: fixed a bug in Watermark function (app crash) when using stamp images and made some internal modifications
Edited by UEZ, Yesterday, 02:25 PM.
Zoldex, wakillon and JScript like this
The own fart smells best!✌ Her 'sikim hıyar' diyene bir avuç tuz alıp koşma! ¯\_(ツ)_/¯
I don't have a ProgDVB card to test it yet only an USB DVB-T card! I will test it for DVB-T and when it is not working I will have a look to your code!
Thanks for the hint!
Br,
UEZ
The own fart smells best!✌ Her 'sikim hıyar' diyene bir avuç tuz alıp koşma! ¯\_(ツ)_/¯
ProgDVB is "Universelle und leistungsfähige Software für digitales Fernsehen und zum Hören von Radioprogrammen." See here - progDVB ProgDVB works with DVB-S,DVB-S2,DVB-T & DVB-C This pic was created by my script now from France 24.
Thanks again UEZ! I'm still studying your GDI+ scripts . I have made a game for my son (with numbers on the buttons) and now I'm trying to somehow split a given image into small ones (a matrix) and then randomly put them on the buttons (like a shuffled puzzle). DON'T TELL ME THE SOLUTION! When I'll give up, I'll shout.
I'm not happy with the method to make screenshots of maximized windows because of the black frame and not taking screenshots properly from GDI+ windows! DllCall("User32.dll", "int", "PrintWindow", "hwnd", $hWnd, "handle", $hMemDC, "int", 0) ist not the best choice...
Maybe somebody knows a better way to do it...
Br, UEZ
PS: for the Intro part press on the left upper icon from the window and select About...
Edited by UEZ, 24 January 2011 - 09:57 AM.
The own fart smells best!✌ Her 'sikim hıyar' diyene bir avuç tuz alıp koşma! ¯\_(ツ)_/¯
When using the window close x it imediately freezes the screen for a while (between 5 and 30 seconds I've observed) then fades out and I get the windows notice that its stopped working, and should I debug, look online for solution, or close the program.