WindowsCommunityToolkit
WindowsCommunityToolkit copied to clipboard
Animatable tile brush
Fixes #3631
Extends the existing effect animations API to allow creation/manipulation of a CompositionSurfaceBrush
which lets us manipulate a brush's properties directly outside the visual. This was the key into animating a tiled background.
There are some questions and remaining issues to investigate. Not sure if they're issues with the animation APIs or composition. However, the base cases work. I've also validated that between this and ParallaxView
in the platform, they should serve as replacements to the TileControl
so it can be deprecated.
PR Type
What kind of change does this PR introduce?
- Feature
What is the current behavior?
TileControl mass copies an image across a surface to tile it and animate it.
What is the new behavior?
Use BorderEffect
from Win2D to do tiling effect in graphics layer, then expose a way with a new SurfaceBrushFactory
to animate a CompositionSurfaceBrush
's properties via the new 7.0 animation layer.
PR Checklist
Please check if your PR fulfills the following requirements:
- [ ] Tested code with current supported SDKs
- [ ] Pull Request has been submitted to the documentation repository instructions. Link:
- [ ] Sample in sample app has been added / updated (for bug fixes / features)
- [ ] Icon has been created (if new sample) following the Thumbnail Style Guide and templates
- [ ] New major technical changes in the toolkit have or will be added to the Wiki e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
- [ ] Tests for the changes have been added (for bug fixes / features) (if applicable)
- [ ] Header has been added to all new source files (run build/UpdateHeaders.bat)
- [x] Contains NO breaking changes (should be source compatible)
TO DO
- [ ] Investigate issues when using KeyFrame animations or setting other properties like
RotationAngleInDegrees
@Sergio0694 found another odd case here I can send you to help investigate. - [ ] Add other animation helpers besides just OffsetBrushAnimation (should have a suite)
- [ ] Should the source be more than just an image? Like should we have a Win2D Path provider to use @ratishphilip's work as input too?
- [ ] ScreenToGif records oddly (though GameBar is fine...)
- [ ] Not sure about anything else???
Thanks hawkerm for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request ๐
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
:x: hawkerm sign now
You have signed the CLA already but the status is still pending? Let us recheck it.
Hi @hawkerm will you be needing any more assistance on this feature?
- or -
@michael-hawker are we just waiting for brave souls to review this PR?
FYI @XAML-Knight: @hawkerm == @michael-hawker ๐ - This is just my personal account as I was messing around with this for a weekend project and not for anything specific we have priorities on.
I had encountered a few odd edge cases when the confines of the target surface were super narrow, so I was debating if that was a show-stopper or not, though probably more things we should file as potential composition issues.
I should at least clean-up the PR so it can build in the pipeline for easier testing, but we should move this out of the 7.1 milestone as I don't think there'll be time to finalize it (though I may pillage a tiny bit of this for Shadow Animations if it's needed).