Rendering UI with Sciter on top of the window - c++

I have an 3d game renderer with DirectX 11 - the project also uses WinAPI.
On top of the game, I would like to render HTML/CSS UI with Sciter (it's a single, full screen game window).
So I initially draw the 3D scene with my engine->render().
And then I draw UI with Sciter (for now it's just load_file(....htm)). The problem is, the UI covers the whole window (with white background), and I cannot see the game through UI.
How can I apply transparency to "mask" between UI and what was rendered to window previously?
I have already tried SciterSetOption(*hwnd, SCITER_ALPHA_WINDOW, TRUE); but that makes white background transparent for whole window (I see what is behind the window, the desktop - not the 3D scene of mine which also is transparent :/ ).
I set html, body { background-color: transparent; } without result.

You don't need to render your UI in separate window as Sciter is capable of rendering HTML/CSS stuff directly inside DirectX 3D scene:
Check http://sciter.com/sciter-and-directx/ article.

Related

WinUI3 : How to put an translucent grey overlay on Canvas

I'm working on a WinUI3 desktop application in c++. I was trying to achieve an experience where we can show a ProgressRing in the center of the screen when there is a delay in screen update. In my application, my window has a Canvas as its content and that canvas contains many widgets. I want to put a new Canvas as an overlay on top of the existing Canvas and show a ProgressRing on the new Overlay Canvas and I was able to achieve an experience like this.
The overlay Canvas in the image has a background color as transparent, I wanted to make the overlay canvas translucent. So that all the widgets below the overlay canvas will look like grayed-out non-interactive widgets.
I would be of great help if you could help me with this issue.
Thank you,
Harshithraj P
One way to do that is to set the Background("Black" maybe?) and the Opacity depending on how you want it to look.

How can I make the background of my DirectX window invisible?

For example, I am drawing images on the DirectX11 window. I do not want to show the black background of the window, only the image being drawn. A good example would be of pretty much any MMORPG launcher window.
As you can see in the image above, the World of Warcraft launcher alphas out the black background of the DirectX window, and only shows the launcher part of the window.
How would I do this in DirectX c++?

How can I draw around a rectangle?

I'm using openGL to draw some animation.
I want to draw the animation in an area around a rectangle.
That rectangle are should be transparent, to show whatever windows happen to be there, and leave that to regular windows MFC drawings.
I know there should be away to do it with clipping. But since whatever is in that rectangle isn't drawn with the openGL I'm not sure that will work well.
I'm using openGL with c++.
Solution:
If you are drawing over unrelated windows, you should use Stencil buffer.
This can be used as a masking layer to decide where you want to draw.
If you have an MFC window with a child window, you can create the "father" window with the following style: WS_CLIPCHILDREN

How can I draw a selection rectangle on the screen with Qt?

How can I draw a selection rectangle on my screen with Qt in X11?
I want to be able to drag a rectangle on my screen (outside of the application) and then save the whole rectangle.
Thanks in advance.
Part of the solution will involve using the grabWindow() function of QPixmap like so:
QPixmap::grabWindow(QApplication::desktop()->winId());
Qt has an example program for this here.
There rest of the solution, drawing the area to grab, can probably be achieved by either using a full screen transparent window to render a mouse drawn rectangle and then taking the section it outlines from the grabbed desktop image or using a full screen window with the entire grabbed screen painted on it.

Need transparent overlay window to draw lines on top of window drawing video? ::MFC,C++,windows::

How do you create a transparent window that can be placed over another window that is actively having streaming video drawn to it. I want to create a window on top of the video window that I can draw on without video constantly drawing back over it.
I can create a window from a transparent dialog resource and set its z-order using SetWindowPos(...) but it doesn't seem to have any effect. Having the dialog set as a WS_CHILD style or WS_POPUP also appears to have no effect.
I'm using a media (video) framework another development group in my company developed and am providing a window handle to that code. That handle is being used by their rendering plugin in the pipeline that uses Direct3d for rendering the video on that window surface.
Video is rendered to a hardware overlay in the video adapter. You'll need to create your own to overlay that overlay. I think DirectX provides that capability, you can also get it by using the WS_EX_LAYERED window style and the SetLayeredWindowAttributes(). Which you'll need to set the transparency key. Not so sure that's a slam-dunk btw, I've seen this behave oddly.