Transparency of Onscreen Window Background

XX---In PSYCHTOOLBOX@yahoogroups.com, <i77pfkjgjr5rdfh7iawc724fnw2hhoxiblnxubhx@...> wrote :

Hi All, 


-> Hi Rebecca


I am working on a university project for web browsing using brain signals. 


I am displaying a set of 4 stimuli on a blank background at the moment, which completely hides any open windows. 


I would like to change this in such a way that the browser window shows instead of the black background. I have two questions:


(1) Is it possible to change the black background to a transparent background?


I have tried a function called PsychDebugWindowConfiguration(opaqueForHID, opacity), which i found from docs.psychtoolbox.org. This changes the transparency level of the onscreen window.


The problem is that I am using the function PsychImaging to prepare the onscreen window for drawing of stimuli, which results in a coloured background. Any changes of transparency are thus applied to the coloured background, and any windows are still completely hidden from the user. 


-> You are on the right track. PsychDebugWindowConfiguration(opaqueForHID, 1); would enable an onscreen window with a global opacity of 1.0 ie. solid/intransparent, but allows then to set transparency on a per-pixel basis. It also disables any kind of precise time-stamping, as in this transparent mode, visual stimulus timing/timestamping will be likely unreliable/inaccurate/not trustworthy.


-> Now the alpha value of each drawn pixel determines if the pixel is transparent for the background: E.g., a


[win, winrect] = Screen('Openwindow', 0, 0);

Screen('FillRect', win, [0,0,0,0], CenterRect([0 0 400 400], winrect));

Screen('Flip', win)


would create a transparent 400x400 rectangle due to [r,g,b,a] = [0,0,0,0] ie. a = 0, in the center of the window, where the webbrowser could shine through.


(2) Can Psychtoolbox allow another application to display over/on the onscreen window, such as by streaming the browser window? 


In theory Screen('Preference', 'WindowShieldingLevel', 0); would ask for that, but in practice you will get somewhat different behavior on different operating systems (Linux vs. Window vs OSX) and even OS versions of the same OS, so may or may not work on any given setup. Method (1) is more reliable - minus any timing precision.


-mario



I am using a Windows (8.1) OS.


Thank you,

Rebecca