-
Notifications
You must be signed in to change notification settings - Fork 156
Adding media samples to WCT sample app #639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 14 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
b0c6539
Added tiles brush section
8648684
Added tiles brush section
089e594
Added acrylic brush sample
45838e6
Adding backdrop blur brush sample
bd295ad
Updated with Trex png
08f5e24
Added all brush sample types
ae7d897
Added markdowns for sample
ec616df
Updated acrylic and backdrop blur brush samples
50689de
Updated brush samples
909a8a5
Updating all the brush samples
69eb5b4
PipelineVisualFactory sample changes
c4c177f
Renaming namespace
36170ce
Naming bug fix
5df4ebb
Merge branch 'main' into erinwoo/media-samples
Arlodotexe 1a6b938
Icon update + xaml styler
4ca78cc
Merge branch 'erinwoo/media-samples' of https://github.com/erinpwoo/W…
fbd104e
Merge branch 'main' of https://github.com/CommunityToolkit/Windows in…
58990e4
Small comments
54689fd
Update AcrylicBrush.md
erinpwoo 5b3158e
Remove AcrylicBrushHostBackdropSample and update XAML files.
erinpwoo 6fd6419
Updated Media .csproj file with new icon asset
erinpwoo 6952f72
Removing new categories / subcategories
erinpwoo 25e018c
Moved all samples to single markdown - Brushes section
erinpwoo fd738c0
Revert changes to tooling submodule
erinpwoo e514860
Reset tooling submodule to previous working state (611b3c8)
erinpwoo ce71a54
Update tooling submodule to latest main (11f8b64)
erinpwoo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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] |
32 changes: 32 additions & 0 deletions
32
components/Media/samples/Brushes/AcrylicBrushHostBackdropSample.xaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
16 changes: 16 additions & 0 deletions
16
components/Media/samples/Brushes/AcrylicBrushHostBackdropSample.xaml.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
16
components/Media/samples/Brushes/AcrylicBrushSample.xaml.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
27
components/Media/samples/Brushes/BackdropBlurBrushSample.xaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
16
components/Media/samples/Brushes/BackdropBlurBrushSample.xaml.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); | ||
| } | ||
| } |
22 changes: 22 additions & 0 deletions
22
components/Media/samples/Brushes/BackdropGammaTransferBrushSample.xaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
16 changes: 16 additions & 0 deletions
16
components/Media/samples/Brushes/BackdropGammaTransferBrushSample.xaml.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
24
components/Media/samples/Brushes/BackdropInvertBrushSample.xaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
16
components/Media/samples/Brushes/BackdropInvertBrushSample.xaml.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); | ||
| } | ||
| } |
24 changes: 24 additions & 0 deletions
24
components/Media/samples/Brushes/BackdropSaturationBrushSample.xaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
16 changes: 16 additions & 0 deletions
16
components/Media/samples/Brushes/BackdropSaturationBrushSample.xaml.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
23
components/Media/samples/Brushes/BackdropSepiaBrushSample.xaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.