View Single Post
Old 02-10-2020, 07:42 AM   #956
rstockm
Human being with feelings
 
rstockm's Avatar
 
Join Date: May 2012
Location: Berlin, Germany
Posts: 171
Default

Quote:
Originally Posted by Edgemeal View Post
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
I figure this will not/never work on MacOS?
rstockm is offline   Reply With Quote