Quick Start - iseahound/ImagePut GitHub Wiki
Getting the Latest Version (Method #1)
- 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.)
Stable Release (Method #2)
Download the latest stable release here: https://github.com/iseahound/ImagePut/releases
Copy the script file (Method #3)
-
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.
Overview list:
Accepts:
- base64
- URI
- bitmap (pBitmap)
- buffer
- ptr, stride, height
- ptr, width, height
- ptr, size, stride
- ptr, size, width
- ptr, size, height
- clipboard
- CF_BITMAP
- CF_DIB
- CF_DIBV5
- png
- gif (implemented, not activated)
- cursor
- dc
- desktop
- file
- bmp, dib, rle
- jpg, jpeg, jpe, jfif
- gif (supports animations)
- emf (read only)
- wmf (read only)
- tif, tiff
- png
- ico (read only)
- heic, hif
- webp (read only, supports animations)
- avif, avifs (read only)
- hbitmap
- hex
- hicon / hcursor
- hwnd
- monitor
- object
.pBitmap
.hwnd
.ptr
- randomaccessstream
- screenshot
[x, y, w, h]
[x, y, w, h, window]
- Relative to a window
- 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
Input Types & Output Functions
See Details:Supported encodings / compression formats are listed under file.
No set order of evaluation is guaranteed. To see the current order of evaluation, please look at the function ImageType on the latest version of ImagePut.
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.
Complete Function List
- 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)
Extra Functions:
- 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.