COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 10-17-2018, 05:42 AM   #1
TBProAudio
Human being with feelings
 
TBProAudio's Avatar
 
Join Date: May 2014
Location: Germany
Posts: 433
Default WDL-OL: Transparent window

This small additions to WDL-OL enables transparent plug-in window (like Blue Cats).
Reference


IGraphicsWin.cpp:

Code:
void IGraphicsWin::SetWindowTransparency(int alpha)
{
    if(mParentWnd)
    {
        SetWindowLong(mParentWnd, GWL_EXSTYLE, GetWindowLong(mParentWnd, GWL_EXSTYLE) | WS_EX_LAYERED);
        SetLayeredWindowAttributes(mParentWnd, 0, (BYTE)alpha, LWA_ALPHA);
    }
}
IGraphicsMac.mm:

Code:
void IGraphicsMac::SetWindowTransparency(int alpha)
{
  #ifndef IPLUG_NO_CARBON_SUPPORT
  if (mGraphicsCarbon)
  {
  }
  else
  #endif
  if (mGraphicsCocoa)
  {
    [(IGRAPHICS_COCOA*) mGraphicsCocoa SetWindowTransparency:alpha];
  }
}
IGraphicsCocoa.mm:

Code:
- (void) SetWindowTransparency: (int) _mAlpha
{
    NSWindow* pWindow = [self window];
    CGFloat opacity = _mAlpha / 255.0f;
    [pWindow setAlphaValue:opacity];
    [pWindow setOpaque:NO];
}
__________________
www.tb-software.com/TBProAudio
TBProAudio is offline   Reply With Quote
Old 10-18-2018, 12:53 AM   #2
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: Holland
Posts: 2,904
Default

Cool, thanks!
Tale 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 05:04 AM.


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