-
Notifications
You must be signed in to change notification settings - Fork 28
Quick Start
Edison Hua edited this page Jan 27, 2024
·
72 revisions
- Download a copy of the repository as a zip file.
- Extract.
- Double click demo.ahk. Choose whichever version of AutoHotkey you prefer. You should see the following dancing GIF. Right click the GIF to close. (It's a bit tricky since there are transparent frames.)
Download the latest stable release here: https://github.com/iseahound/ImagePut/releases
-
Create a new AutoHotkey script in the same directory as ImagePut.ahk
#Include *i ImagePut.ahk ; Rename from ImagePut (for v1).ahk
#Include *i ImagePut (for v1).ahk ; If you forgot to rename it
; Show an image from url
hwnd := ImageShow("https://picsum.photos/200")
; Press Win + c to capture screen to file
#c:: filepath := ImagePutFile(0) ; , ImageShow(filepath)
; Capture the current window and save it to desktop and clipboard.
#s:: ImagePutClipboard(ImagePutFile("A", A_Desktop))
- Run the above script. You should see a randomly generated image on screen. Press
Win
+c
orWin
+s
to activate the hotkeys.
- base64
- URI
- bitmap (pBitmap)
- buffer
- clipboard
- CF_BITMAP
- CF_DIB
- CF_DIBV5
- png
- gif (implemented, not activated)
- cursor
- dc
- desktop
- file
- bmp, dib, rle
- jpg, jpeg, jpe, jfif
- gif
- tif, tiff
- png
- ico (untested)
- hbitmap
- hex
- hicon
- hwnd
- monitor
- object
.hwnd
.pBitmap
- pdf
- file
- url
- randomaccessstream
- screenshot
- stream
- IStream
- IWICStream
- MemoryStream
- FileStream
- Anything that inherits from IStream
- sprite
- file
- url
- url
- wallpaper
- wicbitmap
- Only certain 32-bit compatible formats
- window
-
A
- Current Active Window - window title
- ahk_id
- ahk_class
- ahk_exe
- ahk_pid
- ahk_group
- Any combination of the above
- hwnd
-
See Details: Input Types & Output Functions
Supported encodings / compression formats are listed under file.
Known Issue: If there is a file and window with the same name, the file will always be resolved first. Use ImageShow({window: MyHwnd})
to select the window.
- ImagePutBase64(image, extension, quality)
- ImagePutBitmap(image)
- ImagePutBuffer(image) - Creates a pixel buffer for PixelSearch and ImageSearch.
- ImagePutClipboard(image)
- ImagePutCursor(image, xHotspot, yHotspot)
- ImagePutDC(image, alpha)
- ImagePutDesktop(image)
- ImagePutExplorer(image, default)
- ImagePutFile(image, filepath, quality)
- ImagePutHBitmap(image, alpha)
- ImagePutHex(image, extension, quality)
- ImagePutHIcon(image)
- ImagePutRandomAccessStream(image, extension, quality)
- ImagePutSafeArray(image, extension, quality)
- ImagePutScreenshot(image, alpha)
- ImagePutStream(image, extension, quality)
- ImagePutURI(image, extension, quality)
- ImagePutWallpaper(image)
- ImagePutWICBitmap(image)
- ImagePutWindow(image, title, pos, style, styleEx, parent)
- ImageShow(image, title, pos, style, styleEx, parent) - Basically shows the image without the window border. Great for animated GIFs.
- ImageWidth(image)
- ImageHeight(image)
- ImageDestroy(image) - Cleans up the effects of any of the above output functions. Pass in the return values to destroy the image.
- ImageEqual(images*) - Compare any number of images.