-
Notifications
You must be signed in to change notification settings - Fork 28
Quick Start
Edison Hua edited this page Nov 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
- 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)
-
The following formats are rendered:
- svg
- 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
- 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.
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.
- 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, title?, pos?, style?, styleEx?, parent?, playback?, cache?)
- ImagePutEncodedBuffer(image, extension?, quality?)
- 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?)
- ImagePutSharedBuffer(image, name?)
- ImagePutStream(image, extension?, quality?)
- ImagePutUri(image, extension?, quality?) - Uniform Resource Identifier
- ImagePutUrl(image, extension?, quality?) - Uploads to Imgur.
- ImagePutWallpaper(image)
- ImagePutWICBitmap(image)
- ImagePutWindow(image, title?, pos?, style?, styleEx?, parent?, playback?, cache?)
- ImageShow(image, title?, pos?, style?, styleEx?, parent?, playback?, cache?) - 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.