Closed kienns1996 closed 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) }
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)
}
Should be resolved by 666c10456683a2c0e91a33945c9e338ef7c5ff23. Please close this issue after confirming as I cannot. I will be away for a period of time.
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)
}