Is it possible to add the aero effect in the control itself in WPF?

I have a WriteableBitmap that displays a video in a window. Currently I need to hide the subtitles below. I want to use the aero effect, but only close the bottom of WriteableBitmap.

This means that this is the original:

enter image description here

And I want to add Grid Control, which has an aero effect, like This:

enter image description here

But I don’t know how, I’m already thinking about taking a picture from below and using some kind of effect, and then putting it in the first place, but it looks like low performance for writeableBitmap because it means that it needs to be processed 25 around the image every second ...

Update: Here is my code:

<Grid> <Image x:Name="imgFrame"/> </Grid> private WriteableBitmap bitmap; private void OnVideoFrameRunning(FrameArgs e) { if (null == bitmap) { bitmap = new WriteableBitmap(e.Width, e.Height, 72, 72,PixelFormats.Bgr24, null); imgFrame.Source = bitmap; } bitmap.WritePixels(new Int32Rect(0, 0, e.Width, e.Height), e.Buffer, e.Width * 3, 0, 0); } 
+5
source share
1 answer

You can do something like this:

 <Grid> <Grid.Effect> <BlurEffect Radius="18"/> </Grid.Effect> <TextBlock HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="40" Foreground="#444444" Text="Some Subtitles" Margin="0 0 0 20"/> </Grid> 

Radius = "0": Radius =

Radius = "18":

Radius =

+2
source

Source: https://habr.com/ru/post/1244750/


All Articles