View Single Post
Old 02-08-2020, 03:55 PM   #954
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,804
Default

Quote:
Originally Posted by juliansader View Post
I've update the extension to v0.999:
Thanks for the updates!

Updated CaptureScreenArea function (API v0.999), no more leak!
Code:
function CaptureScreenArea(x,y,w,h,filename)
  scrnDC = reaper.JS_GDI_GetScreenDC() --< Only available on Windows!
  destBmp = reaper.JS_LICE_CreateBitmap(true,w,h)
  destDC = reaper.JS_LICE_GetDC(destBmp)
  reaper.JS_GDI_Blit(destDC, 0, 0, scrnDC, x, y, w, h)
  reaper.JS_LICE_WritePNG(filename, destBmp, false)
  reaper.JS_LICE_DestroyBitmap(destBmp)
  reaper.JS_GDI_ReleaseDC(scrnDC)
end
Edgemeal is offline   Reply With Quote