Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Feature Requests

Reply
 
Thread Tools Display Modes
Old 04-03-2019, 10:31 PM   #41
Embass
Human being with feelings
 
Embass's Avatar
 
Join Date: Jan 2014
Posts: 347
Default

just workaround.. transparent gfx window example (windows os only).
https://stash.reaper.fm/manage_file/...%20example.lua
Embass is offline   Reply With Quote
Old 04-05-2019, 11:06 AM   #42
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,584
Default

I have added new "reaper.JS_Composite" functions to version 0.980 of the js_ReaScriptAPI extension, to implement cfillion's suggestion. These functions blend LICE bitmaps into REAPER windows.

Results may be affected by OS version (and perhaps even screen refresh rate?), but in my own tests:
* Compositing works perfectly on macOS, without any flickering;
* On WindowsOS, there is still a slight but noticeable glitching when the window is scrolling;
* Linux doesn't flicker, but per-pixel alpha blending isn't working.

An unconventional application of these functions would be for theming UI elements:

Last edited by juliansader; 04-05-2019 at 03:02 PM.
juliansader is offline   Reply With Quote
Old 04-05-2019, 11:32 AM   #43
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 5,956
Default

Quote:
Originally Posted by Embass View Post
just workaround.. transparent gfx window example (windows os only).
https://stash.reaper.fm/manage_file/...%20example.lua
That link will only work for you.

https://stash.reaper.fm/36003/transp...%20example.lua
Lokasenna is offline   Reply With Quote
Old 04-07-2019, 12:32 PM   #44
Embass
Human being with feelings
 
Embass's Avatar
 
Join Date: Jan 2014
Posts: 347
Default

link: https://drive.google.com/file/d/1jTy...ew?usp=sharing
Embass is offline   Reply With Quote
Old 04-08-2019, 01:17 AM   #45
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,584
Default

Quote:
Originally Posted by Embass View Post
just workaround.. transparent gfx window example (windows os only).
https://stash.reaper.fm/manage_file/...%20example.lua
It is very useful to have a "bag of tricks" for getting transparent windows and other interesting UI features!
juliansader is offline   Reply With Quote
Old 04-08-2019, 02:00 AM   #46
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,584
Default

Good news! Alpha blending on Linux has been enabled in the newest version of REAPER!

(Somewhat unexpectedly, JS_Composite now seems to work better on Linux and macOS than on Windows.)

Also, v0.981 of the ReaScriptAPI extension has also been uploaded, with a few improvements in JS_Composite. For example, if the destination width or height is set to -1, the image will be stretched to fill the target window if the window is resized.
juliansader is offline   Reply With Quote
Old 04-09-2019, 01:39 AM   #47
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,414
Default

edit...

Last edited by Sexan; 04-11-2019 at 01:59 PM.
Sexan is offline   Reply With Quote
Old 04-11-2019, 10:42 AM   #48
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,584
Default

As mentioned above, I implemented the idea to intercept WM_PAINT, and it works perfectly on Linux and macOS.

Unfortunately, on WindowsOS, it still glitches. I therefore tried to get REAPER to draw into an offscreen memory bitmap instead of the screen, so that this bitmap and the script's LICE bitmap can be composited before blitting to the screen. WM_PAINT can optionally point to a memory bitmap in its WPARAM parameter, but code such as this didn't work, so I suspect that REAPER's windows ignore the WPARAM pointer:
Code:
RECT r{0,0,0,0};
GetClientRect(hwnd, &r);
HDC clientDC = GetDC(hwnd);
HDC memDC = CreateCompatibleDC(clientDC);
HBITMAP memBitmap = CreateCompatibleBitmap(clientDC, r.right, r.bottom);
SelectObject(memDC, memBitmap);

LRESULT result = SendMessage(hwnd, WM_PAINT, (WPARAM)memDC, lParam);

AlphaBlend LICE into memDC;

BitBlt(clientDC, 0, 0, r.right, r.bottom, memDC, 0, 0, SRCCOPY);

DeleteObject( memBitmap );
DeleteDC( memDC );
Changing WM_PAINT into WM_PRINT or WM_PRINTCLIENT didn't work either (or at least, not with the options that I tried).
juliansader is offline   Reply With Quote
Old 04-30-2019, 10:00 PM   #49
future-bit
Human being with feelings
 
future-bit's Avatar
 
Join Date: May 2008
Location: Russian Federation, Balashiha, Moscow region
Posts: 18
Default

+1 good idea!
future-bit is offline   Reply With Quote
Old 05-01-2019, 04:12 AM   #50
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 3,048
Default

+1 from me too! I've been experimenting a little with things placing progress bars in other script GUI's (eg - the script doing the work has no GUI) - but so far it's been a little flickery.
__________________
Projects - Reascripts - Lua:
LBX Stripper | LBX Chaos Engine | LBX Floating FX Positioner | LBX SRD Smart Knobs
Donate via Paypal
lb0 is online now   Reply With Quote
Old 05-23-2019, 03:42 PM   #51
lexomir
Human being with feelings
 
Join Date: Oct 2018
Posts: 2
Default

+2 YES, I've been needing this for a while
lexomir is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:19 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.