You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use the CPP Hello Composition sample. Just change AddElement method in CompositionHost.cpp by this:
void CompositionHost::AddElement(float size, float x, float y)
{
if (m_target.Root())
{
auto visuals = m_target.Root().as<ContainerVisual>().Children();
// create a layer
auto layer = m_compositor.CreateLayerVisual();
layer.Size({ size, size });
layer.Offset({ x, y, 0.0f, });
// add a shadow
auto shadow = m_compositor.CreateDropShadow();
shadow.BlurRadius(10);
shadow.Color({ 255, 100, 100, 100});
shadow.SourcePolicy(CompositionDropShadowSourcePolicy::InheritFromVisualContent);
layer.Shadow(shadow);
// add a child element
auto element = m_compositor.CreateSpriteVisual();
uint8_t r = rand() % 255;
uint8_t g = rand() % 255;
uint8_t b = rand() % 255;
element.Brush(m_compositor.CreateColorBrush({ 255, r, g, b }));
element.Size({ size, size });
// insert layer
layer.Children().InsertAtTop(element);
visuals.InsertAtTop(layer);
}
}
When you run the sample and add elements, it doesn't look good. What's worse is if you open another window (for example you open Notepad) and move this new window around and over the sample window with elements, it creates very strange artifacts on drawn elements that look like a bug in the composition engine.
If I remove the shadow.SourcePolicy line or remove the shadow completely, it seems to work as expected.
Is there anything that can be done to fix this? any workaround?
I've not found a way to capture the screen because the system updates the surface properly as soon as we change focus, or capture the screen (print screen, etc.).
I'm using Windows 10 20H2 19042.789 (latest non insider) and compiled using Visual Studio 2019, x64.
The text was updated successfully, but these errors were encountered:
Hi @smourier, thanks for your thorough explanation of the issue. We are currently aware of this problem and are tracking it in an internal bug work item. Unfortunately we don't have a current fix or workaround, nor do we have an estimate on when the fix might be available. When we do address it we'll circle back to this thread, but in the meantime I just wanted to set the right expectation that this might take a while and it's unclear when that will be. Hope this helps!
Hi,
I use the CPP Hello Composition sample. Just change
AddElement
method inCompositionHost.cpp
by this:When you run the sample and add elements, it doesn't look good. What's worse is if you open another window (for example you open Notepad) and move this new window around and over the sample window with elements, it creates very strange artifacts on drawn elements that look like a bug in the composition engine.
If I remove the shadow.SourcePolicy line or remove the shadow completely, it seems to work as expected.
Is there anything that can be done to fix this? any workaround?
I've not found a way to capture the screen because the system updates the surface properly as soon as we change focus, or capture the screen (print screen, etc.).
I'm using Windows 10 20H2 19042.789 (latest non insider) and compiled using Visual Studio 2019, x64.
The text was updated successfully, but these errors were encountered: