Re: ImagePut - A core library for images in AutoHotkey (Now supports HEIC & WEBP)
Posted: 28 Feb 2024, 18:04
@iseahound .impressive work!
Let's help each other out
https://www.autohotkey.com/boards/
https://www.autohotkey.com/boards/viewtopic.php?f=83&t=76633
Code: Select all
; 窗口类
ImagePutWindow("ahk_class notepad")
Code: Select all
Error: Image type could not be identified.
---- d:\LibV2\ImagePut.ah2
565: If ComObjQuery(image, "{A2296057-EA42-4099-983B-539FB6505426}")
566: Return "D2dBitmap"
▶ 569: Throw Error("Image type could not be identified.")
570: }
572: {
The current thread will exit.
Code: Select all
; 或将类型声明为截屏:
ImagePutWindow({screenshot: "Untitled - Notepad", crop: [0, 0, 100, 100]}) ; 使用 BitBlt 进行屏幕捕捉
Code: Select all
Error: This value of type "String" has no method named "Has".
---- d:\LibV2\ImagePut.ah2
1422: image := [x, y, w, h]
1423: }
▶ 1429: If image.Has(5) and WinExist(image[5])
1429: {
1430: Try
Code: Select all
; 或将类型声明为截屏:
ImagePutWindow({window: "Untitled - Notepad", crop: [0, 0, 100, 100]}) ; 使用 PrintWindow 进行窗口捕获
Code: Select all
Error: pBitmap cannot be zero.
---- d:\LibV2\ImagePut.ah2
314: cleanup := "stream"
318: If !(pBitmap := this.ImageToBitmap(type, image, keywords))
▶ 319: Throw Error("pBitmap cannot be zero.")
323: (validate) && DllCall("gdiplus\GdipImageForceValidation", "ptr", pBitmap)
324: (crop) && this.BitmapCrop(&pBitmap, crop)
The current thread will exit.