iseahound / ImagePut

A core library for images in AutoHotkey. Supports AutoHotkey v1 and v2.
https://www.autohotkey.com/boards/viewtopic.php?f=83&t=76633
MIT License
116 stars 24 forks source link

Crop() issues #43

Closed kienns1996 closed 5 months ago

kienns1996 commented 5 months ago

When crop placed in high frequency loop, ram memory overflow happened due to not solving Destroy pBitmap, I tried to fix it and it worked

original code: Crop(x, y, w, h) { DllCall("gdiplus\GdipGetImagePixelFormat", "ptr", this.pBitmap, "int*", &format:=0) DllCall("gdiplus\GdipCloneBitmapAreaI", "int", x, "int", y, "int", w, "int", h, "int", format, "ptr", this.pBitmap, "ptr*", &pBitmap:=0) return ImagePut.to_buffer(pBitmap) }

iseahound commented 5 months ago

Should be resolved by 666c10456683a2c0e91a33945c9e338ef7c5ff23. Please close this issue after confirming as I cannot. I will be away for a period of time.