Skip to content
Closed
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b0c6539
Added tiles brush section
Feb 11, 2025
8648684
Added tiles brush section
Feb 13, 2025
089e594
Added acrylic brush sample
Feb 13, 2025
45838e6
Adding backdrop blur brush sample
Feb 13, 2025
bd295ad
Updated with Trex png
Feb 18, 2025
08f5e24
Added all brush sample types
Feb 18, 2025
ae7d897
Added markdowns for sample
Feb 19, 2025
ec616df
Updated acrylic and backdrop blur brush samples
Feb 19, 2025
50689de
Updated brush samples
Feb 19, 2025
909a8a5
Updating all the brush samples
Feb 20, 2025
69eb5b4
PipelineVisualFactory sample changes
Feb 20, 2025
c4c177f
Renaming namespace
Feb 20, 2025
36170ce
Naming bug fix
Feb 20, 2025
5df4ebb
Merge branch 'main' into erinwoo/media-samples
Arlodotexe Feb 24, 2025
1a6b938
Icon update + xaml styler
Feb 25, 2025
4ca78cc
Merge branch 'erinwoo/media-samples' of https://github.com/erinpwoo/W…
Feb 25, 2025
fbd104e
Merge branch 'main' of https://github.com/CommunityToolkit/Windows in…
Mar 3, 2025
58990e4
Small comments
Mar 3, 2025
54689fd
Update AcrylicBrush.md
erinpwoo Mar 3, 2025
5b3158e
Remove AcrylicBrushHostBackdropSample and update XAML files.
erinpwoo Mar 3, 2025
6fd6419
Updated Media .csproj file with new icon asset
erinpwoo Mar 3, 2025
6952f72
Removing new categories / subcategories
erinpwoo Mar 6, 2025
25e018c
Moved all samples to single markdown - Brushes section
erinpwoo Mar 11, 2025
fd738c0
Revert changes to tooling submodule
erinpwoo Mar 11, 2025
e514860
Reset tooling submodule to previous working state (611b3c8)
erinpwoo Mar 11, 2025
ce71a54
Update tooling submodule to latest main (11f8b64)
erinpwoo Mar 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions components/Media/samples/AcrylicBrush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: AcrylicBrush
author: erinwoo
description: A brush that can apply an acrylic background effect.
keywords: brush, acrylic, acrylicbrush
dev_langs:
- csharp
category: Media
subcategory: Brushes
discussion-id: 0
issue-id: 0
icon: Assets/EffectAnimations.png
---
There are two modes for setting the BackgroundSource property when using an `AcrylicBrush`.
Setting it to `Backdrop` results in the acrylic effect being applied to whatever is behind the brush in the application.
> [!SAMPLE AcrylicBrushSample]

Setting BackgroundSource to `HostBackdrop` results in the acrylic effect being applied behind the current application.
> [!SAMPLE AcrylicBrushHostBackdropSample]

To learn more about the acrylic material in Windows: [link](https://learn.microsoft.com/en-us/windows/apps/design/style/acrylic)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions components/Media/samples/BackdropBlurBrush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: BackdropBlurBrush
author: erinwoo
description: A brush that blurs the background in the application
keywords: backdrop, background, blur, brush
dev_langs:
- csharp
category: Media
subcategory: Brushes
discussion-id: 0
issue-id: 0
icon: Assets/EffectAnimations.png
---

> [!SAMPLE BackdropBlurBrushSample]
17 changes: 17 additions & 0 deletions components/Media/samples/BackdropGammaTransferBrush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: BackdropGammaTransferBrush
author: erinwoo
description: A brush which modifies the color values of the brush's background in the application
keywords: back, backdrop, gamma, transfer, brush
dev_langs:
- csharp
category: Media
subcategory: Brushes
discussion-id: 0
issue-id: 0
icon: Assets/EffectAnimations.png
---

Map the color intensities of an image using a gamma function created using an amplitude, exponent, and offset you provide for each channel.

> [!SAMPLE BackdropGammaTransferBrushSample]
15 changes: 15 additions & 0 deletions components/Media/samples/BackdropInvertBrush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: BackdropInvertBrush
author: erinwoo
description: A brush that inverts the colors of the brush's background in the application
keywords: backdrop, invert, brush
dev_langs:
- csharp
category: Media
subcategory: Brushes
discussion-id: 0
issue-id: 0
icon: Assets/EffectAnimations.png
---

> [!SAMPLE BackdropInvertBrushSample]
15 changes: 15 additions & 0 deletions components/Media/samples/BackdropSaturationBrush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: BackdropSaturationBrush
author: erinwoo
description: A brush that can increase or decrease the saturation of the brush's background in the application.
keywords: back, backdrop, saturation, brush
dev_langs:
- csharp
category: Media
subcategory: Brushes
discussion-id: 0
issue-id: 0
icon: Assets/EffectAnimations.png
---
The `Saturation` property specifies a double value for the amount of Saturation to apply from 0.0 - 1.0. Zero being monochrome, and one being fully saturated. The default is 0.5.
> [!SAMPLE BackdropSaturationBrushSample]
Comment thread
erinpwoo marked this conversation as resolved.
Outdated
15 changes: 15 additions & 0 deletions components/Media/samples/BackdropSepiaBrush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: BackdropSepiaBrush
author: erinwoo
description: A brush that applies the sepia effect to the brush's background
keywords: back, backdrop, sepia, brush
dev_langs:
- csharp
category: Media
subcategory: Brushes
discussion-id: 0
issue-id: 0
icon: Assets/EffectAnimations.png
---
The `Intensity` property specifies a double value for the amount of Sepia to apply from 0.0 - 1.0. Zero being none, and one being full Sepia effect. The default is 0.5.
> [!SAMPLE BackdropSepiaBrushSample]
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<Page x:Class="MediaExperiment.Samples.Brushes.AcrylicBrushHostBackdropSample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:media="using:CommunityToolkit.WinUI.Media"
xmlns:ui="using:CommunityToolkit.WinUI"
mc:Ignorable="d">

<StackPanel VerticalAlignment="Center"
Spacing="32">
<Grid>
<!--Background image -->
<Image Source="ms-appx:///Assets/Bloom.jpg"
Height="400"/>
<!--Brush area-->
<Border BorderBrush="Black" BorderThickness=".5" VerticalAlignment="Center" HorizontalAlignment="Center" Width="550" Height="300">
<Border.Background>
<media:AcrylicBrush
BackgroundSource="HostBackdrop"
TintColor="Black"
TintOpacity=".2"
BlurAmount="2"/>
</Border.Background>
<!--Foreground image-->
<Image VerticalAlignment="Center"
Source="ms-appx:///Assets/BrushAssets/Trex.png"
Height="100"/>
</Border>
</Grid>
</StackPanel>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using CommunityToolkit.WinUI.Media;

namespace MediaExperiment.Samples.Brushes;

[ToolkitSample(id: nameof(AcrylicBrushHostBackdropSample), "AcrylicBrushHostBackdrop", description: $"A sample for showing how to apply a {nameof(CommunityToolkit.WinUI.Media.AcrylicBrush)} effect to a background.")]
public sealed partial class AcrylicBrushHostBackdropSample : Page
{
public AcrylicBrushHostBackdropSample()
{
this.InitializeComponent();
}
}
32 changes: 32 additions & 0 deletions components/Media/samples/Brushes/AcrylicBrushSample.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<Page x:Class="MediaExperiment.Samples.Brushes.AcrylicBrushSample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:media="using:CommunityToolkit.WinUI.Media"
xmlns:ui="using:CommunityToolkit.WinUI"
mc:Ignorable="d">

<StackPanel VerticalAlignment="Center"
Spacing="32">
<Grid>
<!--Background image -->
<Image Source="ms-appx:///Assets/Bloom.jpg"
Height="400"/>
<!--Brush area-->
<Border BorderBrush="Black" BorderThickness=".5" VerticalAlignment="Center" HorizontalAlignment="Center" Width="550" Height="300">
<Border.Background>
<media:AcrylicBrush
BackgroundSource="Backdrop"
TintColor="Black"
TintOpacity=".6"
BlurAmount="15"/>
</Border.Background>
<!--Foreground image-->
<Image VerticalAlignment="Center"
Source="ms-appx:///Assets/BrushAssets/Trex.png"
Height="100"/>
</Border>
</Grid>
</StackPanel>
</Page>
16 changes: 16 additions & 0 deletions components/Media/samples/Brushes/AcrylicBrushSample.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using CommunityToolkit.WinUI.Media;

namespace MediaExperiment.Samples.Brushes;

[ToolkitSample(id: nameof(AcrylicBrushSample), "AcrylicBrush", description: $"A sample for showing how to apply a {nameof(CommunityToolkit.WinUI.Media.AcrylicBrush)} effect to a background.")]
public sealed partial class AcrylicBrushSample : Page
{
public AcrylicBrushSample()
{
this.InitializeComponent();
}
}
27 changes: 27 additions & 0 deletions components/Media/samples/Brushes/BackdropBlurBrushSample.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Page x:Class="MediaExperiment.Samples.Brushes.BackdropBlurBrushSample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:media="using:CommunityToolkit.WinUI.Media"
xmlns:ui="using:CommunityToolkit.WinUI"
mc:Ignorable="d">

<StackPanel VerticalAlignment="Center" Spacing="32">
<Grid>
<!--Background image -->
<Image Source="ms-appx:///Assets/Bloom.jpg"
Height="400"/>
<!--Brush area-->
<Border BorderBrush="Black" BorderThickness=".5" VerticalAlignment="Center" HorizontalAlignment="Center" Width="550" Height="300">
<Border.Background>
<media:BackdropBlurBrush Amount="5.0"/>
</Border.Background>
</Border>
<!--Foreground image-->
<Image VerticalAlignment="Center"
Source="ms-appx:///Assets/BrushAssets/Trex.png"
Height="100"/>
</Grid>
</StackPanel>
</Page>
16 changes: 16 additions & 0 deletions components/Media/samples/Brushes/BackdropBlurBrushSample.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using CommunityToolkit.WinUI.Media;

namespace MediaExperiment.Samples.Brushes;

[ToolkitSample(id: nameof(BackdropBlurBrushSample), "BackdropBlurBrush", description: $"A sample that uses a {nameof(BackdropBlurBrush)} to blur whatever is behind the application.")]
public sealed partial class BackdropBlurBrushSample : Page
{
public BackdropBlurBrushSample()
{
this.InitializeComponent();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Page x:Class="MediaExperiment.Samples.Brushes.BackdropGammaTransferBrushSample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:media="using:CommunityToolkit.WinUI.Media"
xmlns:ui="using:CommunityToolkit.WinUI"
mc:Ignorable="d">

<StackPanel VerticalAlignment="Center" Spacing="32">
<Grid>
<!--Background image -->
<Image Source="ms-appx:///Assets/Bloom.jpg" Height="400"/>
<!--Brush area-->
<Border BorderBrush="Black" BorderThickness=".5" VerticalAlignment="Center" HorizontalAlignment="Center" Width="550" Height="300">
<Border.Background>
<media:BackdropGammaTransferBrush RedAmplitude="10" AlphaOffset=".2" />
</Border.Background>
</Border>
</Grid>
</StackPanel>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using CommunityToolkit.WinUI.Media;

namespace MediaExperiment.Samples.Brushes;

[ToolkitSample(id: nameof(BackdropGammaTransferBrushSample), "BackdropGammaTransferBrush", description: $"A sample for showing how to apply a {nameof(CommunityToolkit.WinUI.Media.BackdropGammaTransferBrush)} effect to a background.")]
public sealed partial class BackdropGammaTransferBrushSample : Page
{
public BackdropGammaTransferBrushSample()
{
this.InitializeComponent();
}
}
24 changes: 24 additions & 0 deletions components/Media/samples/Brushes/BackdropInvertBrushSample.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Page x:Class="MediaExperiment.Samples.Brushes.BackdropInvertBrushSample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:media="using:CommunityToolkit.WinUI.Media"
xmlns:ui="using:CommunityToolkit.WinUI"
mc:Ignorable="d">

<StackPanel VerticalAlignment="Center"
Spacing="32">
<Grid>
<!--Background image -->
<Image Source="ms-appx:///Assets/Bloom.jpg"
Height="400"/>
<!--Brush area-->
<Border BorderBrush="Black" BorderThickness=".5" VerticalAlignment="Center" HorizontalAlignment="Center" Width="550" Height="300">
<Border.Background>
<media:BackdropInvertBrush />
</Border.Background>
</Border>
</Grid>
</StackPanel>
</Page>
16 changes: 16 additions & 0 deletions components/Media/samples/Brushes/BackdropInvertBrushSample.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using CommunityToolkit.WinUI.Media;

namespace MediaExperiment.Samples.Brushes;

[ToolkitSample(id: nameof(BackdropInvertBrushSample), "BackdropGammaTransferBrush", description: $"A sample for showing how to apply a {nameof(BackdropInvertBrush)} effect to a background.")]
public sealed partial class BackdropInvertBrushSample : Page
{
public BackdropInvertBrushSample()
{
this.InitializeComponent();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Page x:Class="MediaExperiment.Samples.Brushes.BackdropSaturationBrushSample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:media="using:CommunityToolkit.WinUI.Media"
xmlns:ui="using:CommunityToolkit.WinUI"
mc:Ignorable="d">

<StackPanel VerticalAlignment="Center"
Spacing="32">
<Grid>
<!--Background image -->
<Image Source="ms-appx:///Assets/Bloom.jpg"
Height="400"/>
<!--Brush area-->
<Border BorderBrush="Black" BorderThickness=".5" VerticalAlignment="Center" HorizontalAlignment="Center" Width="550" Height="300">
<Border.Background>
<media:BackdropSaturationBrush Saturation=".2"/>
</Border.Background>
</Border>
</Grid>
</StackPanel>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using CommunityToolkit.WinUI.Media;

namespace MediaExperiment.Samples.Brushes;

[ToolkitSample(id: nameof(BackdropSaturationBrushSample), "BackdropGammaTransferBrush", description: $"A sample for showing how to apply a {nameof(BackdropSaturationBrush)} effect to a background.")]
public sealed partial class BackdropSaturationBrushSample : Page
{
public BackdropSaturationBrushSample()
{
this.InitializeComponent();
}
}
23 changes: 23 additions & 0 deletions components/Media/samples/Brushes/BackdropSepiaBrushSample.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Page x:Class="MediaExperiment.Samples.Brushes.BackdropSepiaBrushSample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:media="using:CommunityToolkit.WinUI.Media"
xmlns:ui="using:CommunityToolkit.WinUI"
mc:Ignorable="d">

<StackPanel VerticalAlignment="Center" Spacing="32">
<Grid>
<!--Background image -->
<Image Source="ms-appx:///Assets/Bloom.jpg"
Height="400"/>
<!--Brush area-->
<Border BorderBrush="Black" BorderThickness=".5" VerticalAlignment="Center" HorizontalAlignment="Center" Width="550" Height="300">
<Border.Background>
<media:BackdropSepiaBrush Intensity=".8"/>
</Border.Background>
</Border>
</Grid>
</StackPanel>
</Page>
Loading